summaryrefslogtreecommitdiff
path: root/willow/unittest/ir
diff options
context:
space:
mode:
Diffstat (limited to 'willow/unittest/ir')
-rw-r--r--willow/unittest/ir/BUILD.bazel16
-rw-r--r--willow/unittest/ir/VerifierTest.cpp51
2 files changed, 0 insertions, 67 deletions
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 <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
-}