aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2015-12-24 00:00:23 -0700
committerAndrew Kelley <superjoe30@gmail.com>2015-12-24 00:00:23 -0700
commit50357dad453845a69efff53370438dc29585dd17 (patch)
treee1a4ade250908bdc8690635d8cfe58c613a2f741 /test/run_tests.cpp
parent9ce36ba0ccd5d7de076e688423862d315ef4233f (diff)
downloadzig-50357dad453845a69efff53370438dc29585dd17.tar.gz
zig-50357dad453845a69efff53370438dc29585dd17.zip
add struct value expression
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index b57228e50e..bc04d3adcd 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -575,6 +575,7 @@ export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 {
}
test_point_to_self();
test_byval_assign();
+ test_initializer();
print_str("OK\n");
return 0;
}
@@ -625,6 +626,10 @@ fn test_byval_assign() {
if foo2.a != 1234 { print_str("BAD - byval assignment failed\n"); }
}
+fn test_initializer() {
+ const val = Val { .x = 42 };
+ if val.x != 42 { print_str("BAD\n"); }
+}
)SOURCE", "OK\n");
add_simple_case("global variables", R"SOURCE(