Skip to content

Commit 043d29b

Browse files
committed
FileCheck and rename const_prop_fails_gracefully.
1 parent 7f328d2 commit 043d29b

4 files changed

+18
-12
lines changed

tests/mir-opt/const_prop/const_prop_fails_gracefully.rs

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
2+
// unit-test: ConstProp
3+
4+
#[inline(never)]
5+
fn read(_: usize) { }
6+
7+
// EMIT_MIR pointer_expose_address.main.ConstProp.diff
8+
fn main() {
9+
// CHECK-LABEL: fn main(
10+
// CHECK: [[ptr:_.*]] = const _;
11+
// CHECK: [[ref:_.*]] = &raw const (*[[ptr]]);
12+
// CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeAddress);
13+
// CHECK: [[arg:_.*]] = [[x]];
14+
// CHECK: = read(move [[arg]])
15+
const FOO: &i32 = &1;
16+
let x = FOO as *const i32 as usize;
17+
read(x);
18+
}

0 commit comments

Comments
 (0)