diff options
Diffstat (limited to 'tests/rust/function_noreturn.rs')
-rw-r--r-- | tests/rust/function_noreturn.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rust/function_noreturn.rs b/tests/rust/function_noreturn.rs new file mode 100644 index 0000000..d7777ad --- /dev/null +++ b/tests/rust/function_noreturn.rs @@ -0,0 +1,14 @@ +#[no_mangle] +pub extern "C" fn loop_forever() -> ! { + loop {} +} + +#[no_mangle] +pub extern "C" fn normal_return(arg: Example, other: extern "C" fn(u8) -> !) -> u8 { + 0 +} + +#[repr(C)] +pub struct Example { + pub f: extern "C" fn(usize, usize) -> !, +} |