about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/repeat.rs
blob: 2067aa3d709e2391c8fb84a2b48c6cf019ee8957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ test-mir-pass: DataflowConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH

// EMIT_MIR repeat.main.DataflowConstProp.diff
// CHECK-LABEL: fn main(
fn main() {
    // CHECK: debug x => [[x:_.*]];

    // CHECK: [[array_lit:_.*]] = [const 42_u32; 8];
    // CHECK-NOT: {{_.*}} = Len(
    // CHECK-NOT: {{_.*}} = Lt(
    // CHECK: {{_.*}} = const 8_usize;
    // CHECK: {{_.*}} = const true;
    // CHECK: assert(const true

    // CHECK-NOT: [[t:_.*]] = {{copy|move}} [[array_lit]][_
    // CHECK: [[t:_.*]] = copy [[array_lit]][2 of 3];
    // CHECK: [[x]] = Add(move [[t]], const 0_u32);
    let x: u32 = [42; 8][2] + 0;
}