| ... | ... | @@ -374,10 +374,6 @@ const atomic_rmw_orderings = [_]Ordering{ |
| 374 | 374 | }; |
| 375 | 375 | |
| 376 | 376 | test "Atomic.swap" { |
| 377 | | // TODO: Re-enable when LLVM is released with a bugfix for isel of |
| 378 | | // atomic load (currently fixed on trunk, broken on 15.0.2) |
| 379 | | if (builtin.cpu.arch == .powerpc64le) return error.SkipZigTest; |
| 380 | | |
| 381 | 377 | inline for (atomic_rmw_orderings) |ordering| { |
| 382 | 378 | var x = Atomic(usize).init(5); |
| 383 | 379 | try testing.expectEqual(x.swap(10, ordering), 5); |
| ... | ... | @@ -546,9 +542,8 @@ test "Atomic.bitSet" { |
| 546 | 542 | inline for (atomicIntTypes()) |Int| { |
| 547 | 543 | inline for (atomic_rmw_orderings) |ordering| { |
| 548 | 544 | var x = Atomic(Int).init(0); |
| 549 | | const bit_array = @as([@bitSizeOf(Int)]void, undefined); |
| 550 | 545 | |
| 551 | | for (bit_array, 0..) |_, bit_index| { |
| 546 | for (0..@bitSizeOf(Int)) |bit_index| { |
| 552 | 547 | const bit = @intCast(std.math.Log2Int(Int), bit_index); |
| 553 | 548 | const mask = @as(Int, 1) << bit; |
| 554 | 549 | |
| ... | ... | @@ -562,7 +557,7 @@ test "Atomic.bitSet" { |
| 562 | 557 | try testing.expect(x.load(.SeqCst) & mask != 0); |
| 563 | 558 | |
| 564 | 559 | // all the previous bits should have not changed (still be set) |
| 565 | | for (bit_array[0..bit_index], 0..) |_, prev_bit_index| { |
| 560 | for (0..bit_index) |prev_bit_index| { |
| 566 | 561 | const prev_bit = @intCast(std.math.Log2Int(Int), prev_bit_index); |
| 567 | 562 | const prev_mask = @as(Int, 1) << prev_bit; |
| 568 | 563 | try testing.expect(x.load(.SeqCst) & prev_mask != 0); |
| ... | ... | @@ -576,9 +571,8 @@ test "Atomic.bitReset" { |
| 576 | 571 | inline for (atomicIntTypes()) |Int| { |
| 577 | 572 | inline for (atomic_rmw_orderings) |ordering| { |
| 578 | 573 | var x = Atomic(Int).init(0); |
| 579 | | const bit_array = @as([@bitSizeOf(Int)]void, undefined); |
| 580 | 574 | |
| 581 | | for (bit_array, 0..) |_, bit_index| { |
| 575 | for (0..@bitSizeOf(Int)) |bit_index| { |
| 582 | 576 | const bit = @intCast(std.math.Log2Int(Int), bit_index); |
| 583 | 577 | const mask = @as(Int, 1) << bit; |
| 584 | 578 | x.storeUnchecked(x.loadUnchecked() | mask); |
| ... | ... | @@ -593,7 +587,7 @@ test "Atomic.bitReset" { |
| 593 | 587 | try testing.expect(x.load(.SeqCst) & mask == 0); |
| 594 | 588 | |
| 595 | 589 | // all the previous bits should have not changed (still be reset) |
| 596 | | for (bit_array[0..bit_index], 0..) |_, prev_bit_index| { |
| 590 | for (0..bit_index) |prev_bit_index| { |
| 597 | 591 | const prev_bit = @intCast(std.math.Log2Int(Int), prev_bit_index); |
| 598 | 592 | const prev_mask = @as(Int, 1) << prev_bit; |
| 599 | 593 | try testing.expect(x.load(.SeqCst) & prev_mask == 0); |
| ... | ... | @@ -607,9 +601,8 @@ test "Atomic.bitToggle" { |
| 607 | 601 | inline for (atomicIntTypes()) |Int| { |
| 608 | 602 | inline for (atomic_rmw_orderings) |ordering| { |
| 609 | 603 | var x = Atomic(Int).init(0); |
| 610 | | const bit_array = @as([@bitSizeOf(Int)]void, undefined); |
| 611 | 604 | |
| 612 | | for (bit_array, 0..) |_, bit_index| { |
| 605 | for (0..@bitSizeOf(Int)) |bit_index| { |
| 613 | 606 | const bit = @intCast(std.math.Log2Int(Int), bit_index); |
| 614 | 607 | const mask = @as(Int, 1) << bit; |
| 615 | 608 | |
| ... | ... | @@ -623,7 +616,7 @@ test "Atomic.bitToggle" { |
| 623 | 616 | try testing.expect(x.load(.SeqCst) & mask == 0); |
| 624 | 617 | |
| 625 | 618 | // all the previous bits should have not changed (still be toggled back) |
| 626 | | for (bit_array[0..bit_index], 0..) |_, prev_bit_index| { |
| 619 | for (0..bit_index) |prev_bit_index| { |
| 627 | 620 | const prev_bit = @intCast(std.math.Log2Int(Int), prev_bit_index); |
| 628 | 621 | const prev_mask = @as(Int, 1) << prev_bit; |
| 629 | 622 | try testing.expect(x.load(.SeqCst) & prev_mask == 0); |