2023-06-08 09:18:34 +02:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2022-07-26 19:04:27 +02:00
|
|
|
// unit-test: ConstProp
|
2019-09-14 14:11:31 -04:00
|
|
|
// compile-flags: -O
|
|
|
|
|
2020-07-27 21:22:43 +02:00
|
|
|
// EMIT_MIR aggregate.main.ConstProp.diff
|
2022-05-23 09:27:44 +02:00
|
|
|
// EMIT_MIR aggregate.main.PreCodegen.after.mir
|
2019-09-14 14:11:31 -04:00
|
|
|
fn main() {
|
|
|
|
let x = (0, 1, 2).1 + 0;
|
2023-01-29 12:50:27 +00: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;
|
2019-09-14 14:11:31 -04:00
|
|
|
}
|