Index: test/CodeGenCXX/predefined-expr.cpp
===================================================================
--- test/CodeGenCXX/predefined-expr.cpp	(revision 83183)
+++ test/CodeGenCXX/predefined-expr.cpp	(working copy)
@@ -51,7 +51,7 @@
 // CHECK: private constant [11 x i8] c"staticFunc\00"
 // CHECK: private constant [28 x i8] c"void NS::Base::staticFunc()\00"
 
-#include <stdio.h>
+int printf(const char * _Format, ...);
 
 namespace NS {
 
Index: test/CodeGenObjC/predefined-expr.m
===================================================================
--- test/CodeGenObjC/predefined-expr.m	(revision 83183)
+++ test/CodeGenObjC/predefined-expr.m	(working copy)
@@ -11,7 +11,7 @@
 // CHECK: @"__func__.-[Foo(Category) instanceTestWithCategory]" = private constant [42 x i8] c"-[Foo(Category) instanceTestWithCategory]\00"
 // CHECK: @"__func__.+[Foo(Category) classTestWithCategory]" = private constant [39 x i8] c"+[Foo(Category) classTestWithCategory]\00"
 
-#include <stdio.h>
+int printf(const char * _Format, ...);
 
 @interface Foo
 @end
Index: test/CodeGen/address-space-field2.c
===================================================================
--- test/CodeGen/address-space-field2.c	(revision 83183)
+++ test/CodeGen/address-space-field2.c	(working copy)
@@ -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.
Index: test/CodeGen/const-init.c
===================================================================
--- test/CodeGen/const-init.c	(revision 83183)
+++ test/CodeGen/const-init.c	(working copy)
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -verify -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -verify -emit-llvm %s -o - | FileCheck %s
 
 #include <stdint.h>
 
@@ -22,44 +22,44 @@
 
 int g0 = (int)(&(((union s2 *) 0)->f0.f0) - 0);
 
-// RUN: grep '@g1x = global %. { double 1.000000e+00, double 0.000000e+00 }' %t &&
+// CHECK: @g1x = global {{%[0-9]}} { double 1.000000e+00{{[0]*}}, double 0.000000e+00{{[0]*}} }
 _Complex double g1x = 1.0f;
-// RUN: grep '@g1y = global %. { double 0.000000e+00, double 1.000000e+00 }' %t &&
+// CHECK: @g1y = global {{%[0-9]}} { double 0.000000e+00{{[0]*}}, double 1.000000e+00{{[0]*}} }
 _Complex double g1y = 1.0fi;
-// RUN: grep '@g1 = global %. { i8 1, i8 10 }' %t &&
+// CHECK: @g1 = global {{%[0-9]}} { i8 1, i8 10 }
 _Complex char g1 = (char) 1 + (char) 10 * 1i;
-// RUN: grep '@g2 = global %2 { i32 1, i32 10 }' %t &&
+// CHECK: @g2 = global %2 { i32 1, i32 10 }
 _Complex int g2 = 1 + 10i;
-// RUN: grep '@g3 = global %. { float 1.000000e+00, float 1.000000e+01 }' %t &&
+// CHECK: @g3 = global {{%[0-9]}} { float 1.000000e+00{{[0]*}}, float 1.000000e+0{{[0]*}}1 }
 _Complex float g3 = 1.0 + 10.0i;
-// RUN: grep '@g4 = global %. { double 1.000000e+00, double 1.000000e+01 }' %t &&
+// CHECK: @g4 = global {{%[0-9]}} { double 1.000000e+00{{[0]*}}, double 1.000000e+0{{[0]*}}1 }
 _Complex double g4 = 1.0 + 10.0i;
-// RUN: grep '@g5 = global %2 zeroinitializer' %t &&
+// CHECK: @g5 = global %2 zeroinitializer
 _Complex int g5 = (2 + 3i) == (5 + 7i);
-// RUN: grep '@g6 = global %. { double -1.100000e+01, double 2.900000e+01 }' %t &&
+// CHECK: @g6 = global {{%[0-9]}} { double -1.100000e+0{{[0]*}}1, double 2.900000e+0{{[0]*}}1 }
 _Complex double g6 = (2.0 + 3.0i) * (5.0 + 7.0i);
-// RUN: grep '@g7 = global i32 1' %t &&
+// CHECK: @g7 = global i32 1
 int g7 = (2 + 3i) * (5 + 7i) == (-11 + 29i);
-// RUN: grep '@g8 = global i32 1' %t &&
+// CHECK: @g8 = global i32 1
 int g8 = (2.0 + 3.0i) * (5.0 + 7.0i) == (-11.0 + 29.0i);
-// RUN: grep '@g9 = global i32 0' %t &&
+// CHECK: @g9 = global i32 0
 int g9 = (2 + 3i) * (5 + 7i) != (-11 + 29i);
-// RUN: grep '@g10 = global i32 0' %t &&
+// CHECK: @g10 = global i32 0
 int g10 = (2.0 + 3.0i) * (5.0 + 7.0i) != (-11.0 + 29.0i);
 
 
 // Global references
-// RUN: grep '@g11.l0 = internal global i32 ptrtoint (i32 ()\* @g11 to i32)' %t &&
+// CHECK: @g11.l0 = internal global i32 ptrtoint (i32 ()* @g11 to i32)
 long g11() { 
   static long l0 = (long) g11;
   return l0; 
 }
 
-// RUN: grep '@g12 = global i32 ptrtoint (i8\* @g12_tmp to i32)' %t &&
+// CHECK: @g12 = global i32 ptrtoint (i8* @g12_tmp to i32)
 static char g12_tmp;
 long g12 = (long) &g12_tmp;
 
-// RUN: grep '@g13 = global \[1 x %.truct.g13_s0\] \[%.truct.g13_s0 { i32 ptrtoint (i8\* @g12_tmp to i32) }\]' %t &&
+// CHECK: @g13 = global [1 x %struct.g13_s0] [%struct.g13_s0 { i32 ptrtoint (i8* @g12_tmp to i32) }]
 struct g13_s0 {
    long a;
 };
@@ -67,25 +67,25 @@
    { (long) &g12_tmp }
 };
 
