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

/// 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!
    }
}