diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-02 20:21:53 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-02 20:23:16 +0000 |
| commit | 043d29b58ae4eee0681b1724ed0c20d9ee3ed9e7 (patch) | |
| tree | d485c43b35b25cd53509556328d370e42a5dfede | |
| parent | 7f328d2a4462c3a8afcaf773a22c2b9c300fef12 (diff) | |
| download | rust-043d29b58ae4eee0681b1724ed0c20d9ee3ed9e7.tar.gz rust-043d29b58ae4eee0681b1724ed0c20d9ee3ed9e7.zip | |
FileCheck and rename const_prop_fails_gracefully.
| -rw-r--r-- | tests/mir-opt/const_prop/const_prop_fails_gracefully.rs | 12 | ||||
| -rw-r--r-- | tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-abort.diff (renamed from tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff) | 0 | ||||
| -rw-r--r-- | tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-unwind.diff (renamed from tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff) | 0 | ||||
| -rw-r--r-- | tests/mir-opt/const_prop/pointer_expose_address.rs | 18 |
4 files changed, 18 insertions, 12 deletions
diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs deleted file mode 100644 index 5bd4731bf08..00000000000 --- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs +++ /dev/null @@ -1,12 +0,0 @@ -// skip-filecheck -// EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// unit-test: ConstProp -#[inline(never)] -fn read(_: usize) { } - -// EMIT_MIR const_prop_fails_gracefully.main.ConstProp.diff -fn main() { - const FOO: &i32 = &1; - let x = FOO as *const i32 as usize; - read(x); -} diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff b/tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-abort.diff index bd1de7476a2..bd1de7476a2 100644 --- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-abort.diff +++ b/tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-abort.diff diff --git a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff b/tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-unwind.diff index 850b743feb1..850b743feb1 100644 --- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.panic-unwind.diff +++ b/tests/mir-opt/const_prop/pointer_expose_address.main.ConstProp.panic-unwind.diff diff --git a/tests/mir-opt/const_prop/pointer_expose_address.rs b/tests/mir-opt/const_prop/pointer_expose_address.rs new file mode 100644 index 00000000000..631aac901b9 --- /dev/null +++ b/tests/mir-opt/const_prop/pointer_expose_address.rs @@ -0,0 +1,18 @@ +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY +// unit-test: ConstProp + +#[inline(never)] +fn read(_: usize) { } + +// EMIT_MIR pointer_expose_address.main.ConstProp.diff +fn main() { + // CHECK-LABEL: fn main( + // CHECK: [[ptr:_.*]] = const _; + // CHECK: [[ref:_.*]] = &raw const (*[[ptr]]); + // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeAddress); + // CHECK: [[arg:_.*]] = [[x]]; + // CHECK: = read(move [[arg]]) + const FOO: &i32 = &1; + let x = FOO as *const i32 as usize; + read(x); +} |
