FileCheckize volatile test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174627 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/volatile.c b/test/CodeGen/volatile.c
index 6caf711..b028635 100644
--- a/test/CodeGen/volatile.c
+++ b/test/CodeGen/volatile.c
@@ -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 @@
// 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
}