2023-04-23 11:15:22 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: DataflowConstProp
|
2023-04-23 11:15:22 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
|
|
|
|
|
|
|
// EMIT_MIR array_index.main.DataflowConstProp.diff
|
2024-01-07 23:16:22 -06:00
|
|
|
|
|
|
|
// CHECK-LABEL: fn main() -> () {
|
2023-04-23 11:15:22 -05:00
|
|
|
fn main() {
|
2024-01-07 23:16:22 -06:00
|
|
|
// CHECK: let mut [[array_lit:_.*]]: [u32; 4];
|
|
|
|
// CHECK: debug x => [[x:_.*]];
|
|
|
|
|
2024-01-12 01:22:33 -06:00
|
|
|
// CHECK: [[array_lit]] = [const 0_u32, const 1_u32, const 2_u32, const 3_u32];
|
2024-01-12 01:22:33 -06:00
|
|
|
// CHECK-NOT: {{_.*}} = Len(
|
|
|
|
// CHECK-NOT: {{_.*}} = Lt(
|
|
|
|
// CHECK-NOT: assert(move _
|
|
|
|
// CHECK: {{_.*}} = const 4_usize;
|
|
|
|
// CHECK: {{_.*}} = const true;
|
2024-01-20 10:09:14 -06:00
|
|
|
// CHECK: assert(const true
|
2024-08-18 17:51:53 -05:00
|
|
|
// CHECK: [[x]] = copy [[array_lit]][2 of 3];
|
2024-01-12 01:22:33 -06:00
|
|
|
let x: u32 = [0, 1, 2, 3][2];
|
2023-04-23 11:15:22 -05:00
|
|
|
}
|