FileCheck bad_op_div_by_zero. · rust-lang/rust@0d5bc87 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
1 -// skip-filecheck
2 -// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3 1 // unit-test: ConstProp
2 +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3 +
4 4 // EMIT_MIR bad_op_div_by_zero.main.ConstProp.diff
5 5 #[allow(unconditional_panic)]
6 6 fn main() {
7 +// CHECK-LABEL: fn main(
8 +// CHECK: debug y => [[y:_.*]];
9 +// CHECK: debug _z => [[z:_.*]];
10 +// CHECK: assert(!const true, "attempt to divide `{}` by zero", const 1_i32)
11 +// CHECK: assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, const 0_i32)
12 +// CHECK: [[z]] = Div(const 1_i32, const 0_i32);
7 13 let y = 0;
8 14 let _z = 1 / y;
9 15 }