diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2015-12-23 03:19:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2015-12-23 03:19:22 -0700 |
| commit | e21369a1539063773734432993bc2c23680f0913 (patch) | |
| tree | b48333c170245c8e95f7dd75bcef81a84d4dc9f2 /test/run_tests.cpp | |
| parent | ebd7aeb5411c8dba35d6898524928d7ee905c06b (diff) | |
| download | zig-e21369a1539063773734432993bc2c23680f0913.tar.gz zig-e21369a1539063773734432993bc2c23680f0913.zip | |
codegen: support byvalue struct assignment
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 35fedabc87..b57228e50e 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -574,6 +574,7 @@ export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 { print_str("BAD\n"); } test_point_to_self(); + test_byval_assign(); print_str("OK\n"); return 0; } @@ -612,6 +613,18 @@ fn test_point_to_self() { print_str("BAD\n"); } } +fn test_byval_assign() { + var foo1 : Foo; + var foo2 : Foo; + + foo1.a = 1234; + + if foo2.a != 0 { print_str("BAD\n"); } + + foo2 = foo1; + + if foo2.a != 1234 { print_str("BAD - byval assignment failed\n"); } +} )SOURCE", "OK\n"); add_simple_case("global variables", R"SOURCE( |
