2022-07-26 19:04:27 +02:00
|
|
|
// unit-test: ConstProp
|
2019-09-15 00:05:19 -04:00
|
|
|
// compile-flags: -O
|
|
|
|
|
2020-06-08 08:14:45 -04:00
|
|
|
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
|
|
|
|
// `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
|
|
|
|
// and `InterpCx::eval_place()` always forces an allocation which creates the `Indirect`.
|
|
|
|
// Fixing either of those will allow us to const-prop this away.
|
|
|
|
|
2020-04-04 20:25:54 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
2020-07-27 21:22:43 +02:00
|
|
|
// EMIT_MIR discriminant.main.ConstProp.diff
|
2019-09-15 00:05:19 -04:00
|
|
|
fn main() {
|
|
|
|
let x = (if let Some(true) = Some(true) { 42 } else { 10 }) + 0;
|
|
|
|
}
|