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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index cb536ac631..18e4102b70 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -777,6 +777,19 @@ pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
return 0;
}
)SOURCE", "OK\n");
+
+ add_simple_case("constant expressions", R"SOURCE(
+use "std.zig";
+
+const ARRAY_SIZE : u8 = 20;
+
+pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
+ var array : [u8; ARRAY_SIZE];
+ print_u64(#sizeof(#typeof(array)));
+ print_str("\n");
+ return 0;
+}
+ )SOURCE", "20\n");
}
////////////////////////////////////////////////////////////////////////////////////