summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-04-04 20:39:50 +0000
committerJohn McCall <rjmccall@apple.com>2016-04-04 20:39:50 +0000
commit8cde42c40084bc62c3fbffbc2ed8b118813a008c (patch)
tree9f961ab379a090a5a85124c0855b77d3c940e12e
parentb810b02b853dc4e42d641cea24bc853f1894b9f0 (diff)
downloadbcm5719-llvm-8cde42c40084bc62c3fbffbc2ed8b118813a008c.tar.gz
bcm5719-llvm-8cde42c40084bc62c3fbffbc2ed8b118813a008c.zip
Fix an unused-variable warning by using the variable in the place
it was supposed to have been used. llvm-svn: 265344
-rw-r--r--clang/lib/CodeGen/SwiftCallingConv.cpp2
-rw-r--r--clang/test/CodeGen/arm-swiftcall.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/SwiftCallingConv.cpp b/clang/lib/CodeGen/SwiftCallingConv.cpp
index 6fae19f2779..44b46f62f86 100644
--- a/clang/lib/CodeGen/SwiftCallingConv.cpp
+++ b/clang/lib/CodeGen/SwiftCallingConv.cpp
@@ -239,7 +239,7 @@ void SwiftAggLowering::addLegalTypedData(llvm::Type *type,
auto eltSize = (end - begin) / numElts;
assert(eltSize == getTypeStoreSize(CGM, eltTy));
for (size_t i = 0, e = numElts; i != e; ++i) {
- addLegalTypedData(type, begin, begin + eltSize);
+ addLegalTypedData(eltTy, begin, begin + eltSize);
begin += eltSize;
}
assert(begin == end);
diff --git a/clang/test/CodeGen/arm-swiftcall.c b/clang/test/CodeGen/arm-swiftcall.c
index d2465594135..f8c97c418a5 100644
--- a/clang/test/CodeGen/arm-swiftcall.c
+++ b/clang/test/CodeGen/arm-swiftcall.c
@@ -62,6 +62,7 @@ typedef float float4 __attribute__((ext_vector_type(4)));
typedef float float8 __attribute__((ext_vector_type(8)));
typedef double double2 __attribute__((ext_vector_type(2)));
typedef double double4 __attribute__((ext_vector_type(4)));
+typedef int int3 __attribute__((ext_vector_type(3)));
typedef int int4 __attribute__((ext_vector_type(4)));
typedef int int5 __attribute__((ext_vector_type(5)));
typedef int int8 __attribute__((ext_vector_type(8)));
@@ -494,3 +495,10 @@ TEST(int5)
// CHECK: [[SECOND:%.*]] = load i32, i32* [[T0]], align
// CHECK: call [[SWIFTCC]] void @take_int5(<4 x i32> [[FIRST]], i32 [[SECOND]])
// CHECK: ret void
+
+typedef struct {
+ int x;
+ int3 v __attribute__((packed));
+} misaligned_int3;
+TEST(misaligned_int3)
+// CHECK-LABEL: define {{.*}} @take_misaligned_int3(i32, i32, i32, i32)
OpenPOWER on IntegriCloud