diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-04 23:37:17 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-04 23:37:17 -0700 |
| commit | a11d0aaf62e3ebf2f46307d1546b8105792c8dd0 (patch) | |
| tree | 3dc29343eb5eefa115047b49bf1be23f484aa12c /test/run_tests.cpp | |
| parent | 3c551628268e88c6d6dcbe729e1bc756a689dbda (diff) | |
| download | zig-a11d0aaf62e3ebf2f46307d1546b8105792c8dd0.tar.gz zig-a11d0aaf62e3ebf2f46307d1546b8105792c8dd0.zip | |
progress toward compile time constant expression evaluation
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 13 |
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"); } //////////////////////////////////////////////////////////////////////////////////// |
