Use temporary output to avoid running index-test with the same commands multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76513 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/find-decls.c b/test/Index/find-decls.c
index 1fb1a65..425c89d3 100644
--- a/test/Index/find-decls.c
+++ b/test/Index/find-decls.c
@@ -1,15 +1,25 @@
 // RUN: clang-cc -emit-pch %S/t1.c -o %t1.ast &&
 // RUN: clang-cc -emit-pch %S/t2.c -o %t2.ast &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-decls | count 3 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-decls | grep 'foo.h:4:6,' | count 2 && 
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-decls | grep 't2.c:5:6,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:47 -print-decls | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:47 -print-decls | grep 't1.c:5:12,' && 
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:6:20 -print-decls | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:6:20 -print-decls | grep 't1.c:3:19,' &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-decls > %t &&
+// RUN: cat %t | count 3 &&
+// RUN: grep 'foo.h:4:6,' %t | count 2 && 
+// RUN: grep 't2.c:5:6,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:47 -print-decls > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:5:12,' %t && 
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:6:20 -print-decls > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:3:19,' %t &&
 
 // field test
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:21:6 -print-decls | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:21:6 -print-decls | grep 't1.c:12:7,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:22:21 -print-decls | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:22:21 -print-decls | grep 't1.c:16:7,'
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:21:6 -print-decls > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:12:7,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:22:21 -print-decls > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:16:7,' %t