diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-02-19 13:13:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-19 13:13:41 -0500 |
| commit | 1fd2d6d88f5f78d879bf38bb3fba7fa2e749d3b0 (patch) | |
| tree | eb5a0740956812678131970687377339fad5a541 /willow/unittest/ir/VerifierTest.cpp | |
| parent | add95b14f74e6dbe04a6efe98ff0f20424930b73 (diff) | |
| download | compiler-1fd2d6d88f5f78d879bf38bb3fba7fa2e749d3b0.tar.gz | |
[willow]: initial IRBuilder API (#9)
- add IRBuilder api
- remove `name` field from `Value`
- fix some bugs in IList interface
- more verifier tests
Diffstat (limited to 'willow/unittest/ir/VerifierTest.cpp')
| -rw-r--r-- | willow/unittest/ir/VerifierTest.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/willow/unittest/ir/VerifierTest.cpp b/willow/unittest/ir/VerifierTest.cpp deleted file mode 100644 index 959d72a..0000000 --- a/willow/unittest/ir/VerifierTest.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include <catch2/catch_test_macros.hpp> - -#include <willow/IR/Context.h> -#include <willow/IR/Module.h> -#include <willow/IR/Verifier.h> -#include <willow/IR/Diagnostic.h> -#include <willow/IR/DiagnosticEngine.h> -#include <willow/IR/Function.h> - -using namespace willow; - -TEST_CASE("valid modules", "[verifier]") { - WillowContext ctx; - std::vector<Diagnostic> diags; - DiagnosticEngine eng( - [&](Diagnostic d) { diags.push_back(std::move(d)); }); - - auto &m = *ctx.addModule("test"); - SECTION("empty module") { - REQUIRE(succeeded(verifyModule(ctx, m, eng))); - REQUIRE(diags.empty()); - } -} - -TEST_CASE("valid function", "[verifier]") { - WillowContext ctx; - std::vector<Diagnostic> diags; - DiagnosticEngine eng( - [&](Diagnostic d) { diags.push_back(std::move(d)); }); - - auto &m = *ctx.addModule("test"); - - Type fty = ctx.types().FunctionType(ctx.types().VoidType(), {}); - auto &fn = *m.emplaceFunction("fn", &m, fty); - - REQUIRE(succeeded(verifyFunction(ctx, fn, eng))); - REQUIRE(diags.empty()); -} - -TEST_CASE("invalid basic block", "[verifier]") { - WillowContext ctx; - std::vector<Diagnostic> diags; - DiagnosticEngine eng( - [&](Diagnostic d) { diags.push_back(std::move(d)); }); - - auto &m = *ctx.addModule("test"); - - Type fty = ctx.types().FunctionType(ctx.types().VoidType(), {}); - auto &fn = *m.emplaceFunction("fn", &m, fty); - // TODO -} |