summaryrefslogtreecommitdiffstats
path: root/tests/codegen/issues/issue-99960.rs
blob: e9c9367fa64b6f9a1d96d9d3aa91fb4006c87602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// compile-flags: -O
// min-llvm-version: 16

#![crate_type = "lib"]

#[no_mangle]
pub fn test(dividend: i64, divisor: i64) -> Option<i64> {
    // CHECK-LABEL: @test(
    // CHECK-NOT: panic
    if dividend > i64::min_value() && divisor != 0 {
        Some(dividend / divisor)
    } else {
        None
    }
}