diff options
| author | bors <bors@rust-lang.org> | 2024-04-25 04:31:56 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-25 04:31:56 +0000 | 
| commit | 284f94f9c0f77ad4ef85323a634cfda29c1a801d (patch) | |
| tree | d0857c02932df2dc5d1d32691edd1ae5a06e0e86 /tests/codegen/function-arguments.rs | |
| parent | cb3752d20e0f5d24348062211102a08d46fbecff (diff) | |
| parent | 976267b5141ef9a72ba3cb9edf01ca3bc53ec81e (diff) | |
| download | rust-284f94f9c0f77ad4ef85323a634cfda29c1a801d.tar.gz rust-284f94f9c0f77ad4ef85323a634cfda29c1a801d.zip | |
Auto merge of #121298 - nikic:writable, r=cuviper
Set writable and dead_on_unwind attributes for sret arguments Set the `writable` and `dead_on_unwind` attributes for `sret` arguments. This allows call slot optimization to remove more memcpy's. See https://llvm.org/docs/LangRef.html#parameter-attributes for the specification of these attributes. In short, the statement we're making here is that: * The return slot is writable. * The return slot will not be read if the function unwinds. Fixes https://github.com/rust-lang/rust/issues/90595.
Diffstat (limited to 'tests/codegen/function-arguments.rs')
| -rw-r--r-- | tests/codegen/function-arguments.rs | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs index 2b27dab078d..ebcbcae8563 100644 --- a/tests/codegen/function-arguments.rs +++ b/tests/codegen/function-arguments.rs @@ -197,7 +197,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 { | 
