mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Force #[unwind(aborts)] in test/codegen/c-variadic.rs
This commit is contained in:
parent
d810e77f4e
commit
367b793790
@ -2,6 +2,7 @@
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(c_variadic)]
|
||||
#![feature(unwind_attributes)]
|
||||
#![no_std]
|
||||
use core::ffi::VaList;
|
||||
|
||||
@ -10,6 +11,7 @@ extern "C" {
|
||||
fn foreign_c_variadic_1(_: VaList, ...);
|
||||
}
|
||||
|
||||
#[unwind(aborts)] // FIXME(#58794)
|
||||
pub unsafe extern "C" fn use_foreign_c_variadic_0() {
|
||||
// Ensure that we correctly call foreign C-variadic functions.
|
||||
// CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0)
|
||||
@ -24,20 +26,24 @@ pub unsafe extern "C" fn use_foreign_c_variadic_0() {
|
||||
|
||||
// Ensure that we do not remove the `va_list` passed to the foreign function when
|
||||
// removing the "spoofed" `VaListImpl` that is used by Rust defined C-variadics.
|
||||
#[unwind(aborts)] // FIXME(#58794)
|
||||
pub unsafe extern "C" fn use_foreign_c_variadic_1_0(ap: VaList) {
|
||||
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap)
|
||||
foreign_c_variadic_1(ap);
|
||||
}
|
||||
|
||||
#[unwind(aborts)] // FIXME(#58794)
|
||||
pub unsafe extern "C" fn use_foreign_c_variadic_1_1(ap: VaList) {
|
||||
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 42)
|
||||
foreign_c_variadic_1(ap, 42i32);
|
||||
}
|
||||
#[unwind(aborts)] // FIXME(#58794)
|
||||
pub unsafe extern "C" fn use_foreign_c_variadic_1_2(ap: VaList) {
|
||||
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42)
|
||||
foreign_c_variadic_1(ap, 2i32, 42i32);
|
||||
}
|
||||
|
||||
#[unwind(aborts)] // FIXME(#58794)
|
||||
pub unsafe extern "C" fn use_foreign_c_variadic_1_3(ap: VaList) {
|
||||
// CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42, i32 0)
|
||||
foreign_c_variadic_1(ap, 2i32, 42i32, 0i32);
|
||||
|
Loading…
Reference in New Issue
Block a user