diff options
| author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2020-11-29 19:49:41 -0500 |
|---|---|---|
| committer | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2020-11-29 20:08:00 -0500 |
| commit | 0183b4109a04ad78722b919366005df84878cf5d (patch) | |
| tree | 769902d593fdc4f65d30df6cc5e402fa1e85bc8a /src/test/codegen | |
| parent | 88b81970ba7a989a728b32039dd075dc206f1360 (diff) | |
| download | rust-0183b4109a04ad78722b919366005df84878cf5d.tar.gz rust-0183b4109a04ad78722b919366005df84878cf5d.zip | |
Pass arguments up to 2*usize by value
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/arg-return-value-in-reg.rs (renamed from src/test/codegen/return-value-in-reg.rs) | 4 | ||||
| -rw-r--r-- | src/test/codegen/union-abi.rs | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/test/codegen/return-value-in-reg.rs b/src/test/codegen/arg-return-value-in-reg.rs index 4bc0136c5e3..a1815e37cf2 100644 --- a/src/test/codegen/return-value-in-reg.rs +++ b/src/test/codegen/arg-return-value-in-reg.rs @@ -1,4 +1,4 @@ -//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer. +//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer. // compile-flags: -C no-prepopulate-passes -O // only-x86_64 @@ -11,7 +11,7 @@ pub struct S { c: u32, } -// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s) +// CHECK: define i128 @modify(i128 %0) #[no_mangle] pub fn modify(s: S) -> S { S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c } diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs index afea01e9a2d..f282fd23705 100644 --- a/src/test/codegen/union-abi.rs +++ b/src/test/codegen/union-abi.rs @@ -63,11 +63,16 @@ pub union UnionU128{a:u128} #[no_mangle] pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} } +pub union UnionU128x2{a:(u128, u128)} +// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1) +#[no_mangle] +pub fn test_UnionU128x2(_: UnionU128x2) { loop {} } + #[repr(C)] -pub union CUnionU128{a:u128} -// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1) +pub union CUnionU128x2{a:(u128, u128)} +// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1) #[no_mangle] -pub fn test_CUnionU128(_: CUnionU128) { loop {} } +pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} } pub union UnionBool { b:bool } // CHECK: define zeroext i1 @test_UnionBool(i8 %b) |
