diff options
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/checked.rs')
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/checked.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs new file mode 100644 index 000000000..0738a4ee5 --- /dev/null +++ b/tests/mir-opt/dataflow-const-prop/checked.rs @@ -0,0 +1,13 @@ +// unit-test: DataflowConstProp +// compile-flags: -Coverflow-checks=on + +// EMIT_MIR checked.main.DataflowConstProp.diff +#[allow(arithmetic_overflow)] +fn main() { + let a = 1; + let b = 2; + let c = a + b; + + let d = i32::MAX; + let e = d + 1; +} |