Skip to content

Commit 381466c

Browse files
committed
Add FileCheck to reborrow.rs
Signed-off-by: Shunpoco <[email protected]>
1 parent 4627ea1 commit 381466c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/mir-opt/copy-prop/reborrow.rs

Lines changed: 12 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
// Check that CopyProp considers reborrows as not mutating the pointer.
43
//@ test-mir-pass: CopyProp
@@ -8,6 +7,9 @@ fn opaque(_: impl Sized) {}
87

98
// EMIT_MIR reborrow.remut.CopyProp.diff
109
fn remut(mut x: u8) {
10+
// CHECK-LABEL: fn remut(
11+
// CHECK: debug a => [[a:_.*]];
12+
// CHECK: debug c => [[a]];
1113
let a = &mut x;
1214
let b = &mut *a; //< this cannot mutate a.
1315
let c = a; //< so `c` and `a` can be merged.
@@ -16,6 +18,9 @@ fn remut(mut x: u8) {
1618

1719
// EMIT_MIR reborrow.reraw.CopyProp.diff
1820
fn reraw(mut x: u8) {
21+
// CHECK-LABEL: fn reraw(
22+
// CHECK: debug a => [[a:_.*]];
23+
// CHECK: debug c => [[a]];
1924
let a = &mut x;
2025
let b = &raw mut *a; //< this cannot mutate a.
2126
let c = a; //< so `c` and `a` can be merged.
@@ -24,6 +29,9 @@ fn reraw(mut x: u8) {
2429

2530
// EMIT_MIR reborrow.miraw.CopyProp.diff
2631
fn miraw(mut x: u8) {
32+
// CHECK-LABEL: fn miraw(
33+
// CHECK: debug a => [[a:_.*]];
34+
// CHECK: debug c => [[a]];
2735
let a = &raw mut x;
2836
let b = unsafe { &raw mut *a }; //< this cannot mutate a.
2937
let c = a; //< so `c` and `a` can be merged.
@@ -32,6 +40,9 @@ fn miraw(mut x: u8) {
3240

3341
// EMIT_MIR reborrow.demiraw.CopyProp.diff
3442
fn demiraw(mut x: u8) {
43+
// CHECK-LABEL: fn demiraw(
44+
// CHECK: debug a => [[a:_.*]];
45+
// CHECK: debug c => [[a]];
3546
let a = &raw mut x;
3647
let b = unsafe { &mut *a }; //< this cannot mutate a.
3748
let c = a; //< so `c` and `a` can be merged.

0 commit comments

Comments
 (0)