Skip to content

Commit d3176d5

Browse files
committed
Add FileCheck to mutate_through_pointer.rs
Signed-off-by: Shunpoco <[email protected]>
1 parent 334d501 commit d3176d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
//@ test-mir-pass: CopyProp
32
//
43
// This attempts to mutate `a` via a pointer derived from `addr_of!(a)`. That is UB
@@ -18,6 +17,10 @@ use core::intrinsics::mir::*;
1817

1918
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
2019
fn f(c: bool) -> bool {
20+
// CHECK-LABEL: fn f(
21+
// CHECK: _2 = copy _1;
22+
// CHECK-NOT: _3 = &raw const _1;
23+
// CHECK: _3 = &raw const _2;
2124
mir! {
2225
{
2326
let a = c;

0 commit comments

Comments
 (0)