Always use packed structs. This isn't really very nice, but there's
nothing fundamentally wrong with it. Emitting unpacked structs where
possible is more work for almost no practical benefit. We'll probably
want to fix it at some point anyway, but it's low priority.
The issue with long double in particular is that LLVM thinks an X86 long
double is 10 bytes, while clang considers it for all purposes to be
either 12 or 16 bytes, depending on the platform, even in a packed
struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51673 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/struct-x86-darwin.c b/test/CodeGen/struct-x86-darwin.c
index 3d3729d..68e6d72 100644
--- a/test/CodeGen/struct-x86-darwin.c
+++ b/test/CodeGen/struct-x86-darwin.c
@@ -1,16 +1,14 @@
-// RUN: clang < %s -emit-llvm > %t1
-// Run grep "STest1 = type { i32, \[4 x i16\], double }" %t1 &&
-// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 &&
-// RUN: grep "STest3 = type { i8, i8, i16, i32 }" %t1 &&
-// RUN: grep "STestB1 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 &&
-// RUN: grep "STestB3 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1
-// RUN: grep "STestB5 = type { i8, i8, i8, i8, i8, i8 }" %t1
-// RUN: grep "STestB6 = type { i8, i8, i8, i8 }" %t1
+// RUN: clang < %s -emit-llvm > %t1 -triple=i686-apple-darwin9
+// Run grep "STest1 = type <{ i32, \[4 x i16\], double }>" %t1 &&
+// RUN: grep "STest2 = type <{ i16, i16, i32, i32 }>" %t1 &&
+// RUN: grep "STest3 = type <{ i8, i8, i16, i32 }>" %t1 &&
+// RUN: grep "STestB1 = type <{ i8, i8 }>" %t1 &&
+// RUN: grep "STestB2 = type <{ i8, i8, i8 }>" %t1 &&
+// RUN: grep "STestB3 = type <{ i8, i8 }>" %t1 &&
+// RUN: grep "STestB4 = type <{ i8, i8, i8, i8 }>" %t1
+// RUN: grep "STestB5 = type <{ i8, i8, i8, i8, i8, i8 }>" %t1
+// RUN: grep "STestB6 = type <{ i8, i8, i8, i8 }>" %t1
// Test struct layout for x86-darwin target
-// FIXME : Enable this test for x86-darwin only. At the moment clang hard codes
-// x86-darwin as the target
struct STest1 {int x; short y[4]; double z; } st1;
struct STest2 {short a,b; int c,d; } st2;