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-refs.c b/test/Index/find-refs.c
index 7f00bcf..5212c24 100644
--- a/test/Index/find-refs.c
+++ b/test/Index/find-refs.c
@@ -1,25 +1,41 @@
// 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/foo.h:1:14 -print-refs | count 3 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs | grep 't1.c:4:19,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs | grep 't2.c:6:3,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs | grep 't2.c:7:12,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-refs | grep 't2.c:7:3,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-refs | grep 't1.c:8:3,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:3:22 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:3:22 -print-refs | grep 't1.c:6:17,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:4:11 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:4:11 -print-refs | grep 't1.c:6:5,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs | count 3 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs | grep 't1.c:5:27,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs | grep 't1.c:5:44,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs | grep 't1.c:6:26,' &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs > %t &&
+// RUN: cat %t | count 3 &&
+// RUN: grep 't1.c:4:19,' %t &&
+// RUN: grep 't2.c:6:3,' %t &&
+// RUN: grep 't2.c:7:12,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't2.c:7:3,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:8:3,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:3:22 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:6:17,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:4:11 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:6:5,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs > %t &&
+// RUN: cat %t | count 3 &&
+// RUN: grep 't1.c:5:27,' %t &&
+// RUN: grep 't1.c:5:44,' %t &&
+// RUN: grep 't1.c:6:26,' %t &&
// field test
+
// FIXME: References point at the start of MemberExpr, make them point at the field instead.
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:12:7 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:12:7 -print-refs | grep 't1.c:21:3,' &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs | count 1 &&
-// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs | grep 't1.c:22:3,'
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:12:7 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:21:3,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:22:3,' %t