about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/array_index.rs
diff options
context:
space:
mode:
authorsfzhu93 <zhushuofei@gmail.com>2024-01-07 21:16:22 -0800
committersfzhu93 <zhushuofei@gmail.com>2024-01-07 21:16:22 -0800
commit1eaeaaf08b7135fd8d41339b90fdb6d189c89d69 (patch)
treee5c04bac6327fe49888ce4dbc3b16667bf021af2 /tests/mir-opt/dataflow-const-prop/array_index.rs
parentfde0e98247dd4dd13af6cfe21f9eab2e54d50f12 (diff)
downloadrust-1eaeaaf08b7135fd8d41339b90fdb6d189c89d69.tar.gz
rust-1eaeaaf08b7135fd8d41339b90fdb6d189c89d69.zip
Add FileCheck for array_index.rs, boolean_identities.rs and cast.rs
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/array_index.rs')
-rw-r--r--tests/mir-opt/dataflow-const-prop/array_index.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/mir-opt/dataflow-const-prop/array_index.rs b/tests/mir-opt/dataflow-const-prop/array_index.rs
index 3d420f93007..42c99df969e 100644
--- a/tests/mir-opt/dataflow-const-prop/array_index.rs
+++ b/tests/mir-opt/dataflow-const-prop/array_index.rs
@@ -1,9 +1,19 @@
-// skip-filecheck
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 // unit-test: DataflowConstProp
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 
 // EMIT_MIR array_index.main.DataflowConstProp.diff
+
+// CHECK-LABEL: fn main() -> () {
 fn main() {
+    // CHECK: let mut [[array_lit:_.*]]: [u32; 4];
+    // CHECK:     debug x => [[x:_.*]];
+
     let x: u32 = [0, 1, 2, 3][2];
+    // CHECK: bb{{[0-9]+}}: {
+    // CHECK:     [[array_lit]] = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
+    // CHECK:     [[index:_.*]] = const 2_usize;
+    // CHECK: bb{{[0-9]+}}: {
+    // CHECK-NOT: [[x]] = [[array_lit]][[[index]]];
+    // CHECK:     [[x]] = [[array_lit]][2 of 3];
 }