From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/mir-opt/const_prop/optimizes_into_variable.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/mir-opt/const_prop/optimizes_into_variable.rs (limited to 'tests/mir-opt/const_prop/optimizes_into_variable.rs') diff --git a/tests/mir-opt/const_prop/optimizes_into_variable.rs b/tests/mir-opt/const_prop/optimizes_into_variable.rs new file mode 100644 index 000000000..abea07e20 --- /dev/null +++ b/tests/mir-opt/const_prop/optimizes_into_variable.rs @@ -0,0 +1,18 @@ +// unit-test +// compile-flags: -C overflow-checks=on + +struct Point { + x: u32, + y: u32, +} + +// EMIT_MIR_FOR_EACH_BIT_WIDTH +// EMIT_MIR optimizes_into_variable.main.ScalarReplacementOfAggregates.diff +// EMIT_MIR optimizes_into_variable.main.ConstProp.diff +// EMIT_MIR optimizes_into_variable.main.SimplifyLocals-final.after.mir +// EMIT_MIR optimizes_into_variable.main.PreCodegen.after.mir +fn main() { + let x = 2 + 2; + let y = [0, 1, 2, 3, 4, 5][3]; + let z = (Point { x: 12, y: 42}).y; +} -- cgit v1.2.3