diff options
| author | Ralf Jung <post@ralfj.de> | 2023-01-02 14:09:01 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-02-06 12:17:41 +0100 |
| commit | 1ef16874b5ef79e193526cd23eebd30d45826360 (patch) | |
| tree | 997b7585d5e67dbba9fb0a406f8e95e7a4e168e8 /tests/codegen/function-arguments.rs | |
| parent | ea541bc2ee00c955e3f7eb3ddd5c3ab80146ab71 (diff) | |
| download | rust-1ef16874b5ef79e193526cd23eebd30d45826360.tar.gz rust-1ef16874b5ef79e193526cd23eebd30d45826360.zip | |
also do not add noalias on not-Unpin Box
Diffstat (limited to 'tests/codegen/function-arguments.rs')
| -rw-r--r-- | tests/codegen/function-arguments.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs index 0f4639086b8..96dfde18683 100644 --- a/tests/codegen/function-arguments.rs +++ b/tests/codegen/function-arguments.rs @@ -181,6 +181,12 @@ pub fn _box(x: Box<i32>) -> Box<i32> { x } +// CHECK: noundef nonnull align 4 {{i32\*|ptr}} @notunpin_box({{i32\*|ptr}} noundef nonnull align 4 %x) +#[no_mangle] +pub fn notunpin_box(x: Box<NotUnpin>) -> Box<NotUnpin> { + x +} + // CHECK: @struct_return({{%S\*|ptr}} noalias nocapture noundef sret(%S) dereferenceable(32){{( %0)?}}) #[no_mangle] pub fn struct_return() -> S { @@ -247,12 +253,12 @@ pub fn trait_raw(_: *const dyn Drop) { // CHECK: @trait_box({{\{\}\*|ptr}} noalias noundef nonnull align 1{{( %0)?}}, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}}) #[no_mangle] -pub fn trait_box(_: Box<dyn Drop>) { +pub fn trait_box(_: Box<dyn Drop + Unpin>) { } // CHECK: { {{i8\*|ptr}}, {{i8\*|ptr}} } @trait_option({{i8\*|ptr}} noalias noundef align 1 %x.0, {{i8\*|ptr}} %x.1) #[no_mangle] -pub fn trait_option(x: Option<Box<dyn Drop>>) -> Option<Box<dyn Drop>> { +pub fn trait_option(x: Option<Box<dyn Drop + Unpin>>) -> Option<Box<dyn Drop + Unpin>> { x } |
