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/resolve-loc.c b/test/Index/resolve-loc.c
index a27fca7..6da59f0 100644
--- a/test/Index/resolve-loc.c
+++ b/test/Index/resolve-loc.c
@@ -24,11 +24,16 @@
 // RUN: index-test %t.ast -point-at %s:7:23 | grep param2 &&
 // RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1 &&
 // RUN: index-test %t.ast -point-at %s:9:15 | grep for_var &&
-// RUN: index-test %t.ast -point-at %s:9:43 | grep top_func_def &&
-// RUN: index-test %t.ast -point-at %s:9:43 | grep '++for_var' &&
+
+// RUN: index-test %t.ast -point-at %s:9:43 > %t &&
+// RUN: grep top_func_def %s &&
+// RUN: grep '++for_var' %s &&
+
 // RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2 &&
-// RUN: index-test %t.ast -point-at %s:10:30 | grep local_var2 &&
-// RUN: index-test %t.ast -point-at %s:10:30 | grep 'for_var + 1' &&
+
+// RUN: index-test %t.ast -point-at %s:10:30 > %t &&
+// RUN: grep local_var2 %t &&
+// RUN: grep 'for_var + 1' %t &&
 
 // fields test.
 // RUN: index-test %t.ast -point-at %s:15:10 | grep field_var