summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/alignment.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2015-09-29 04:37:40 +0000
committerJohn McCall <rjmccall@apple.com>2015-09-29 04:37:40 +0000
commit8460bcaa332df13fa3a83d2f62c65a4a14190970 (patch)
tree7abe3705a3aa4d8d061c25daa19389126981636a /clang/test/CodeGen/alignment.c
parent8674c5cf70f6479132bc7dd63467b6c8c92c469d (diff)
downloadbcm5719-llvm-8460bcaa332df13fa3a83d2f62c65a4a14190970.tar.gz
bcm5719-llvm-8460bcaa332df13fa3a83d2f62c65a4a14190970.zip
Honor the casted-to alignment of an explicit cast even when
Sema thinks the cast is a no-op, as it does when (e.g.) the only thing that changes is an alignment attribute. Fixed PR24944. llvm-svn: 248775
Diffstat (limited to 'clang/test/CodeGen/alignment.c')
-rw-r--r--clang/test/CodeGen/alignment.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGen/alignment.c b/clang/test/CodeGen/alignment.c
index 0a598010c85..c9f58136e38 100644
--- a/clang/test/CodeGen/alignment.c
+++ b/clang/test/CodeGen/alignment.c
@@ -59,3 +59,11 @@ void test4(float4align64 *p) {
// CHECK: @test4(
// CHECK: store <4 x float> {{.*}}, <4 x float>* {{.*}}, align 64
+// PR24944 - Typedef alignment not honored on no-op cast.
+typedef float __attribute__((vector_size(16), aligned(16))) float4align16;
+typedef float __attribute__((vector_size(16), aligned(2))) float4align2;
+void test6(float4align64 *p) {
+ float4align64 vec = *(float4align2*) p;
+}
+// CHECK-LABEL: @test6
+// CHECK: load <4 x float>, <4 x float>* {{.*}}, align 2
OpenPOWER on IntegriCloud