Index: test/Lexer/11-27-2007-FloatLiterals.c
===================================================================
--- test/Lexer/11-27-2007-FloatLiterals.c	(revision 83936)
+++ test/Lexer/11-27-2007-FloatLiterals.c	(working copy)
@@ -1,6 +1,12 @@
-// RUN: clang-cc %s -emit-llvm -o - | grep 0x3BFD83C940000000 | count 2 &&
-// RUN: clang-cc %s -emit-llvm -o - | grep 2.000000e+32 | count 2
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck -check-prefix CHECK1 %s &&
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck -check-prefix CHECK2 %s
 
+// CHECK1: 0x3BFD83C940000000
+// CHECK1: 0x3BFD83C940000000
+
+// CHECK2: 2.000000e+{{[0]*}}32
+// CHECK2: 2.000000e+{{[0]*}}32
+
 float  F  = 1e-19f;
 double D  = 2e32;
 float  F2 = 01e-19f;
Index: test/Driver/openbsd.c
===================================================================
--- test/Driver/openbsd.c	(revision 83936)
+++ test/Driver/openbsd.c	(working copy)
@@ -1,6 +1,6 @@
 // RUN: clang -ccc-clang-archs "" -ccc-host-triple i686-pc-openbsd %s -### 2> %t.log &&
-// RUN: grep 'clang-cc" "-triple" "i686-pc-openbsd"' %t.log &&
-// RUN: grep 'as" "-o" ".*\.o" ".*\.s' %t.log &&
-// RUN: grep 'ld" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" ".*ld.so" "-o" "a\.out" ".*crt0.o" ".*crtbegin.o" ".*\.o" "-lgcc" "-lc" "-lgcc" ".*crtend.o"' %t.log &&
-// RUN: true
+// RUN: FileCheck -input-file %t.log %s
 
+// CHECK: clang-cc{{.*}}" "-triple" "i686-pc-openbsd"
+// CHECK: as{{.*}}" "-o" "{{.*}}.o" "{{.*}}.s
+// CHECK: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
Index: test/Driver/pth.c
===================================================================
--- test/Driver/pth.c	(revision 83936)
+++ test/Driver/pth.c	(working copy)
@@ -1,8 +1,12 @@
 // Test transparent PTH support.
 
 // RUN: clang -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log &&
-// RUN: grep '".*/clang-cc" .* "-o" ".*\.h\.pth" "-x" "c-header" ".*pth\.c"' %t.log &&
+// RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s &&
 
+// CHECK1: "{{.*}}/clang-cc{{.*}}" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c"
+
 // RUN: touch %t.h.pth &&
 // RUN: clang -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log &&
-// RUN: grep '".*/clang-cc" .*"-include-pth" ".*\.h\.pth" .*"-x" "c" ".*pth\.c"' %t.log
+// RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s
+
+// CHECK2: "{{.*}}/clang-cc{{.*}}" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c"
Index: test/Driver/freebsd.c
===================================================================
--- test/Driver/freebsd.c	(revision 83936)
+++ test/Driver/freebsd.c	(working copy)
@@ -1,7 +1,7 @@
 // RUN: clang -ccc-clang-archs "" -ccc-host-triple powerpc64-pc-freebsd8 %s -### 2> %t.log &&
 // RUN: cat %t.log &&
-// RUN: grep 'clang-cc" "-triple" "powerpc64-pc-freebsd8"' %t.log &&
-// RUN: grep 'as" "-o" ".*\.o" ".*\.s' %t.log &&
-// RUN: grep 'ld" "--eh-frame-hdr" "-dynamic-linker" ".*ld-elf.*" "-o" "a\.out" ".*crt1.o" ".*crti.o" ".*crtbegin.o" ".*\.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" ".*crtend.o" ".*crtn.o"' %t.log &&
-// RUN: true
+// RUN: FileCheck -input-file %t.log %s
 
+// CHECK: clang-cc{{.*}}" "-triple" "powerpc64-pc-freebsd8"
+// CHECK: as{{.*}}" "-o" "{{.*}}.o" "{{.*}}.s
+// CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
Index: test/Driver/dragonfly.c
===================================================================
--- test/Driver/dragonfly.c	(revision 83936)
+++ test/Driver/dragonfly.c	(working copy)
@@ -1,6 +1,8 @@
 // RUN: clang -ccc-host-triple amd64-pc-dragonfly %s -### 2> %t.log &&
