Fix bug in regression tests that ignored stderr output in RUN lines. Updated tests...
[oota-llvm.git] / test / lib / llvm.exp
index 921bcb5ddd7f906f4fac3d1b1867ab1c1c02953a..05c910771ad16ba5b3849178d9ed9d76294c1a93 100644 (file)
@@ -104,7 +104,10 @@ proc RunLLVMTests { test_source_files } {
     set filename [file tail $test]
     set outcome PASS
     set tmpFile "$filename.tmp"
-
+    
+    # Mark that it should not be XFAIL for this target.
+    set targetPASS 0
+    
     #set hasRunline bool to check if testcase has a runline
     set numLines 0
 
@@ -123,8 +126,8 @@ proc RunLLVMTests { test_source_files } {
         set runline "$runline$oneline "
 
       # if its a terminating RUN: line then do substitution on the whole line
-      # and then save the line.
-      } elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} {
+      # and then save the line. 
+      } elseif {[regexp {RUN: *(.+)$} $line match oneline suffix]} {
         set runline "$runline$oneline"
         set runline [ substitute $runline $test $tmpFile ]
         set lines($numLines) $runline
@@ -145,12 +148,36 @@ proc RunLLVMTests { test_source_files } {
         #split up target if more then 1 specified
         foreach target [split $targets ,] {
           if { [regexp {\*} $target match] } {
-              set outcome XFAIL
+              if {$targetPASS != 1} {
+                 set outcome XFAIL
+              }
+          } elseif { [regexp $target $target_triplet match] } {
+              if {$targetPASS != 1} {
+                 set outcome XFAIL
+              }
+          } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2]  } {
+            if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
+              if {$targetPASS != 1} {
+                 set outcome XFAIL
+              }
+            }
+          }
+        }
+      } elseif {[regexp {XTARGET:[ *](.+)} $line match targets]} {
+        set targets
+
+        #split up target if more then 1 specified
+        foreach target [split $targets ,] {
+          if { [regexp {\*} $target match] } {
+              set targetPASS 1
+              set outcome PASS
           } elseif { [regexp $target $target_triplet match] } {
-              set outcome XFAIL
+              set targetPASS 1
+              set outcome PASS
           } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2]  } {
             if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
-              set outcome XFAIL
+              set targetPASS 1
+              set outcome PASS
             }
           }
         }