From 8408db36ee6592dd08d20ffcaac36ba81cffd5b8 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Thu, 8 Oct 2009 21:52:07 +0000 Subject: [PATCH] Convert some tests to FileCheck to be more portable. Patch by John Thompson. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83578 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/address-space-field2.c | 34 ++++++++++++++++++++-- test/CodeGen/address-space-field3.c | 32 +++++++++++++++++++-- test/CodeGen/address-space-field4.c | 44 +++++++++++++++++++++++++++-- test/CodeGen/cast-to-union.c | 8 +++--- 4 files changed, 105 insertions(+), 13 deletions(-) diff --git a/test/CodeGen/address-space-field2.c b/test/CodeGen/address-space-field2.c index 8b09d57b38..5576e55b63 100644 --- a/test/CodeGen/address-space-field2.c +++ b/test/CodeGen/address-space-field2.c @@ -1,6 +1,34 @@ -// RUN: clang-cc -emit-llvm < %s -o %t && -// RUN: grep addrspace\(1\) %t | count 8 && -// RUN: grep addrspace\(2\) %t | count 9 +// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) // Check that we don't lose the address space when accessing an array element // inside a structure. diff --git a/test/CodeGen/address-space-field3.c b/test/CodeGen/address-space-field3.c index f0b9dba982..567757fe66 100644 --- a/test/CodeGen/address-space-field3.c +++ b/test/CodeGen/address-space-field3.c @@ -1,6 +1,32 @@ -// RUN: clang-cc -emit-llvm < %s -o %t && -// RUN: grep addrspace\(1\) %t | count 8 && -// RUN: grep addrspace\(2\) %t | count 8 +// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) // Check that we don't lose the address space when accessing an array element // inside a structure. diff --git a/test/CodeGen/address-space-field4.c b/test/CodeGen/address-space-field4.c index 2c74353c3a..31df018206 100644 --- a/test/CodeGen/address-space-field4.c +++ b/test/CodeGen/address-space-field4.c @@ -1,6 +1,44 @@ -// RUN: clang-cc -emit-llvm < %s -o %t && -// RUN: grep addrspace\(2\) %t | count 4 && -// RUN: grep addrspace\(3\) %t | count 4 +// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s +// CHECK: addrspace(2) +// CHECK: addrspace(3) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(3) +// CHECK: addrspace(3) +// CHECK: addrspace(1) +// CHECK: addrspace(3) +// CHECK: addrspace(3) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(1) +// CHECK: addrspace(2) +// CHECK: addrspace(2) +// CHECK: addrspace(2) // Check the load and store are using the correct address space to access // the variables. diff --git a/test/CodeGen/cast-to-union.c b/test/CodeGen/cast-to-union.c index 9c61a840ec..6742992949 100644 --- a/test/CodeGen/cast-to-union.c +++ b/test/CodeGen/cast-to-union.c @@ -1,7 +1,7 @@ -// RUN: clang-cc -emit-llvm < %s -o %t && -// RUN: grep "store i32 351, i32*" %t && -// RUN: grep "w = global %0 { i32 2, \[4 x i8\] zeroinitializer }" %t && -// RUN: grep "y = global %union.u { double 7.300000e+01 }" %t +// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s +// CHECK: w = global %0 { i32 2, [4 x i8] zeroinitializer } +// CHECK: y = global %union.u { double 7.300000e+0{{[0]*}}1 } +// CHECK: store i32 351, i32 union u { int i; double d; };