From 1fd2d6d88f5f78d879bf38bb3fba7fa2e749d3b0 Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Thu, 19 Feb 2026 13:13:41 -0500 Subject: [willow]: initial IRBuilder API (#9) - add IRBuilder api - remove `name` field from `Value` - fix some bugs in IList interface - more verifier tests --- willow/unittest/ir/BUILD.bazel | 16 ------------ willow/unittest/ir/VerifierTest.cpp | 51 ------------------------------------- 2 files changed, 67 deletions(-) delete mode 100644 willow/unittest/ir/BUILD.bazel delete mode 100644 willow/unittest/ir/VerifierTest.cpp (limited to 'willow/unittest/ir') diff --git a/willow/unittest/ir/BUILD.bazel b/willow/unittest/ir/BUILD.bazel deleted file mode 100644 index b41dfcd..0000000 --- a/willow/unittest/ir/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -cc_test( - name = "verifier", - srcs = ["VerifierTest.cpp"], - deps = [ - "//willow", - "@catch2//:catch2_main" - ], - tags = ["ir"] -) - -test_suite( - name = "ir_tests", - tests = [ - ":verifier" - ], -) 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 - -#include -#include -#include -#include -#include -#include - -using namespace willow; - -TEST_CASE("valid modules", "[verifier]") { - WillowContext ctx; - std::vector 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 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 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 -} -- cgit v1.2.3