summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/volatile.c
diff options
context:
space:
mode:
authorWarren Hunt <whunt@google.com>2014-02-21 23:49:50 +0000
committerWarren Hunt <whunt@google.com>2014-02-21 23:49:50 +0000
commitfb00c88703fe98f6f8c95114f62e6ec732862194 (patch)
treee376266cca55f3fe5a1cde477d81dfccb9088172 /clang/test/CodeGen/volatile.c
parent4db08df18e6f3ca85c045a2128d35e5665e303eb (diff)
downloadbcm5719-llvm-fb00c88703fe98f6f8c95114f62e6ec732862194.tar.gz
bcm5719-llvm-fb00c88703fe98f6f8c95114f62e6ec732862194.zip
Complete Rewrite of CGRecordLayoutBuilder
CGRecordLayoutBuilder was aging, complex, multi-pass, and shows signs of existing before ASTRecordLayoutBuilder. It redundantly performed many layout operations that are now performed by ASTRecordLayoutBuilder and asserted that the results were the same. With the addition of support for the MS-ABI, such as placement of vbptrs, vtordisps, different bitfield layout and a variety of other features, CGRecordLayoutBuilder was growing unwieldy in its redundancy. This patch re-architects CGRecordLayoutBuilder to not perform any redundant layout but rather, as directly as possible, lower an ASTRecordLayout to an llvm::type. The new architecture is significantly smaller and simpler than the CGRecordLayoutBuilder and contains fewer ABI-specific code paths. It's also one pass. The architecture of the new system is described in the comments. For the most part, the new system simply takes all of the fields and bases from an ASTRecordLayout, sorts them, inserts padding and dumps a record. Bitfields, unions and primary virtual bases make this process a bit more complicated. See the inline comments. In addition, this patch updates a few lit tests due to the fact that the new system computes more accurate llvm types than CGRecordLayoutBuilder. Each change is commented individually in the review. Differential Revision: http://llvm-reviews.chandlerc.com/D2795 llvm-svn: 201907
Diffstat (limited to 'clang/test/CodeGen/volatile.c')
-rw-r--r--clang/test/CodeGen/volatile.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/test/CodeGen/volatile.c b/clang/test/CodeGen/volatile.c
index 0dcdc15c77a..3e891aa32c7 100644
--- a/clang/test/CodeGen/volatile.c
+++ b/clang/test/CodeGen/volatile.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple=%itanium_abi_triple -emit-llvm < %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-IT
+// RUN: %clang_cc1 -triple=%ms_abi_triple -emit-llvm < %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-MS
int S;
volatile int vS;
@@ -83,10 +84,12 @@ int main() {
// CHECK: load volatile i32* getelementptr {{.*}} @vF3
// CHECK: store i32 {{.*}}, i32* [[I]]
i=BF.x;
-// CHECK: load i8* getelementptr {{.*}} @BF
+// CHECK-IT: load i8* getelementptr {{.*}} @BF
+// CHECK-MS: load i32* getelementptr {{.*}} @BF
// CHECK: store i32 {{.*}}, i32* [[I]]
i=vBF.x;
-// CHECK: load volatile i8* getelementptr {{.*}} @vBF
+// CHECK-IT: load volatile i8* getelementptr {{.*}} @vBF
+// CHECK-MS: load volatile i32* getelementptr {{.*}} @vBF
// CHECK: store i32 {{.*}}, i32* [[I]]
i=V[3];
// CHECK: load <4 x i32>* @V
@@ -154,12 +157,16 @@ int main() {
// CHECK: store volatile i32 {{.*}}, i32* getelementptr {{.*}} @vF3
BF.x=i;
// CHECK: load i32* [[I]]
-// CHECK: load i8* getelementptr {{.*}} @BF
-// CHECK: store i8 {{.*}}, i8* getelementptr {{.*}} @BF
+// CHECK-IT: load i8* getelementptr {{.*}} @BF
+// CHECK-MS: load i32* getelementptr {{.*}} @BF
+// CHECK-IT: store i8 {{.*}}, i8* getelementptr {{.*}} @BF
+// CHECK-MS: store i32 {{.*}}, i32* getelementptr {{.*}} @BF
vBF.x=i;
// CHECK: load i32* [[I]]
-// CHECK: load volatile i8* getelementptr {{.*}} @vBF
-// CHECK: store volatile i8 {{.*}}, i8* getelementptr {{.*}} @vBF
+// CHECK-IT: load volatile i8* getelementptr {{.*}} @vBF
+// CHECK-MS: load volatile i32* getelementptr {{.*}} @vBF
+// CHECK-IT: store volatile i8 {{.*}}, i8* getelementptr {{.*}} @vBF
+// CHECK-MS: store volatile i32 {{.*}}, i32* getelementptr {{.*}} @vBF
V[3]=i;
// CHECK: load i32* [[I]]
// CHECK: load <4 x i32>* @V
OpenPOWER on IntegriCloud