summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-26 18:13:50 +0000
committerChris Lattner <sabre@nondot.org>2010-08-26 18:13:50 +0000
commit69e683fb35cacc57255ec0f3e643310e2bbaf70d (patch)
treed8fb6010f8e49491c0de82f74a745ee83562fd4c /clang
parentf34728a95c7e16dc0f5d6c3bbe184af1a536072c (diff)
downloadbcm5719-llvm-69e683fb35cacc57255ec0f3e643310e2bbaf70d.tar.gz
bcm5719-llvm-69e683fb35cacc57255ec0f3e643310e2bbaf70d.zip
vector of long and ulong are also classified as INTEGER in x86-64 abi,
this fixes rdar://8358475 a failure of the gcc.dg/compat/vector_1 abi test. llvm-svn: 112205
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp4
-rw-r--r--clang/test/CodeGen/x86_64-arguments.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 04faaead2ae..958f740bec3 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -894,7 +894,9 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase,
// gcc passes <1 x long long> as INTEGER.
if (VT->getElementType()->isSpecificBuiltinType(BuiltinType::LongLong) ||
- VT->getElementType()->isSpecificBuiltinType(BuiltinType::ULongLong))
+ VT->getElementType()->isSpecificBuiltinType(BuiltinType::ULongLong) ||
+ VT->getElementType()->isSpecificBuiltinType(BuiltinType::Long) ||
+ VT->getElementType()->isSpecificBuiltinType(BuiltinType::ULong))
Current = Integer;
else
Current = SSE;
diff --git a/clang/test/CodeGen/x86_64-arguments.c b/clang/test/CodeGen/x86_64-arguments.c
index 0ad8a8acb16..51a234d993c 100644
--- a/clang/test/CodeGen/x86_64-arguments.c
+++ b/clang/test/CodeGen/x86_64-arguments.c
@@ -239,3 +239,9 @@ typedef unsigned long long v1i64 __attribute__((__vector_size__(8)));
// CHECK: define i64 @f34(i64 %arg.coerce)
v1i64 f34(v1i64 arg) { return arg; }
+
+// rdar://8358475
+// CHECK: define i64 @f35(i64 %arg.coerce)
+typedef unsigned long v1i64_2 __attribute__((__vector_size__(8)));
+v1i64_2 f35(v1i64_2 arg) { return arg+arg; }
+
OpenPOWER on IntegriCloud