X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fmir-opt%2Fconst_prop%2Faggregate.rs;h=aa123b7a8664dfb839013275b03e6b92f55d22f7;hb=a00e24d76a9ac03b146d3bf89e2161b2466c6551;hp=6a3080384daf4fb0e285d412d331ef59ac258e40;hpb=085d2f1f0913890b531fde75d9300bd995dfb568;p=rust.git diff --git a/tests/mir-opt/const_prop/aggregate.rs b/tests/mir-opt/const_prop/aggregate.rs index 6a3080384da..aa123b7a866 100644 --- a/tests/mir-opt/const_prop/aggregate.rs +++ b/tests/mir-opt/const_prop/aggregate.rs @@ -5,4 +5,13 @@ // EMIT_MIR aggregate.main.PreCodegen.after.mir fn main() { let x = (0, 1, 2).1 + 0; + 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; }