2023-04-05 03:44:20 -05:00
|
|
|
// ignore-wasm32 compiled with panic=abort by default
|
2022-12-04 13:20:55 -06:00
|
|
|
// unit-test: SimplifyLocals-before-const-prop
|
2019-10-17 05:46:51 -05:00
|
|
|
// compile-flags: -C overflow-checks=no
|
|
|
|
|
2020-02-05 05:17:41 -06:00
|
|
|
fn use_zst(_: ((), ())) {}
|
2019-10-17 05:46:51 -05:00
|
|
|
|
|
|
|
struct Temp {
|
2020-02-05 05:17:41 -06:00
|
|
|
x: u8,
|
2019-10-17 05:46:51 -05:00
|
|
|
}
|
|
|
|
|
2020-02-05 05:17:41 -06:00
|
|
|
fn use_u8(_: u8) {}
|
2019-10-17 05:46:51 -05:00
|
|
|
|
2022-12-04 13:20:55 -06:00
|
|
|
// EMIT_MIR simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff
|
2019-10-17 05:46:51 -05:00
|
|
|
fn main() {
|
|
|
|
let ((), ()) = ((), ());
|
|
|
|
use_zst(((), ()));
|
|
|
|
|
2020-02-05 05:17:41 -06:00
|
|
|
use_u8((Temp { x: 40 }).x + 2);
|
2019-10-17 05:46:51 -05:00
|
|
|
}
|