test: Convert some tests to FileCheck

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

llvm-svn: 227007
This commit is contained in:
Justin Bogner 2015-01-24 17:39:36 +00:00
parent 2af264a44a
commit 9fa8c9984c
7 changed files with 19 additions and 12 deletions

View File

@ -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)));

View File

@ -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;

View File

@ -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;
}

View File

@ -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;}

View File

@ -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;

View File

@ -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[]);

View File

@ -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 *);