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.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 582b2671f2..6858cf1bbc 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -326,6 +326,31 @@ fn void_fun(a : i32, b : void, c : i32) {
}
)SOURCE", "OK\n");
+ add_simple_case("void struct fields", R"SOURCE(
+use "std.zig";
+struct Foo {
+ a : void,
+ b : i32,
+ c : void,
+}
+pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
+ const foo = Foo {
+ .a = void,
+ .b = 1,
+ .c = void,
+ };
+ if (foo.b != 1) {
+ print_str("BAD\n");
+ }
+ if (#sizeof(Foo) != 4) {
+ print_str("BAD\n");
+ }
+ print_str("OK\n");
+ return 0;
+}
+
+ )SOURCE", "OK\n");
+
add_simple_case("mutable local variables", R"SOURCE(
use "std.zig";