| author | |
| committer | |
| log | 084911d9b376fa9bea2567f53854511adc6d07ec |
| tree | 87b1f300393047efe3c86fbe37734953f660a312 |
| parent | 942b250895581f01adf52b3d5addd99b7a4bc0d3 |
1 files changed, 16 insertions(+), 0 deletions(-)
test/cases/union.zig+16| ... | ... | @@ -150,3 +150,19 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: &const MultipleChoice2) { |
| 150 | 150 | }); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | ||
| 154 | const ExternPtrOrInt = extern union { | |
| 155 | ptr: &u8, | |
| 156 | int: u64 | |
| 157 | }; | |
| 158 | test "extern union size" { | |
| 159 | comptime assert(@sizeOf(ExternPtrOrInt) == 8); | |
| 160 | } | |
| 161 | ||
| 162 | const PackedPtrOrInt = packed union { | |
| 163 | ptr: &u8, | |
| 164 | int: u64 | |
| 165 | }; | |
| 166 | test "extern union size" { | |
| 167 | comptime assert(@sizeOf(PackedPtrOrInt) == 8); | |
| 168 | } |