summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-01 07:08:38 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-01 07:08:38 +0000
commit58e2971bb01aeaf3d19ee813d6c79bb906992ae8 (patch)
tree078a78e905ce34d43399e61ce3a216108d456b85 /clang/test
parent8b0dba358a3fae6695aff56a150b9e18f66e0cf3 (diff)
downloadbcm5719-llvm-58e2971bb01aeaf3d19ee813d6c79bb906992ae8.tar.gz
bcm5719-llvm-58e2971bb01aeaf3d19ee813d6c79bb906992ae8.zip
x86-32 Darwin ABI: Single element arrays can be part of "single
element structures", which have different ABI rules. - Current return-arguments-32 status is: 1 out of 1000 failures (-7) - Also, vectors inside "single element structs" require special handling. llvm-svn: 68196
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/x86_32-arguments.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/clang/test/CodeGen/x86_32-arguments.c b/clang/test/CodeGen/x86_32-arguments.c
index 58637d52532..8e8a2f99987 100644
--- a/clang/test/CodeGen/x86_32-arguments.c
+++ b/clang/test/CodeGen/x86_32-arguments.c
@@ -63,7 +63,7 @@ struct s9 f9_1(void) {
void f9_2(struct s9 a0) {
}
-// Return of small structures and unions...
+// Return of small structures and unions
// RUN: grep 'float @f10()' %t &&
struct s10 {
@@ -71,12 +71,14 @@ struct s10 {
float f;
} f10(void) {}
-// Small vectors and 1 x {i64,double} are returned in registers...
+// Small vectors and 1 x {i64,double} are returned in registers
// RUN: grep 'i32 @f11()' %t &&
// RUN: grep -F 'void @f12(<2 x i32>* noalias sret %agg.result)' %t &&
// RUN: grep 'i64 @f13()' %t &&
// RUN: grep 'i64 @f14()' %t &&
+// RUN: grep '<2 x i64> @f15()' %t &&
+// RUN: grep '<2 x i64> @f16()' %t &&
typedef short T11 __attribute__ ((vector_size (4)));
T11 f11(void) {}
typedef int T12 __attribute__ ((vector_size (8)));
@@ -85,5 +87,34 @@ typedef long long T13 __attribute__ ((vector_size (8)));
T13 f13(void) {}
typedef double T14 __attribute__ ((vector_size (8)));
T14 f14(void) {}
+typedef long long T15 __attribute__ ((vector_size (16)));
+T15 f15(void) {}
+typedef double T16 __attribute__ ((vector_size (16)));
+T16 f16(void) {}
+
+// And when the single element in a struct (but not for 64 and
+// 128-bits).
+
+// RUN: grep 'i32 @f17()' %t &&
+// RUN: grep -F 'void @f18(%0* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f19(%1* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f20(%2* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f21(%3* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f22(%4* noalias sret %agg.result)' %t &&
+struct { T11 a; } f17(void) {}
+struct { T12 a; } f18(void) {}
+struct { T13 a; } f19(void) {}
+struct { T14 a; } f20(void) {}
+struct { T15 a; } f21(void) {}
+struct { T16 a; } f22(void) {}
+
+// Single element structures are handled specially
+
+// RUN: grep -F 'float @f23()' %t &&
+// RUN: grep -F 'float @f24()' %t &&
+// RUN: grep -F 'float @f25()' %t &&
+struct { float a; } f23(void) {}
+struct { float a[1]; } f24(void) {}
+struct { struct {} a; struct { float a[1]; } b; } f25(void) {}
// RUN: true
OpenPOWER on IntegriCloud