Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3ab1d5d

Browse files
committed
Add FileCheck to 3 tests: self_assign_add, self_assign, and sibling_ptr
1 parent e9152e2 commit 3ab1d5d

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
// skip-filecheck
21
// unit-test: DataflowConstProp
32

43
// EMIT_MIR self_assign.main.DataflowConstProp.diff
4+
5+
// CHECK-LABEL: fn main
56
fn main() {
7+
// CHECK: debug a => [[a:_.*]];
8+
// CHECK: debug b => [[b:_.*]];
9+
610
let mut a = 0;
11+
12+
// CHECK: [[a]] = Add(move {{_[0-9]+}}, const 1_i32);
713
a = a + 1;
14+
15+
// CHECK: [[a]] = move {{_[0-9]+}};
816
a = a;
917

18+
// CHECK: [[b]] = &[[a]];
1019
let mut b = &a;
20+
21+
// CHECK: [[b]] = move {{_[0-9]+}};
1122
b = b;
23+
24+
// CHECK: [[a]] = move {{_[0-9]+}};
1225
a = *b;
1326
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
// skip-filecheck
21
// unit-test: DataflowConstProp
32

43
// EMIT_MIR self_assign_add.main.DataflowConstProp.diff
4+
5+
// CHECK-LABEL: fn main
56
fn main() {
7+
// CHECK: debug a => [[a:_.*]];
68
let mut a = 0;
9+
10+
// CHECK: [[a]] = const 1_i32;
711
a += 1;
12+
13+
// CHECK: [[a]] = const 2_i32;
814
a += 1;
915
}

tests/mir-opt/dataflow-const-prop/sibling_ptr.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32
// This attempts to modify `x.1` via a pointer derived from `addr_of_mut!(x.0)`.
43
// According to Miri, that is UB. However, T-opsem has not finalized that
@@ -10,11 +9,17 @@
109
// unit-test: DataflowConstProp
1110

1211
// EMIT_MIR sibling_ptr.main.DataflowConstProp.diff
12+
13+
// CHECK-LABEL: fn main
1314
fn main() {
15+
// CHECK: debug x1 => [[x1:_[0-9]+]];
16+
1417
let mut x: (u8, u8) = (0, 0);
1518
unsafe {
1619
let p = std::ptr::addr_of_mut!(x.0);
1720
*p.add(1) = 1;
1821
}
22+
23+
// CHECK: [[x1]] = ({{_[0-9]+}}.1: u8);
1924
let x1 = x.1; // should not be propagated
2025
}

0 commit comments

Comments
 (0)