summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/alignment.c
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-08-07 18:08:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-08-07 18:08:19 +0000
commit885727581c10332bef9e97f247d3ed9e5e974d40 (patch)
treeb0cf4e349a3a2361d0a47143f2bde723dbf542e4 /clang/test/CodeGen/alignment.c
parent50985962d6ecbac43ac9e1f20aa52efd2e2f5b2b (diff)
downloadbcm5719-llvm-885727581c10332bef9e97f247d3ed9e5e974d40.tar.gz
bcm5719-llvm-885727581c10332bef9e97f247d3ed9e5e974d40.zip
Correctly allign arrays on 32 bit systems.
Before this patch we would align long long int big[1024]; to 4 bytes on 32 bit systems. The problem is that we were only looking at the element type when getLargeArrayMinWidth returned non zero. llvm-svn: 187897
Diffstat (limited to 'clang/test/CodeGen/alignment.c')
-rw-r--r--clang/test/CodeGen/alignment.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/CodeGen/alignment.c b/clang/test/CodeGen/alignment.c
index 98ea01be092..04d6aaccc21 100644
--- a/clang/test/CodeGen/alignment.c
+++ b/clang/test/CodeGen/alignment.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
__attribute((aligned(16))) float a[128];
union {int a[4]; __attribute((aligned(16))) float b[4];} b;
@@ -6,7 +6,8 @@ union {int a[4]; __attribute((aligned(16))) float b[4];} b;
// CHECK: @a = {{.*}}zeroinitializer, align 16
// CHECK: @b = {{.*}}zeroinitializer, align 16
-
+long long int test5[1024];
+// CHECK-DAG: @test5 = common global [1024 x i64] zeroinitializer, align 8
// PR5279 - Reduced alignment on typedef.
typedef int myint __attribute__((aligned(1)));
OpenPOWER on IntegriCloud