-// RUN: grep '@g14 = global i8\* inttoptr (i64 100 to i8\*)' %t &&
+// CHECK: @g14 = global i8* inttoptr (i64 100 to i8*)
 void *g14 = (void*) 100;
 
-// RUN: grep '@g15 = global i32 -1' %t &&
+// CHECK: @g15 = global i32 -1
 int g15 = (int) (char) ((void*) 0 + 255);
 
-// RUN: grep '@g16 = global i64 4294967295' %t &&
+// CHECK: @g16 = global i64 4294967295
 long long g16 = (long long) ((void*) 0xFFFFFFFF);
 
-// RUN: grep '@g17 = global i32\* @g15' %t &&
+// CHECK: @g17 = global i32* @g15
 int *g17 = (int *) ((long) &g15);
 
-// RUN: grep '@g18.p = internal global \[1 x i32\*\] \[i32\* @g19\]' %t &&
+// CHECK: @g18.p = internal global [1 x i32*] [i32* @g19]
 void g18(void) {
   extern int g19;
   static int *p[] = { &g19 };
 }
 
-// RUN: grep '@g20.l0 = internal global %.truct.g20_s1 { %.truct.g20_s0\* null, %.truct.g20_s0\*\* getelementptr inbounds (%.truct.g20_s1\* @g20.l0, i32 0, i32 0) }' %t &&
+// CHECK: @g20.l0 = internal global %struct.g20_s1 { %struct.g20_s0* null, %struct.g20_s0** getelementptr inbounds (%struct.g20_s1* @g20.l0, i32 0, i32 0) }
 
 struct g20_s0;
 struct g20_s1 {
@@ -100,5 +100,3 @@
 struct g21 {int g21;};
 const struct g21 g21 = (struct g21){1};
 
-// RUN: true
-
Index: test/CodeGen/address-space-field3.c
===================================================================
--- test/CodeGen/address-space-field3.c	(revision 83183)
+++ test/CodeGen/address-space-field3.c	(working copy)
@@ -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.
Index: test/CodeGen/stack-protector.c
===================================================================
--- test/CodeGen/stack-protector.c	(revision 83183)
+++ test/CodeGen/stack-protector.c	(working copy)
@@ -12,8 +12,7 @@
 // RUN: not grep 'ssp' %t &&
 // RUN: true
 
-#include <stdio.h>
-#include <string.h>
+int printf(const char * _Format, ...);
 
 void test1(const char *msg) {
   char a[strlen(msg) + 1];
Index: test/CodeGen/cast-to-union.c
===================================================================
--- test/CodeGen/cast-to-union.c	(revision 83183)
+++ test/CodeGen/cast-to-union.c	(working copy)
@@ -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; };
 
Index: test/CodeGen/mmintrin-test.c
===================================================================
--- test/CodeGen/mmintrin-test.c	(revision 83183)
+++ test/CodeGen/mmintrin-test.c	(working copy)
@@ -1,11 +1,27 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -mcpu=pentium4 -emit-llvm -o %t %s && 
-// RUN: grep define %t | count 1 &&
-// RUN: clang-cc -triple i386-apple-darwin9 -mcpu=pentium4 -g -emit-llvm -o %t %s && 
-// RUN: grep define %t | count 1
+// RUN: clang-cc -triple i386-apple-darwin9 -mcpu=pentium4 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK1 %s && 
+// RUN: clang-cc -triple i386-apple-darwin9 -mcpu=pentium4 -g -emit-llvm -o - %s | FileCheck -check-prefix=CHECK2 %s
+// CHECK1: define
+// CHECK2: define
 
-#include <mmintrin.h>
-#include <stdio.h>
+typedef union __m64
+{
+    unsigned long long  m64_u64;
+    float               m64_f32[2];
+    char                m64_i8[8];
+    short               m64_i16[4];
+    int                 m64_i32[2];    
+    long long           m64_i64;
+    unsigned char       m64_u8[8];
+    unsigned short      m64_u16[4];
+    unsigned int        m64_u32[2];
+} __m64;
 
+__m64 _mm_setzero_si64(void);
+__m64 _mm_add_pi32(__m64 _MM1, __m64 _MM2);
+__m64 _mm_unpackhi_pi32(__m64 _MM1, __m64 _MM2);
+int   _mm_cvtsi64_si32(__m64 _M);
+int printf(const char * _Format, ...);
+
 int main(int argc, char *argv[]) {
   int array[16] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
   __m64 *p = (__m64 *)array;
Index: test/CodeGen/address-space-field4.c
===================================================================
--- test/CodeGen/address-space-field4.c	(revision 83183)
+++ test/CodeGen/address-space-field4.c	(working copy)
@@ -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.
