1. No need to thwart this test with an environment variable. Turning it off

is the default and handled by the makefile system and runtest
2. Redirect stderr of llvm-as and llvm2cpp so that warning messages about
   instrinsics don't cause Tcl to report the run as failed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-05-30 23:07:17 +00:00
parent a0eaf2d0c5
commit 226368ff4e

View File

@@ -6,7 +6,6 @@
# the original input to llvm2cpp. # the original input to llvm2cpp.
proc llvm2cpp-test { files } { proc llvm2cpp-test { files } {
# if { $env(LLVM_RUNLLVM2CPP_TEST) == 1 } {
global subdir llvmtoolsdir llvmlibsdir objdir srcdir objroot srcroot global subdir llvmtoolsdir llvmlibsdir objdir srcdir objroot srcroot
set timeout 30 set timeout 30
set path [file join $objdir $subdir] set path [file join $objdir $subdir]
@@ -32,9 +31,14 @@ proc llvm2cpp-test { files } {
set output [file join Output $filename.gen] set output [file join Output $filename.gen]
set assembly [file join Output $filename.asm] set assembly [file join Output $filename.asm]
set testname [file rootname $filename] set testname [file rootname $filename]
set bytecode [file join Output $filename.bc]
# Note that the stderr for llvm-as must be redirected to /dev/null because
# otherwise exec will see the msgs and return 1 even though they are only
# warnings. If real errors are generated on stderr then llvm-as will return
# a non-zero retval anyway so we're good.
set retval [ catch { set retval [ catch {
exec -keepnewline $llvmas $test -o - | $llvmdis -f -o $assembly } msg ] exec -keepnewline $llvmas $test -o - | $llvmdis -f -o $assembly 2>/dev/null } msg ]
if { $retval != 0 } { if { $retval != 0 } {
fail "$test: llvm-as/llvm-dis returned $retval\n$msg" fail "$test: llvm-as/llvm-dis returned $retval\n$msg"
@@ -42,7 +46,7 @@ proc llvm2cpp-test { files } {
} }
set retval [ catch { set retval [ catch {
exec -keepnewline $llvm2cpp -f -o $generated < $test } msg] exec -keepnewline $llvm2cpp -f -o $generated < $test 2>/dev/null } msg]
if { $retval != 0 } { if { $retval != 0 } {
fail "$test: llvm2cpp returned $retval\n$msg" fail "$test: llvm2cpp returned $retval\n$msg"
@@ -72,7 +76,6 @@ proc llvm2cpp-test { files } {
} }
pass "$test" pass "$test"
} }
# }
} }