MultiTestRunner: Validate '&&' at the end of RUN lines.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 25 Jul 2009 11:27:37 +0000 (11:27 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 25 Jul 2009 11:27:37 +0000 (11:27 +0000)
 - This is just to normalize, these will go away soon hopefully.

Added all the missing '&&'s that have crept in. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77062 91177308-0d34-0410-b5e6-96231b3b80d8

26 files changed:
test/CodeGen/2008-07-17-no-emit-on-error.c
test/CodeGen/address-space-field4.c
test/CodeGen/asm.c
test/CodeGen/attributes.c
test/CodeGen/blocks-2.c
test/CodeGen/builtins-ffs_parity_popcount.c
test/CodeGen/builtins-powi.c
test/CodeGen/darwin-string-literals.c
test/CodeGen/ext-vector-shuffle.c
test/CodeGen/stdcall-fastcall.c
test/CodeGen/struct-x86-darwin.c
test/CodeGen/visibility.c
test/CodeGen/x86.c
test/CodeGenObjC/debug-info-linkagename.m
test/CodeGenObjC/messages.m
test/CodeGenObjC/property-setter-attr.m
test/Driver/clang-translation.c
test/Driver/default-toolchain.c
test/Driver/redzone.c
test/Frontend/stdin.c
test/Index/find-refs.c
test/Lexer/dollar-idents.c
test/Preprocessor/macro-multiline.c
test/Preprocessor/macro_fn_comma_swallow.c
test/Preprocessor/macro_paste_mscomment.c
utils/test/TestRunner.py

index 89aeb18d9d135d955f33c33ceee64e4d0c5a22bb..51ba2b45d0637c9b942632996cee9559e672a0cb 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: rm -f %t1.bc 
-// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc
+// RUN: rm -f %t1.bc &&
+// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc &&
 // RUN: not test -f %t1.bc
 
 void f() {
index d258f614e6448948c7603b259667866a8fc0cd51..2c74353c3ad86778277b0abcd2440fc52ba168c7 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: clang-cc -emit-llvm < %s -o %t &&
-// RUN: grep addrspace\(2\) %t | count 4
+// RUN: grep addrspace\(2\) %t | count 4 &&
 // RUN: grep addrspace\(3\) %t | count 4
 
 // Check the load and store are using the correct address space to access
index 58373fc4c96e7015b7c984680950510059705321..f400e9347a02b642d84504c70a27cca833a1361b 100644 (file)
@@ -33,7 +33,7 @@ void t7(int a) {
   __asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
 }
 
-// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t
+// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t &&
 void t8() {
   __asm__ volatile("T8 NAMED MODIFIER: %c[input]" :: [input] "i" (4));
 }
index 00252b113582966437ac012fa246888ada0a31c4..7191f98c414fc6e58ab7e04df3f4ce22adf20850 100644 (file)
@@ -12,7 +12,7 @@
 // RUN: grep '@t11().*section "SECT"' %t &&
 // RUN: grep '@t12 =.*section "SECT"' %t &&
 // RUN: grep '@t13 =.*section "SECT"' %t &&
-// RUN: grep '@t14.x =.*section "SECT"' %t
+// RUN: grep '@t14.x =.*section "SECT"' %t &&
 // RUN: grep 'declare extern_weak i32 @t15()' %t &&
 // RUN: grep '@t16 = extern_weak global i32' %t &&
 
index 5ee2a73a82c9c951afa9d0d409a54fd4cd1d076c..d3ccda6d9999c19f897c8c2e4e4cb75c8d50b8a2 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks 
+// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks &&
 // RUN: grep "func.start" %t | count 4
 // 1 declaration, 1 bar, 1 test_block_dbg and 1 for the block.
 
index 47469985eeda440d85e5321cd833d67fbfade228..e3fa4d2d82125f166902adbc7d4b25615e27b6ea 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t
-// RUN: ! grep "__builtin" %t
+// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: not grep "__builtin" %t
 
 #include <stdio.h>
 
index 73f752f5e80e7d08490c8a3730e959790bd21821..5b413a889502e4dae68e9244b48c1062c893e78c 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t
-// RUN: ! grep "__builtin" %t
+// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: not grep "__builtin" %t
 
 #include <stdio.h>
 #include <stdlib.h>
index 2f94d557ca898654ee458401a3a06d82555f0a55..2444a155b3a2357f565c09698aa8fd1dcb78a1f4 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s &&
 
 // CHECK-LSB: @.str = private constant [8 x i8] c"string0\00"
 // CHECK-LSB: @.str1 = private constant [8 x i8] c"string1\00", section "__TEXT,__cstring,cstring_literals"
index 37d3ed42d060143eb9b3c3e4950f65eb2b6575d9..f53db945da03fccaf64259f3158f96ce33be14ce 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement'
-// RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement'
+// RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement' &&
+// RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement' &&
 // RUN: clang-cc %s -emit-llvm -o - | grep 'shufflevector'
 
 typedef __attribute__(( ext_vector_type(2) )) float float2;
index 11b652178ca8536cb1dde582f6218a43f5bfba0a..89ed8c9ef6729454272ccb8c26515c0db59af92d 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4
+// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4 &&
 // RUN: clang-cc -emit-llvm < %s | grep 'stdcallcc' | count 4
 
 void __attribute__((fastcall)) f1(void);
index 050e26dcab9e9847d1d8552af7e4e37c8b5d88f2..46dcb0c826cf96c0b36160ac625defabf46a2960 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9
+// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9 &&
 // Run  grep "STest1 = type <{ i32, \[4 x i16\], double }>" %t1 &&
 // RUN: grep "STest2 = type <{ i16, i16, i32, i32 }>" %t1 &&
 // RUN: grep "STest3 = type <{ i8, i8, i16, i32 }>" %t1 &&
index bb9b6e0d50ce11e798d3f1f30d8dfedf66c4f5b3..958eb618ee70d1cc34664e97f7f391f6a4b9f383 100644 (file)
@@ -15,7 +15,7 @@
 // RUN: grep 'define internal void @f_deferred()' %t &&
 // RUN: grep 'define protected i32 @f_def()' %t &&
 // RUN: clang-cc -triple i386-unknown-unknown -fvisibility=hidden -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common hidden global i32 0' %t &&a
+// RUN: grep '@g_com = common hidden global i32 0' %t &&
 // RUN: grep '@g_def = hidden global i32 0' %t &&
 // RUN: grep '@g_ext = external global i32' %t &&
 // RUN: grep '@g_deferred = internal global' %t &&
index 66d82513795bd87e9319e349f44967f47ced2f7a..be0930237c82a37ba835503de0e668bef783b0c3 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1
+// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1 &&
 // RUN: grep "ax" %t1 &&
 // RUN: grep "bx" %t1 &&
 // RUN: grep "cx" %t1 &&
index bda98eec49b5fdb5f54ea2a829fd82588cf5a5b3..730568954cb0c524173b9ac3e86b897ac59fc67f 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc  -g -S -o %t %s
+// RUN: clang-cc  -g -S -o %t %s &&
 // RUN: not grep 001 %t
 
 @interface F 
index f9b9be6e11a38321672b1485b27dcb3616e271d8..3a0c4ef26d1e13f81759dc871cc86ee78f14a693 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: clang-cc -fgnu-runtime --emit-llvm -o %t %s &&
 // RUN: grep "objc_msg_lookup" %t | count 6 &&
 // RUN: clang-cc -fgnu-runtime -fobjc-sender-dependent-dispatch --emit-llvm -o %t %s &&
-// RUN: grep "objc_msg_lookup_sender" %t | count 6
+// RUN: grep "objc_msg_lookup_sender" %t | count 6 &&
 // RUN: true
 
 typedef struct {
index 390392415d730dab06da49b573dd6e6eb9b1e003..5f0edf8271e7cb055b6cb2e07698d87e4f363eda 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s
+// RUN: clang-cc -emit-llvm -triple=i686-apple-darwin8 -o %t %s &&
 // RUN: grep -e "SiSetOtherThings:" %t
 
 @interface A 
index 0a1ef59b13795162be4137ebddaee792d2ccb6d1..e0b9e3ada6ecb98312ced267e64693738e1274ab 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm 2> %t.log
+// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm 2> %t.log &&
 // RUN: grep '"-triple" "i386-unknown-unknown"' %t.log &&
 // RUN: grep '"-S"' %t.log &&
 // RUN: grep '"-disable-free"' %t.log &&
@@ -9,8 +9,8 @@
 // RUN: grep '"-Os"' %t.log &&
 // RUN: grep '"-o" .*clang-translation.*' %t.log &&
 // RUN: grep '"--asm-verbose"' %t.log &&
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log &&
 // RUN: grep '"--mcpu=yonah"' %t.log &&
-// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log &&
 // RUN: grep '"--mcpu=core2"' %t.log &&
 // RUN: true
index 216394fe97d9bc7dfed0baed19e5263bc2b21dcb..0e8a02679e8de81e3fdf8100e7fbb99b19f35bdd 100644 (file)
@@ -1,8 +1,8 @@
-// RUN: clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t
+// RUN: clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t &&
 // RUN: grep 'Target: x86_64-unknown-unknown' %t &&
 
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t &&
 // RUN: grep 'Target: powerpc64-apple-darwin9' %t &&
 
-// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t &&
 // RUN: grep 'Target: powerpc-apple-darwin9' %t
index 8709e71fb3667a66e77493205fa742a0b17d974b..bc8a80fa960a4326a2559d0c16d742c9f1b7bca7 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: clang -mno-red-zone %s -S -emit-llvm -o %t.log &&
-// RUN: grep 'noredzone' %t.log 
+// RUN: grep 'noredzone' %t.log &&
 // RUN: clang -mred-zone %s -S -emit-llvm -o %t.log &&
 // RUN: grep -v 'noredzone' %t.log 
 
index 35fe45d35b405f526dff28df716f878e338a3261..5b719b2e1344f2b4553afec89c1a03c9785f13cc 100644 (file)
@@ -1,3 +1,3 @@
-// RUN: clang-cc -E - < /dev/null > %t
+// RUN: clang-cc -E - < /dev/null > %t &&
 // RUN: grep '<built-in>' %t
  
index 9212922ba6cc2ed9a22faf032ccc625dc8295c73..741f840d08172316d3ea7aba0d8ab2e363348b54 100644 (file)
@@ -38,7 +38,7 @@
 
 // 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
+// RUN: grep 't1.c:22:3,' %t &&
 
 // RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:7:11 -print-refs > %t &&
 // RUN: cat %t | count 2 &&
index 7635ea112eb70995f96cd3561e557ca80503f6c9..f5c33b1f4368b0e97e26f7cea801bf2f86ddec0d 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: clang-cc -dump-tokens %s 2> %t &&
-// RUN: grep "identifier '\$A'" %t
+// RUN: grep "identifier '\$A'" %t &&
 // RUN: clang-cc -dump-tokens -x assembler-with-cpp %s 2> %t &&
 // RUN: grep "identifier 'A'" %t
 // PR3808
index eb15668ce31f794717bef41da51acf43d24e16c5..ba988253b27232307a1525819aae2aed8985dbf0 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang -E %s "-DX=A
+// RUN: clang -E %s "-DX=A &&
 // RUN: THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" > %t &&
 // RUN: grep "GOOD: A" %t &&
 // RUN: not grep THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT %t
index e985138a5c44c27d8398e78937197400827061a2..d39d4e7841d5106c18abccdaa1a2a85b093045d9 100644 (file)
@@ -1,7 +1,7 @@
 // Test the GNU comma swallowing extension.
 // RUN: clang-cc %s -E | grep 'foo{A, }' && 
 // RUN: clang-cc %s -E | grep 'fo2{A,}' && 
-// RUN: clang-cc %s -E | grep '{foo}'
+// RUN: clang-cc %s -E | grep '{foo}' &&
 
 #define X(Y) foo{A, Y}
 X()
index b0fc57101c64cbf8225e21d785817149ff7f12f0..d6ead91068cfbc19acfac940b6c467b055a0ac8c 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: clang-cc -P -E -fms-extensions %s | sed '/^#.\+/d' | tr -d '\n' |
-// RUN:   grep '^int foo;int bar;int baz;$' | count 1
+// RUN: clang-cc -P -E -fms-extensions %s | sed '/^#.\+/d' | tr -d '\n' > %t &&
+// RUN: grep '^int foo;int bar;int baz;$' %t | count 1
 // This horrible stuff should preprocess into (other than whitespace):
 //   int foo;
 //   int bar;
index 246a22b43899707ab6be5d04b3b348c1240a02bd..5639a378e7bac4df728475d08f3573b7e54e87d7 100755 (executable)
@@ -122,23 +122,46 @@ def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC,
                      ('%t',TEMPOUTPUT),
                      (' clang ', ' ' + CLANG + ' '),
                      (' clang-cc ', ' ' + CLANGCC + ' ')]
+
+    # Collect the test lines from the script.
     scriptLines = []
     xfailLines = []
     for ln in open(scriptFile):
         if 'RUN:' in ln:
-            # Isolate run parameters
+            # Isolate the command to run.
             index = ln.index('RUN:')
             ln = ln[index+4:]
-
-            # Apply substitutions
-            for a,b in substitutions:
-                ln = ln.replace(a,b)
-
-            if useDGCompat:
-                ln = re.sub(r'\{(.*)\}', r'"\1"', ln)
-            scriptLines.append(ln)
+            
+            # Strip whitespace and append.
+            scriptLines.append(ln.strip())
         elif 'XFAIL' in ln:
             xfailLines.append(ln)
+        
+        # FIXME: Support something like END, in case we need to process large
+        # files.
+
+    # Validate interior lines for '&&', a lovely historical artifact.
+    for i in range(len(scriptLines) - 1):
+        ln = scriptLines[i]
+
+        if not ln.endswith('&&'):
+            print >>output, "MISSING \'&&\': %s" % ln
+            print >>output, "FOLLOWED BY   : %s" % scriptLines[i + 1]
+            return TestStatus.Fail
+    
+        # Strip off '&&'
+        scriptLines[i] = ln[:-2]
+    
+    # Apply substitutions to the script.
+    def processLine(ln):
+        # Apply substitutions
+        for a,b in substitutions:
+            ln = ln.replace(a,b)
+
+        if useDGCompat:
+            ln = re.sub(r'\{(.*)\}', r'"\1"', ln)
+        return ln
+    scriptLines = map(processLine, scriptLines)
     
     if xfailLines:
         print >>output, "XFAILED '%s':"%(TESTNAME,)
@@ -146,7 +169,7 @@ def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC,
 
     # Write script file
     f = open(SCRIPT,'w')
-    f.write(''.join(scriptLines))
+    f.write(' &&\n'.join(scriptLines))
     f.close()
 
     outputFile = open(OUTPUT,'w')