FileCheck bad_op_mod_by_zero.

This commit is contained in:
Camille GILLOT 2023-12-02 20:17:49 +00:00
parent 0d5bc872a9
commit 97f03cb898

View file

@ -1,9 +1,16 @@
// skip-filecheck
// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR bad_op_mod_by_zero.main.ConstProp.diff
#[allow(unconditional_panic)]
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug y => [[y:_.*]];
// CHECK: debug _z => [[z:_.*]];
// CHECK: assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of
// zero", const 1_i32)
// CHECK: assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, const 0_i32)
// CHECK: [[z]] = Rem(const 1_i32, const 0_i32);
let y = 0;
let _z = 1 % y;
}