| ... | @@ -1,11 +1,14 @@ | ... | @@ -1,11 +1,14 @@ |
| | 1 | const assert = @import("std").debug.assert; |
| | 2 | |
| 1 | const S = extern struct { | 3 | const S = extern struct { |
| 2 | x: i32, | 4 | x: i32, |
| 3 | }; | 5 | }; |
| 4 | | 6 | |
| 5 | extern fn ret_struct() S { | 7 | extern fn ret_struct() S { |
| 6 | return S { .x = 0 }; | 8 | return S{ .x = 42 }; |
| 7 | } | 9 | } |
| 8 | | 10 | |
| 9 | test "extern return small struct (bug 1230)" { | 11 | test "extern return small struct (bug 1230)" { |
| 10 | const s = ret_struct(); | 12 | const s = ret_struct(); |
| | 13 | assert(s.x == 42); |
| 11 | } | 14 | } |