r227007 - test: Convert some tests to FileCheck

Justin Bogner mail at justinbogner.com
Sat Jan 24 09:39:37 PST 2015


Author: bogner
Date: Sat Jan 24 11:39:36 2015
New Revision: 227007

URL: http://llvm.org/viewvc/llvm-project?rev=227007&view=rev
Log:
test: Convert some tests to FileCheck

These were all doing trivial greps. It's better to use FileCheck.

Modified:
    cfe/trunk/test/CodeGen/align-local.c
    cfe/trunk/test/CodeGen/cleanup-stack.c
    cfe/trunk/test/CodeGen/enum.c
    cfe/trunk/test/CodeGen/kr-func-promote.c
    cfe/trunk/test/CodeGen/private-extern.c
    cfe/trunk/test/CodeGen/vla-2.c
    cfe/trunk/test/CodeGen/vla-3.c

Modified: cfe/trunk/test/CodeGen/align-local.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/align-local.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/align-local.c (original)
+++ cfe/trunk/test/CodeGen/align-local.c Sat Jan 24 11:39:36 2015
@@ -1,7 +1,9 @@
-// RUN: %clang_cc1 -emit-llvm < %s | grep "align 16" | count 2
+// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
 
 typedef struct __attribute((aligned(16))) {int x[4];} ff;
 
+// CHECK: alloca %struct.ff, align 16
+// CHECK: alloca %struct.anon, align 16
 int a() {
   ff a;
   struct {int x[4];} b __attribute((aligned(16)));

Modified: cfe/trunk/test/CodeGen/cleanup-stack.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/cleanup-stack.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/cleanup-stack.c (original)
+++ cfe/trunk/test/CodeGen/cleanup-stack.c Sat Jan 24 11:39:36 2015
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm %s -o %t
-// RUN: grep "ret i32 9" %t
+// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm %s -o - | FileCheck %s
+// CHECK: ret i32 9
 
 struct s0 {
   int *var;

Modified: cfe/trunk/test/CodeGen/enum.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/enum.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/enum.c (original)
+++ cfe/trunk/test/CodeGen/enum.c Sat Jan 24 11:39:36 2015
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | grep 'ret i32 6'
-// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | grep 'ret i32 7'
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | FileCheck -check-prefix=CHECK-C %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | FileCheck -check-prefix=CHECK-CXX %s
+// CHECK-C: ret i32 6
+// CHECK-CXX: ret i32 7
 
 // This test case illustrates a peculiarity of the promotion of
 // enumeration types in C and C++. In particular, the enumeration type
@@ -19,4 +21,3 @@ int main (void)
 
   return r;
 }
-

Modified: cfe/trunk/test/CodeGen/kr-func-promote.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/kr-func-promote.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/kr-func-promote.c (original)
+++ cfe/trunk/test/CodeGen/kr-func-promote.c Sat Jan 24 11:39:36 2015
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | grep "i32 @a(i32)"
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
+// CHECK: i32 @a(i32)
 
 int a();
 int a(x) short x; {return x;}

Modified: cfe/trunk/test/CodeGen/private-extern.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/private-extern.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/private-extern.c (original)
+++ cfe/trunk/test/CodeGen/private-extern.c Sat Jan 24 11:39:36 2015
@@ -1,6 +1,7 @@
-// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep '@g0 = external hidden constant i32' %t
-// RUN: grep '@g1 = hidden constant i32 1' %t
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+// CHECK-DAG: @g0 = external hidden constant i32
+// CHECK-DAG: @g1 = hidden constant i32 1
 
 __private_extern__ const int g0;
 __private_extern__ const int g1 = 1;

Modified: cfe/trunk/test/CodeGen/vla-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vla-2.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/vla-2.c (original)
+++ cfe/trunk/test/CodeGen/vla-2.c Sat Jan 24 11:39:36 2015
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | grep ".*alloca.*align 16"
+// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | FileCheck %s
+// CHECK: alloca {{.*}}, align 16
 
 extern void bar(int[]);
 

Modified: cfe/trunk/test/CodeGen/vla-3.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vla-3.c?rev=227007&r1=227006&r2=227007&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/vla-3.c (original)
+++ cfe/trunk/test/CodeGen/vla-3.c Sat Jan 24 11:39:36 2015
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | grep ".*alloca.*align 16"
+// RUN: %clang_cc1 -std=gnu99 %s -emit-llvm -o - | FileCheck %s
+// CHECK: alloca {{.*}}, align 16
 
 void adr(char *);
 





More information about the cfe-commits mailing list