2024-06-10 01:47:41 -05:00
|
|
|
//@ test-mir-pass: SingleUseConsts
|
2024-06-14 18:01:26 -05:00
|
|
|
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN -Zdump-mir-exclude-alloc-bytes
|
2020-05-30 14:02:32 -05:00
|
|
|
|
2024-06-10 01:47:41 -05:00
|
|
|
#![allow(unused)]
|
|
|
|
|
2020-05-30 14:02:32 -05:00
|
|
|
struct Point {
|
|
|
|
x: u32,
|
|
|
|
y: u32,
|
|
|
|
}
|
|
|
|
|
2024-06-10 01:47:41 -05:00
|
|
|
// EMIT_MIR const_debuginfo.main.SingleUseConsts.diff
|
2020-05-30 14:02:32 -05:00
|
|
|
fn main() {
|
2023-10-18 12:30:28 -05:00
|
|
|
// CHECK-LABEL: fn main(
|
|
|
|
// CHECK: debug x => const 1_u8;
|
|
|
|
// CHECK: debug y => const 2_u8;
|
|
|
|
// CHECK: debug z => const 3_u8;
|
|
|
|
// CHECK: debug sum => const 6_u8;
|
|
|
|
// CHECK: debug s => const "hello, world!";
|
|
|
|
// CHECK: debug f => {{_.*}};
|
2023-09-20 16:43:33 -05:00
|
|
|
// CHECK: debug o => const Option::<u16>::Some(99_u16);
|
2023-10-18 12:30:28 -05:00
|
|
|
// CHECK: debug p => const Point
|
|
|
|
// CHECK: debug a => const 64_u32;
|
2020-05-30 14:02:32 -05:00
|
|
|
let x = 1u8;
|
|
|
|
let y = 2u8;
|
|
|
|
let z = 3u8;
|
|
|
|
let sum = x + y + z;
|
|
|
|
|
|
|
|
let s = "hello, world!";
|
|
|
|
|
|
|
|
let f = (true, false, 123u32);
|
|
|
|
|
|
|
|
let o = Some(99u16);
|
|
|
|
|
|
|
|
let p = Point { x: 32, y: 32 };
|
|
|
|
let a = p.x + p.y;
|
|
|
|
}
|