if { $PRS != ""} {
set PRS " for $PRS"
}
- set errmsg " at line $lineno$PRS\nwhile running: $line\n$errmsg"
+ set errmsg " at line $lineno\nwhile running: $line\n$errmsg"
switch "$code" {
CHILDSTATUS {
set status [lindex $::errorCode 2]
- if { $status ne 0 } {
- set resultmsg "$test: exit($status)$errmsg"
+ if { $status != 0 } {
+ set resultmsg "$test$PRS\nFailed with exit($status)$errmsg"
}
}
CHILDKILLED {
set signal [lindex $::errorCode 2]
- set resultmsg "$test: signal($signal)$errmsg"
+ set resultmsg "$test$PRS\nFailed with signal($signal)$errmsg"
}
CHILDSUSP {
set signal [lindex $::errorCode 2]
- set resultmsg "$test: suspend($signal)$errmsg"
+ set resultmsg "$test$PRS\nFailed with suspend($signal)$errmsg"
}
POSIX {
set posixNum [lindex $::errorCode 1]
set posixMsg [lindex $::errorCode 2]
- set resultmsg "$test: posix($posixNum,$posixMsg)$errmsg"
+ set resultmsg "$test$PRS\nFailed with posix($posixNum,$posixMsg)$errmsg"
}
NONE {
}
}
proc RunLLVMTests { test_source_files } {
- global srcroot objroot srcdir objdir subdir target_triplet
+ global srcroot objroot srcdir objdir subdir target_triplet llvmgcc_version
set timeout 60
set path [file join $objdir $subdir]
set testFileId [ open $test r]
set runline ""
set PRNUMS ""
- foreach line [split [read $testFileId 1024] \n] {
+ foreach line [split [read $testFileId] \n] {
# if its the END. line then stop parsing (optimization for big files)
if {[regexp {END.[ *]$} $line match endofscript]} {
break
- # if the line is continued, concatente and continue the loop
+ # if the line is continued, concatenate and continue the loop
} elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} {
set runline "$runline$oneline "
}
}
}
+
+proc llvm_gcc_supports_objc { } {
+ global llvmgcc
+ catch { set file_h [ open "/tmp/llvm_obj_check.m" w] }
+ set R [ catch { exec $llvmgcc -c "/tmp/llvm_obj_check.m" -o /dev/null >& /tmp/llvm_obj_check.out } ]
+ set RESULT [ file size "/tmp/llvm_obj_check.out" ]
+ catch { file delete "/tmp/llvm_obj_check.m" }
+ catch { file delete "/tmp/llvm_obj_check.out" }
+ if { $RESULT == 0 } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+proc llvm_gcc_supports_ada { } {
+ global llvmgcc
+ catch { set file_h [ open "/tmp/llvm_ada_check.adb" w] }
+ catch { puts $file_h "procedure llvm_ada_check is begin null; end;" }
+ catch { close $file_h }
+ set R [ catch { exec $llvmgcc -c -gnats "/tmp/llvm_ada_check.adb" >& /tmp/llvm_ada_check.out } ]
+ set RESULT [ file size "/tmp/llvm_ada_check.out" ]
+ catch { file delete "/tmp/llvm_ada_check.adb" }
+ catch { file delete "/tmp/llvm_ada_check.out" }
+ if { $RESULT == 0 } {
+ return 1
+ } else {
+ return 0
+ }
+}
+