[cfe-commits] r94685 - in /cfe/trunk: lib/Basic/Targets.cpp test/Sema/arm-layout.c
Daniel Dunbar
daniel at zuster.org
Wed Jan 27 12:23:09 PST 2010
Author: ddunbar
Date: Wed Jan 27 14:23:08 2010
New Revision: 94685
URL: http://llvm.org/viewvc/llvm-project?rev=94685&view=rev
Log:
ARM/APCS: Fix alignment of long double.
Added:
cfe/trunk/test/Sema/arm-layout.c
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=94685&r1=94684&r2=94685&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jan 27 14:23:08 2010
@@ -1240,7 +1240,7 @@
// FIXME: We need support for -meabi... we could just mangle it into the
// name.
if (Name == "apcs-gnu") {
- DoubleAlign = LongLongAlign = 32;
+ DoubleAlign = LongLongAlign = LongDoubleAlign = 32;
SizeType = UnsignedLong;
if (IsThumb) {
Added: cfe/trunk/test/Sema/arm-layout.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/arm-layout.c?rev=94685&view=auto
==============================================================================
--- cfe/trunk/test/Sema/arm-layout.c (added)
+++ cfe/trunk/test/Sema/arm-layout.c Wed Jan 27 14:23:08 2010
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi apcs-gnu %s -verify
+// RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi aapcs %s -verify
+
+#ifdef __ARM_EABI__
+
+struct s0 { char field0; double field1; };
+int g0[sizeof(struct s0) == 16 ? 1 : -1];
+
+struct s1 { char field0; long double field1; };
+int g1[sizeof(struct s1) == 16 ? 1 : -1];
+
+#else
+
+struct s0 { char field0; double field1; };
+int g0[sizeof(struct s0) == 12 ? 1 : -1];
+
+struct s1 { char field0; long double field1; };
+int g1[sizeof(struct s1) == 12 ? 1 : -1];
+
+#endif
More information about the cfe-commits
mailing list