rust/tests/mir-opt/const_prop/aggregate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
490 B
Rust
Raw Normal View History

2023-04-05 03:44:20 -05:00
// ignore-wasm32 compiled with panic=abort by default
2022-07-26 12:04:27 -05:00
// unit-test: ConstProp
// compile-flags: -O
2020-07-27 14:22:43 -05:00
// EMIT_MIR aggregate.main.ConstProp.diff
2022-05-23 02:27:44 -05:00
// EMIT_MIR aggregate.main.PreCodegen.after.mir
fn main() {
let x = (0, 1, 2).1 + 0;
2023-01-29 06:50:27 -06:00
foo(x);
}
// EMIT_MIR aggregate.foo.ConstProp.diff
// EMIT_MIR aggregate.foo.PreCodegen.after.mir
fn foo(x: u8) {
// Verify that we still propagate if part of the aggregate is not known.
let first = (0, x).0 + 1;
let second = (x, 1).1 + 2;
}