Zig Version
0.16.0
Steps to Reproduce, Observed Behavior, and Expected Behavior
I hit this misscompilation on 0.16.0. It does not occur on master (0.17.0-dev.1257+67b05e521).
conststd=@import("std");test"bitCast array of bool"{constarr:[4]bool=.{true,true,false,false};constn_true:u3=@popCount(@as(u4,@bitCast(arr)));trystd.testing.expect(n_true==2);}/home/janderson/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ/lib/std/testing.zig:615:14: 0x1238909 in expect (std.zig)
if (!ok) return error.TestUnexpectedResult;
^
/home/janderson/repos/gatorcat/test.zig:6:5: 0x1238979 in test.bitCast array (test.zig)
try std.testing.expect(n_true == 2);
^
0 passed; 0 skipped; 1 failed.
error: the following test command failed with exit code 1:
.zig-cache/o/609dad7c8dc8cd5756e2687c98f782cb/test --seed=0x98fe02
I am opening this issue because it seems there is no directly contradictory behavior test in test/behavior/bitcast.zig and I figured you may want to add one. There is a nested array of bools but no array of bools.
### Zig Version
0.16.0
### Steps to Reproduce, Observed Behavior, and Expected Behavior
I hit this misscompilation on 0.16.0. It does not occur on master (0.17.0-dev.1257+67b05e521).
```zig
const std = @import("std");
test "bitCast array of bool" {
const arr: [4]bool = .{ true, true, false, false };
const n_true: u3 = @popCount(@as(u4, @bitCast(arr)));
try std.testing.expect(n_true == 2);
}
```
```
/home/janderson/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ/lib/std/testing.zig:615:14: 0x1238909 in expect (std.zig)
if (!ok) return error.TestUnexpectedResult;
^
/home/janderson/repos/gatorcat/test.zig:6:5: 0x1238979 in test.bitCast array (test.zig)
try std.testing.expect(n_true == 2);
^
0 passed; 0 skipped; 1 failed.
error: the following test command failed with exit code 1:
.zig-cache/o/609dad7c8dc8cd5756e2687c98f782cb/test --seed=0x98fe02
```
I am opening this issue because it seems there is no directly contradictory behavior test in `test/behavior/bitcast.zig` and I figured you may want to add one. There is a nested array of bools but no array of bools.