| author | |
| committer | |
| log | f78d4ed30c1bd92fc5ecc26c2d5f11751b406255 |
| tree | f0a9143d8c6a682e974768f0b095a159e8db9415 |
| parent | 722b9b9e595027e76ab4255f13ad0eca539358ac |
1 files changed, 4 insertions(+), 1 deletions(-)
test/cases/bugs/1230.zig+4-1| ... | ... | @@ -1,11 +1,14 @@ |
| 1 | const assert = @import("std").debug.assert; | |
| 2 | ||
| 1 | 3 | const S = extern struct { |
| 2 | 4 | x: i32, |
| 3 | 5 | }; |
| 4 | 6 | |
| 5 | 7 | extern fn ret_struct() S { |
| 6 | return S { .x = 0 }; | |
| 8 | return S{ .x = 42 }; | |
| 7 | 9 | } |
| 8 | 10 | |
| 9 | 11 | test "extern return small struct (bug 1230)" { |
| 10 | 12 | const s = ret_struct(); |
| 13 | assert(s.x == 42); | |
| 11 | 14 | } |