2024-04-20 13:19:34 +02:00
|
|
|
//@ test-mir-pass: GVN
|
2024-07-27 14:36:17 +08:00
|
|
|
//@ compile-flags: -Zmir-enable-passes=+InstSimplify-after-simplifycfg -Zdump-mir-exclude-alloc-bytes
|
2023-12-02 21:04:15 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2020-04-04 20:25:54 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
2020-04-04 17:15:01 +00:00
|
|
|
|
2023-09-20 21:43:33 +00:00
|
|
|
// EMIT_MIR slice_len.main.GVN.diff
|
2019-05-03 21:58:16 -04:00
|
|
|
fn main() {
|
2023-12-02 21:04:15 +00:00
|
|
|
// CHECK-LABEL: fn main(
|
|
|
|
// CHECK: debug a => [[a:_.*]];
|
2024-09-15 19:35:06 +02:00
|
|
|
// CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize, AsCast));
|
2023-12-17 22:30:20 +00:00
|
|
|
// CHECK: assert(const true,
|
|
|
|
// CHECK: [[a]] = const 2_u32;
|
2023-12-02 21:04:15 +00:00
|
|
|
let a = (&[1u32, 2, 3] as &[u32])[1];
|
2019-05-03 21:58:16 -04:00
|
|
|
}
|