]> git.proxmox.com Git - rustc.git/blame - tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / tests / run-make / c-unwind-abi-catch-lib-panic / panic.rs
CommitLineData
6a06907d
XL
1#![crate_type = "staticlib"]
2#![feature(c_unwind)]
3
4/// This function will panic if `x` is greater than 10.
5///
6/// This function is called by `add_small_numbers`.
7#[no_mangle]
8pub extern "C-unwind" fn panic_if_greater_than_10(x: u32) {
9 if x > 10 {
10 panic!("{}", x); // That is too big!
11 }
12}