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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 4d9de75bfa..318ba36f94 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -2020,6 +2020,13 @@ fn func() -> bogus {}
add_compile_fail_case("bogus compile var", R"SOURCE(
const x = @compile_var("bogus");
)SOURCE", 1, ".tmp_source.zig:2:24: error: unrecognized compile variable: 'bogus'");
+
+
+ add_compile_fail_case("@const_eval", R"SOURCE(
+fn a(x: i32) {
+ const y = @const_eval(x);
+}
+ )SOURCE", 1, ".tmp_source.zig:3:27: error: unable to evaluate constant expression");
}
//////////////////////////////////////////////////////////////////////////////