summaryrefslogtreecommitdiff
path: root/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
blob: 9e7bc3e53a1accfe3eeb00388d692e0837f3e2c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![crate_type = "staticlib"]

/// This function will panic if `x` is greater than 10.
///
/// This function is called by `add_small_numbers`.
#[no_mangle]
pub extern "C-unwind" fn panic_if_greater_than_10(x: u32) {
    if x > 10 {
        panic!("{}", x); // That is too big!
    }
}