-// RUN: grep 'clang-cc" "-triple" "amd64-pc-dragonfly"' %t.log &&
-// RUN: grep 'as" "-o" ".*\.o" ".*\.s' %t.log &&
-// RUN: grep 'ld" "-dynamic-linker" ".*ld-elf.*" "-o" "a\.out" ".*crt1.o" ".*crti.o" ".*crtbegin.o" ".*\.o" "-L.*/gcc.*" .* "-lc" "-lgcc" ".*crtend.o" ".*crtn.o"' %t.log &&
-// RUN: true
+// RUN: FileCheck -input-file %t.log %s
 
+// CHECK: clang-cc{{.*}}" "-triple" "amd64-pc-dragonfly"
+// CHECK: as{{.*}}" "-o" "{{.*}}.o" "{{.*}}.s
+// CHECK: ld{{.*}}" "-dynamic-linker" "{{.*}}ld-elf.{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}/gcc{{.*}}" {{.*}} "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"
+
+
Index: test/CodeGen/builtins-powi.c
===================================================================
--- test/CodeGen/builtins-powi.c	(revision 83936)
+++ test/CodeGen/builtins-powi.c	(working copy)
@@ -3,7 +3,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
 
 void test(long double a, int b) {
   printf("%Lf**%d: %08x %08x %016Lx\n", 
Index: test/CodeGen/const-init.c
===================================================================
--- test/CodeGen/const-init.c	(revision 83936)
+++ test/CodeGen/const-init.c	(working copy)
@@ -1,6 +1,6 @@
 // RUN: clang-cc -triple i386-pc-linux-gnu -verify -emit-llvm -o - %s | FileCheck %s
 
-#include <stdint.h>
+typedef __INTPTR_TYPE__          intptr_t;
 
 // Brace-enclosed string array initializers
 char a[] = { "asdf" };
Index: test/CodeGen/mandel.c
===================================================================
--- test/CodeGen/mandel.c	(revision 83936)
+++ test/CodeGen/mandel.c	(working copy)
@@ -25,8 +25,6 @@
 
 #define I 1.0iF
 
-#include <math.h>
-
 #include <stdio.h>
 
 volatile double __complex__ accum;
Index: test/CodeGen/builtins.c
===================================================================
--- test/CodeGen/builtins.c	(revision 83936)
+++ test/CodeGen/builtins.c	(working copy)
@@ -2,7 +2,6 @@
 // RUN: not grep __builtin %t
 
 #include <stdio.h>
-#include <math.h>
 
 void p(char *str, int x) {
   printf("%s: %d\n", str, x);
Index: lib/Frontend/InitHeaderSearch.cpp
===================================================================
--- lib/Frontend/InitHeaderSearch.cpp	(revision 83936)
+++ lib/Frontend/InitHeaderSearch.cpp	(working copy)
@@ -365,14 +365,13 @@
           break;
       }
     }
-
-    AddPath("/usr/local/include", System, false, false, false);
-
-    AddPath("/usr/include", System, false, false, false);
-    AddPath("/System/Library/Frameworks", System, true, false, true);
-    AddPath("/Library/Frameworks", System, true, false, true);
     break;
   }
+
+  AddPath("/usr/local/include", System, false, false, false);
+  AddPath("/usr/include", System, false, false, false);
+  AddPath("/System/Library/Frameworks", System, true, false, true);
+  AddPath("/Library/Frameworks", System, true, false, true);
 }
 
 void InitHeaderSearch::AddDefaultEnvVarPaths(const LangOptions &Lang) {
Index: lib/Headers/stdint.h
===================================================================
--- lib/Headers/stdint.h	(revision 83936)
+++ lib/Headers/stdint.h	(working copy)
@@ -28,7 +28,7 @@
 /* If we're hosted, fall back to the system's stdint.h, which might have
  * additional definitions.
  */
-#if __STDC_HOSTED__
+#if __STDC_HOSTED__ && !defined(_M_IX86) && !defined(_M_X64)
 # include_next <stdint.h>
 #else
 
