diff options
| author | Nikita Popov <npopov@redhat.com> | 2024-02-19 15:02:49 +0100 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2024-04-25 11:43:47 +0900 |
| commit | 3695af697efa26b0ea3b67739ade3ecc3929154e (patch) | |
| tree | 0b34ec36942c528246b5f3a85014f6952d8d99c3 /tests/codegen | |
| parent | aa067fb984d36462548bb785da221bfaf38253f0 (diff) | |
| download | rust-3695af697efa26b0ea3b67739ade3ecc3929154e.tar.gz rust-3695af697efa26b0ea3b67739ade3ecc3929154e.zip | |
Set writable and dead_on_unwind attributes for sret arguments
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/function-arguments.rs | 2 | ||||
| -rw-r--r-- | tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs | 2 | ||||
| -rw-r--r-- | tests/codegen/maybeuninit-rvo.rs | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs index 468ec0a7753..570d32f78fa 100644 --- a/tests/codegen/function-arguments.rs +++ b/tests/codegen/function-arguments.rs @@ -198,7 +198,7 @@ pub fn notunpin_box(x: Box<NotUnpin>) -> Box<NotUnpin> { x } -// CHECK: @struct_return(ptr noalias nocapture noundef sret([32 x i8]) align 4 dereferenceable(32){{( %_0)?}}) +// CHECK: @struct_return(ptr{{( dead_on_unwind)?}} noalias nocapture noundef{{( writable)?}} sret([32 x i8]) align 4 dereferenceable(32){{( %_0)?}}) #[no_mangle] pub fn struct_return() -> S { S { diff --git a/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs b/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs index c9be4f6d383..d978f2d2525 100644 --- a/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs +++ b/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs @@ -260,7 +260,7 @@ pub struct IntDoubleInt { #[no_mangle] pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {} -// CHECK: define void @f_ret_int_double_int_s(ptr noalias nocapture noundef sret([24 x i8]) align 8 dereferenceable(24) %_0) +// CHECK: define void @f_ret_int_double_int_s(ptr{{( dead_on_unwind)?}} noalias nocapture noundef{{( writable)?}} sret([24 x i8]) align 8 dereferenceable(24) %_0) #[no_mangle] pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt { IntDoubleInt { a: 1, b: 2., c: 3 } diff --git a/tests/codegen/maybeuninit-rvo.rs b/tests/codegen/maybeuninit-rvo.rs index 954514c736b..d6b9ee8d11d 100644 --- a/tests/codegen/maybeuninit-rvo.rs +++ b/tests/codegen/maybeuninit-rvo.rs @@ -1,4 +1,5 @@ //@ compile-flags: -O +//@ min-llvm-version: 18 #![feature(c_unwind)] #![crate_type = "lib"] @@ -24,7 +25,7 @@ extern "C-unwind" { pub fn new_from_uninit_unwind() -> Foo { // CHECK-LABEL: new_from_uninit - // CHECK: call void @llvm.memcpy. + // CHECK-NOT: call void @llvm.memcpy. let mut x = std::mem::MaybeUninit::uninit(); unsafe { init_unwind(x.as_mut_ptr()); |
