From: Justin Bogner Date: Sat, 24 Jan 2015 17:39:36 +0000 (+0000) Subject: test: Convert some tests to FileCheck X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5533d9b3d566c7e9d6f6ecf678c519306a034dae;p=clang test: Convert some tests to FileCheck These were all doing trivial greps. It's better to use FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227007 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/align-local.c b/test/CodeGen/align-local.c index b839ee14a1..c8b27a83c3 100644 --- a/test/CodeGen/align-local.c +++ b/test/CodeGen/align-local.c @@ -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))); diff --git a/test/CodeGen/cleanup-stack.c b/test/CodeGen/cleanup-stack.c index 72a1a6c751..6448aac238 100644 --- a/test/CodeGen/cleanup-stack.c +++ b/test/CodeGen/cleanup-stack.c @@ -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; diff --git a/test/CodeGen/enum.c b/test/CodeGen/enum.c index 0e239f1a8e..ef50f9eead 100644 --- a/test/CodeGen/enum.c +++ b/test/CodeGen/enum.c @@ -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; } - diff --git a/test/CodeGen/kr-func-promote.c b/test/CodeGen/kr-func-promote.c index fcdbac3ee4..8e55dc91ed 100644 --- a/test/CodeGen/kr-func-promote.c +++ b/test/CodeGen/kr-func-promote.c @@ -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;} diff --git a/test/CodeGen/private-extern.c b/test/CodeGen/private-extern.c index 2d34d54321..26b3fcede5 100644 --- a/test/CodeGen/private-extern.c +++ b/test/CodeGen/private-extern.c @@ -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; diff --git a/test/CodeGen/vla-2.c b/test/CodeGen/vla-2.c index 0a74907f7b..894913da3e 100644 --- a/test/CodeGen/vla-2.c +++ b/test/CodeGen/vla-2.c @@ -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[]); diff --git a/test/CodeGen/vla-3.c b/test/CodeGen/vla-3.c index 4927b46423..66acf58c1f 100644 --- a/test/CodeGen/vla-3.c +++ b/test/CodeGen/vla-3.c @@ -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 *);