Skip to content

Commit

Permalink
comment out the old tests instead of adjusting them
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 25, 2024
1 parent 917dd82 commit 906f66f
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 143 deletions.
18 changes: 10 additions & 8 deletions tests/coverage/closure.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,19 @@ Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
Highest counter ID seen: c1

Function name: closure::main::{closure#18} (unused)
Raw bytes (24): 0x[01, 01, 00, 04, 00, 19, 0d, 02, 1c, 00, 02, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 01, 0e]
Function name: closure::main::{closure#18}
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 19, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of expressions: 1
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 4
- Code(Zero) at (prev + 25, 13) to (start + 2, 28)
- Code(Zero) at (prev + 2, 29) to (start + 2, 18)
- Code(Zero) at (prev + 2, 17) to (start + 0, 18)
- Code(Zero) at (prev + 1, 17) to (start + 1, 14)
Highest counter ID seen: (none)
- Code(Counter(0)) at (prev + 25, 13) to (start + 2, 28)
- Code(Counter(1)) at (prev + 2, 29) to (start + 2, 18)
- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18)
= (c0 - c1)
- Code(Counter(0)) at (prev + 1, 17) to (start + 1, 14)
Highest counter ID seen: c1

Function name: closure::main::{closure#19}
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 43, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]
Expand Down
205 changes: 110 additions & 95 deletions tests/coverage/issue-84561.cov-map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/mir-opt/const_prop/read_immutable_static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ static FOO: u8 = 2;
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug x => [[x:_.*]];
// CHECK-NOT: [[x]] = const 4_u8;
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
// COM: CHECK: [[x]] = const 4_u8;
let x = FOO + FOO;
}
3 changes: 2 additions & 1 deletion tests/mir-opt/const_prop/ref_deref_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK-NOT: [[a]] = const 5_i32;
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
// COM: CHECK: [[a]] = const 5_i32;
let a = *(&(4, 5).1);
}
5 changes: 3 additions & 2 deletions tests/mir-opt/const_prop/slice_len.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize, AsCast));
// CHECK-NOT: assert(const true,
// CHECK-NOT: [[a]] = const 2_u32;
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
// COM: CHECK: assert(const true,
// COM: CHECK: [[a]] = const 2_u32;
let a = (&[1u32, 2, 3] as &[u32])[1];
}
18 changes: 9 additions & 9 deletions tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
let mut _3: fn(u8) -> u8;
let _5: ();
let mut _6: fn(u8) -> u8;
let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21};
let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
let _10: ();
let mut _11: fn();
let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21};
let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
let _14: ();
let mut _15: fn();
scope 1 {
debug f => _1;
let _4: fn(u8) -> u8;
scope 2 {
debug g => _4;
let _7: {closure@$DIR/gvn.rs:620:19: 620:21};
let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
scope 3 {
debug closure => _7;
let _8: fn();
Expand Down Expand Up @@ -62,16 +62,16 @@
StorageDead(_6);
StorageDead(_5);
- StorageLive(_7);
- _7 = {closure@$DIR/gvn.rs:620:19: 620:21};
- _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
- StorageLive(_8);
+ nop;
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ nop;
StorageLive(_9);
- _9 = copy _7;
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
StorageDead(_9);
StorageLive(_10);
StorageLive(_11);
Expand All @@ -88,8 +88,8 @@
StorageLive(_13);
- _13 = copy _7;
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
StorageDead(_13);
StorageLive(_14);
StorageLive(_15);
Expand Down
18 changes: 9 additions & 9 deletions tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
let mut _3: fn(u8) -> u8;
let _5: ();
let mut _6: fn(u8) -> u8;
let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21};
let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
let _10: ();
let mut _11: fn();
let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21};
let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
let _14: ();
let mut _15: fn();
scope 1 {
debug f => _1;
let _4: fn(u8) -> u8;
scope 2 {
debug g => _4;
let _7: {closure@$DIR/gvn.rs:620:19: 620:21};
let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
scope 3 {
debug closure => _7;
let _8: fn();
Expand Down Expand Up @@ -62,16 +62,16 @@
StorageDead(_6);
StorageDead(_5);
- StorageLive(_7);
- _7 = {closure@$DIR/gvn.rs:620:19: 620:21};
- _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
- StorageLive(_8);
+ nop;
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ nop;
StorageLive(_9);
- _9 = copy _7;
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
StorageDead(_9);
StorageLive(_10);
StorageLive(_11);
Expand All @@ -88,8 +88,8 @@
StorageLive(_13);
- _13 = copy _7;
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
StorageDead(_13);
StorageLive(_14);
StorageLive(_15);
Expand Down
31 changes: 13 additions & 18 deletions tests/mir-opt/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,17 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) {
opaque((x * y) - y);

// We cannot substitute through an immutable reference.
// (Disabled due to <https://github.com/rust-lang/rust/issues/130853>)
// CHECK: [[ref:_.*]] = &_3;
// CHECK: [[deref:_.*]] = copy (*[[ref]]);
// CHECK: [[addref:_.*]] = Add(move [[deref]], copy _1);
// CHECK: opaque::<u64>(move [[addref]])
// CHECK: [[deref2:_.*]] = copy (*[[ref]]);
// CHECK: [[addref2:_.*]] = Add(move [[deref2]], copy _1);
// CHECK: opaque::<u64>(move [[addref2]])
// COM: CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1);
// COM: CHECK: opaque::<u64>(copy [[addref]])
// COM: CHECK: opaque::<u64>(copy [[addref]])
let a = &z;
opaque(*a + x);
opaque(*a + x);

// But not through a mutable reference or a pointer.
// And certainly not through a mutable reference or a pointer.
// CHECK: [[mut:_.*]] = &mut _3;
// CHECK: [[addmut:_.*]] = Add(
// CHECK: opaque::<u64>(move [[addmut]])
Expand Down Expand Up @@ -143,11 +142,9 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) {
// Important: `e` is not `a`!
// CHECK: [[ref2:_.*]] = &_3;
// CHECK: [[deref2:_.*]] = copy (*[[ref2]]);
// CHECK: [[addref2:_.*]] = Add(move [[deref2]], copy _1);
// CHECK: opaque::<u64>(move [[addref2]])
// CHECK: [[deref3:_.*]] = copy (*[[ref2]]);
// CHECK: [[addref3:_.*]] = Add(move [[deref3]], copy _1);
// CHECK: opaque::<u64>(move [[addref3]])
// COM: CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1);
// COM: CHECK: opaque::<u64>(copy [[addref2]])
// COM: CHECK: opaque::<u64>(copy [[addref2]])
let e = &z;
opaque(*e + x);
opaque(*e + x);
Expand Down Expand Up @@ -502,9 +499,8 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) {
// Do not reuse dereferences of `&Freeze`.
// CHECK: [[ref:_.*]] = &(*_1);
// CHECK: [[st7:_.*]] = copy (*[[ref]]);
// CHECK: opaque::<u32>(move [[st7]])
// CHECK: [[st8:_.*]] = copy (*[[ref]]);
// CHECK: opaque::<u32>(move [[st8]])
// COM: CHECK: opaque::<u32>(copy [[st7]])
// COM: CHECK: opaque::<u32>(copy [[st7]])
let z = &*t;
opaque(*z);
opaque(*z);
Expand All @@ -523,9 +519,8 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) {

// `*s` is not Copy, but `(*s).0` is, but we still cannot reuse.
// CHECK: [[st10:_.*]] = copy ((*_3).0: u32);
// CHECK: opaque::<u32>(move [[st10]])
// CHECK: [[st11:_.*]] = copy ((*_3).0: u32);
// CHECK: opaque::<u32>(move [[st11]])
// COM: CHECK: opaque::<u32>(copy [[st10]])
// COM: CHECK: opaque::<u32>(copy [[st10]])
opaque(s.0);
opaque(s.0);
}
Expand Down Expand Up @@ -742,7 +737,7 @@ fn borrowed<T: Copy + Freeze>(x: T) {
// CHECK: bb1: {
// CHECK-NEXT: _0 = opaque::<T>(copy _1)
// CHECK: bb2: {
// CHECK-NEXT: _0 = opaque::<T>(copy (*_3))
// COM: CHECK-NEXT: _0 = opaque::<T>(copy _1)
mir! {
{
let a = x;
Expand Down
1 change: 1 addition & 0 deletions tests/mir-opt/pre-codegen/deref_nested_borrows.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/130853>
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY

fn src(x: &&u8) -> bool {
Expand Down

0 comments on commit 906f66f

Please sign in to comment.