r174627 - FileCheckize volatile test
Tim Northover
Tim.Northover at arm.com
Thu Feb 7 07:39:16 PST 2013
Author: tnorthover
Date: Thu Feb 7 09:39:16 2013
New Revision: 174627
URL: http://llvm.org/viewvc/llvm-project?rev=174627&view=rev
Log:
FileCheckize volatile test
Modified:
cfe/trunk/test/CodeGen/volatile.c
Modified: cfe/trunk/test/CodeGen/volatile.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/volatile.c?rev=174627&r1=174626&r2=174627&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/volatile.c (original)
+++ cfe/trunk/test/CodeGen/volatile.c Thu Feb 7 09:39:16 2013
@@ -1,6 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm < %s -o %t
-// RUN: grep volatile %t | count 28
-// RUN: grep "memcpy.*, i1 true" %t | count 6
+// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
// The number 28 comes from the current codegen for volatile loads;
// if this number changes, it's not necessarily something wrong, but
@@ -47,54 +45,90 @@ int main() {
// load
i=S;
i=vS;
+// CHECK: load volatile
i=*pS;
i=*pvS;
+// CHECK: load volatile
i=A[2];
i=vA[2];
+// CHECK: load volatile
i=F.x;
i=vF.x;
+// CHECK: load volatile
i=F2.x;
i=vF2.x;
+// CHECK: load volatile
i=vpF2->x;
+// CHECK: load volatile
i=F3.x.y;
i=vF3.x.y;
+// CHECK: load volatile
i=BF.x;
i=vBF.x;
+// CHECK: load volatile
i=V[3];
i=vV[3];
+// CHECK: load volatile
i=VE.yx[1];
i=vVE.zy[1];
+// CHECK: load volatile
i = aggFct().x; // Note: not volatile
i=vtS;
+// CHECK: load volatile
// store
S=i;
vS=i;
+// CHECK: store volatile
*pS=i;
*pvS=i;
+// CHECK: store volatile
A[2]=i;
vA[2]=i;
+// CHECK: store volatile
F.x=i;
vF.x=i;
+// CHECK: store volatile
F2.x=i;
vF2.x=i;
+// CHECK: store volatile
vpF2->x=i;
+// CHECK: store volatile
vF3.x.y=i;
+// CHECK: store volatile
BF.x=i;
vBF.x=i;
+// CHECK: store volatile
V[3]=i;
vV[3]=i;
+// CHECK: store volatile
vtS=i;
+// CHECK: store volatile
// other ops:
++S;
++vS;
+// CHECK: load volatile
+// CHECK: store volatile
i+=S;
i+=vS;
+// CHECK: load volatile
++vtS;
+// CHECK: load volatile
+// CHECK: store volatile
(void)vF2;
+ // From vF2 to a temporary
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
vF2 = vF2;
+ // vF2 to itself
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
vF2 = vF2 = vF2;
+ // vF2 to itself twice
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
vF2 = (vF2, vF2);
+ // vF2 to a temporary, then vF2 to itself
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
+// CHECK: call void @llvm.memcpy{{.*}} i1 true
}
More information about the cfe-commits
mailing list