aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 3f5dd6d69c..6d32322ede 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -311,6 +311,26 @@ export fn _start() -> unreachable {
exit(0);
}
)SOURCE", "OK 1\nOK 2\n");
+
+ add_simple_case("void parameters", R"SOURCE(
+#link("c")
+extern {
+ fn puts(s: *const u8) -> i32;
+ fn exit(code: i32) -> unreachable;
+}
+
+export fn _start() -> unreachable {
+ void_fun(1, void, 2);
+ exit(0);
+}
+
+fn void_fun(a : i32, b : void, c : i32) {
+ let v = b;
+ let vv : void = if (a == 1) {v} else {};
+ if (a + c == 3) { puts("OK"); }
+ return vv;
+}
+ )SOURCE", "OK\n");
}
static void add_compile_failure_test_cases(void) {