Skip to content

Commit

Permalink
Merge pull request #21339 from alexrp/reenable-tests
Browse files Browse the repository at this point in the history
`test`: Re-enable a bunch of behavior tests with LLVM.
  • Loading branch information
andrewrk authored Sep 12, 2024
2 parents eccd06f + 5cb9668 commit b95e0e0
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 78 deletions.
4 changes: 0 additions & 4 deletions test/behavior/align.zig
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,6 @@ test "comptime alloc alignment" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // flaky
if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch == .x86) {
// https://github.com/ziglang/zig/issues/18034
return error.SkipZigTest;
}

comptime var bytes1 = [_]u8{0};
_ = &bytes1;
Expand Down
12 changes: 0 additions & 12 deletions test/behavior/atomics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ test "cmpxchg on a global variable" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
// https://github.com/ziglang/zig/issues/10627
return error.SkipZigTest;
}

_ = @cmpxchgWeak(u32, &a_global_variable, 1234, 42, .acquire, .monotonic);
try expect(a_global_variable == 42);
}
Expand Down Expand Up @@ -202,10 +197,6 @@ test "atomicrmw with floats" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
// https://github.com/ziglang/zig/issues/10627
return error.SkipZigTest;
}
try testAtomicRmwFloat();
try comptime testAtomicRmwFloat();
}
Expand Down Expand Up @@ -306,9 +297,6 @@ test "atomicrmw with 128-bit ints" {

if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO

// TODO "ld.lld: undefined symbol: __sync_lock_test_and_set_16" on -mcpu x86_64
if (builtin.cpu.arch == .x86_64 and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;

try testAtomicRmwInt128(.signed);
try testAtomicRmwInt128(.unsigned);
try comptime testAtomicRmwInt128(.signed);
Expand Down
4 changes: 0 additions & 4 deletions test/behavior/basic.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1426,10 +1426,6 @@ test "allocation and looping over 3-byte integer" {
return error.SkipZigTest; // TODO
}

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {
return error.SkipZigTest; // TODO
}

try expect(@sizeOf(u24) == 4);
try expect(@sizeOf([1]u24) == 4);
try expect(@alignOf(u24) == 4);
Expand Down
5 changes: 0 additions & 5 deletions test/behavior/bitcast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,6 @@ test "comptime @bitCast packed struct to int and back" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and native_endian == .big) {
// https://github.com/ziglang/zig/issues/13782
return error.SkipZigTest;
}

const S = packed struct {
void: void = {},
uint: u8 = 13,
Expand Down
6 changes: 2 additions & 4 deletions test/behavior/call.zig
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ test "forced tail call" {
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm) {
// Only attempt this test on targets we know have tail call support in LLVM.
if (builtin.cpu.arch != .x86_64 and builtin.cpu.arch != .aarch64) {
if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) {
return error.SkipZigTest;
}
}
Expand Down Expand Up @@ -311,8 +310,7 @@ test "inline call preserves tail call" {
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm) {
// Only attempt this test on targets we know have tail call support in LLVM.
if (builtin.cpu.arch != .x86_64 and builtin.cpu.arch != .aarch64) {
if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) {
return error.SkipZigTest;
}
}
Expand Down
10 changes: 0 additions & 10 deletions test/behavior/floatop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1310,11 +1310,6 @@ test "@trunc f16" {
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS()) {
// https://github.com/ziglang/zig/issues/16846
return error.SkipZigTest;
}

try testTrunc(f16);
try comptime testTrunc(f16);
}
Expand All @@ -1326,11 +1321,6 @@ test "@trunc f32/f64" {
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS()) {
// https://github.com/ziglang/zig/issues/16846
return error.SkipZigTest;
}

try testTrunc(f32);
try comptime testTrunc(f32);
try testTrunc(f64);
Expand Down
16 changes: 0 additions & 16 deletions test/behavior/math.zig
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ test "@ctz vectors" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
// This regressed with LLVM 14:
// https://github.com/ziglang/zig/issues/12013
return error.SkipZigTest;
}

try testCtzVectors();
try comptime testCtzVectors();
}
Expand Down Expand Up @@ -478,11 +472,6 @@ test "division" {
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS()) {
// https://github.com/ziglang/zig/issues/16846
return error.SkipZigTest;
}

try testIntDivision();
try comptime testIntDivision();

Expand Down Expand Up @@ -721,11 +710,6 @@ test "unsigned 64-bit division" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO

if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS()) {
// https://github.com/ziglang/zig/issues/16846
return error.SkipZigTest;
}

try test_u64_div();
try comptime test_u64_div();
}
Expand Down
5 changes: 0 additions & 5 deletions test/behavior/shuffle.zig
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ test "@shuffle bool 2" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

if (builtin.zig_backend == .stage2_llvm) {
// https://github.com/ziglang/zig/issues/3246
return error.SkipZigTest;
}

const S = struct {
fn doTheTest() !void {
var x: @Vector(3, bool) = [3]bool{ false, true, false };
Expand Down
12 changes: 0 additions & 12 deletions test/behavior/threadlocal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ test "thread local variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm) switch (builtin.cpu.arch) {
.x86_64, .x86 => {},
else => return error.SkipZigTest,
}; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO

if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .macos) {
Expand All @@ -28,10 +24,6 @@ test "pointer to thread local array" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm) switch (builtin.cpu.arch) {
.x86_64, .x86 => {},
else => return error.SkipZigTest,
}; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO

const s = "Hello world";
Expand All @@ -45,10 +37,6 @@ test "reference a global threadlocal variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm) switch (builtin.cpu.arch) {
.x86_64, .x86 => {},
else => return error.SkipZigTest,
}; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO

_ = nrfx_uart_rx(&g_uart0);
Expand Down
6 changes: 0 additions & 6 deletions test/behavior/vector.zig
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ test "vector division operators" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;

Expand Down Expand Up @@ -1571,11 +1570,6 @@ test "@reduce on bool vector" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO

if (comptime builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.endian() == .big) {
// https://github.com/ziglang/zig/issues/13782
return error.SkipZigTest;
}

const a = @Vector(2, bool){ true, true };
const b = @Vector(1, bool){true};
try std.testing.expect(@reduce(.And, a));
Expand Down

0 comments on commit b95e0e0

Please sign in to comment.