diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-16 18:01:42 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-19 15:51:53 +0000 |
| commit | 47fa01d2b86ab4a60d944a5d9501cfbed9cd5e80 (patch) | |
| tree | 9e81625295118f5004937170d76c96b3cf9a7ee5 | |
| parent | 8daf14f0461bd3116c43a550eb19f009640d3dc2 (diff) | |
| download | rust-47fa01d2b86ab4a60d944a5d9501cfbed9cd5e80.tar.gz rust-47fa01d2b86ab4a60d944a5d9501cfbed9cd5e80.zip | |
FileCheck array_index_is_temporary.rs
| -rw-r--r-- | tests/mir-opt/array_index_is_temporary.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs index 08db63a82bb..f5edc68905b 100644 --- a/tests/mir-opt/array_index_is_temporary.rs +++ b/tests/mir-opt/array_index_is_temporary.rs @@ -1,4 +1,4 @@ -// skip-filecheck +// unit-test: SimplifyCfg-elaborate-drops // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Retagging (from Stacked Borrows) relies on the array index being a fresh // temporary, so that side-effects cannot change it. @@ -12,6 +12,12 @@ unsafe fn foo(z: *mut usize) -> u32 { // EMIT_MIR array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir fn main() { + // CHECK-LABEL: fn main( + // CHECK: debug x => [[x:_.*]]; + // CHECK: debug y => [[y:_.*]]; + // CHECK: [[y]] = const 1_usize; + // CHECK: [[tmp:_.*]] = [[y]]; + // CHECK: [[x]][[[tmp]]] = let mut x = [42, 43, 44]; let mut y = 1; let z: *mut usize = &mut y; |
