diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-04-21 19:49:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-04-21 19:49:55 +0000 |
commit | 53fac692fa06c812490bbbc25cb14dae67c95685 (patch) | |
tree | 893632edf38f8e3467827b6577fe6936df738e8e /clang/test/CodeGen | |
parent | f5dbc072a6df0ec4df8e16cffe667fa22eabd47f (diff) | |
download | bcm5719-llvm-53fac692fa06c812490bbbc25cb14dae67c95685.tar.gz bcm5719-llvm-53fac692fa06c812490bbbc25cb14dae67c95685.zip |
ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.
llvm-svn: 102019
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/x86_32-arguments.c | 12 | ||||
-rw-r--r-- | clang/test/CodeGen/x86_64-arguments.c | 16 |
2 files changed, 27 insertions, 1 deletions
diff --git a/clang/test/CodeGen/x86_32-arguments.c b/clang/test/CodeGen/x86_32-arguments.c index 42eeb434c39..01c3e236f3b 100644 --- a/clang/test/CodeGen/x86_32-arguments.c +++ b/clang/test/CodeGen/x86_32-arguments.c @@ -202,3 +202,15 @@ void f50(struct s50 a0) { } struct s51 { vvbp f0; int f1; }; void f51(struct s51 a0) { } +// CHECK: define void @f52(%struct.s52* byval align 16 %x) +struct s52 { + long double a; +}; +void f52(struct s52 x) {} + +// CHECK: define void @f53(%struct.s53* byval align 32 %x) +struct __attribute__((aligned(32))) s53 { + int x; + int y; +}; +void f53(struct s53 x) {} diff --git a/clang/test/CodeGen/x86_64-arguments.c b/clang/test/CodeGen/x86_64-arguments.c index dd332bed997..47b2eb1585e 100644 --- a/clang/test/CodeGen/x86_64-arguments.c +++ b/clang/test/CodeGen/x86_64-arguments.c @@ -60,7 +60,7 @@ struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} } struct s10 { int a; int b; int : 0; }; void f10(struct s10 a0) {} -// CHECK: define void @f11(%union.anon* sret %agg.result) +// CHECK: define void @f11(%struct.s19* sret %agg.result) union { long double a; float b; } f11() { while (1) {} } // CHECK: define i64 @f12_0() @@ -99,3 +99,17 @@ void f17(float a, float b, float c, float d, float e, float f, float g, float h, struct f18_s0 { int f0; }; void f18(int a, struct f18_s0 f18_arg1) { while (1) {} } +// Check byval alignment. + +// CHECK: define void @f19(%struct.s19* byval align 16 %x) +struct s19 { + long double a; +}; +void f19(struct s19 x) {} + +// CHECK: define void @f20(%struct.s20* byval align 32 %x) +struct __attribute__((aligned(32))) s20 { + int x; + int y; +}; +void f20(struct s20 x) {} |