about summary refs log tree commit diff
path: root/tests/mir-opt/gvn_copy_constant_projection.rs
blob: a08ae0ac7c9769039f7b415e1ee2a2ef8a45722a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY

use std::cmp::Ordering;
fn compare_constant_index(x: [i32; 1], y: [i32; 1]) -> Ordering {
    // CHECK-LABEL: fn compare_constant_index(
    // CHECK-NOT: (*{{_.*}});
    // CHECK: [[lhs:_.*]] = copy _1[0 of 1];
    // CHECK-NOT: (*{{_.*}});
    // CHECK: [[rhs:_.*]] = copy _2[0 of 1];
    // CHECK: _0 = Cmp(move [[lhs]], move [[rhs]]);
    Ord::cmp(&x[0], &y[0])
}

fn main() {
    compare_constant_index([1], [2]);
}

// EMIT_MIR gvn_copy_constant_projection.compare_constant_index.GVN.diff