diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-09-17 19:51:25 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-09-17 19:51:25 +0000 |
commit | cb5ab6c82c2bd6e565e2dae74a77ae0c59834e14 (patch) | |
tree | a25477e3c946eca6405b2950c11bda9ea3d1ff56 /ld/testsuite/lib | |
parent | 6fb8dd83d6356dbb6b8a398a404c0f85fc055c93 (diff) | |
download | gdb-cb5ab6c82c2bd6e565e2dae74a77ae0c59834e14.zip gdb-cb5ab6c82c2bd6e565e2dae74a77ae0c59834e14.tar.gz gdb-cb5ab6c82c2bd6e565e2dae74a77ae0c59834e14.tar.bz2 |
Assemble all sources files in each test
* ld-elf/shared.exp (build_cxx_tests): Move out the commented out
test.
* lib/ld-lib.exp (run_ld_link_exec_tests): Assemble all sources
files in each test.
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r-- | ld/testsuite/lib/ld-lib.exp | 97 |
1 files changed, 48 insertions, 49 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index bb4cb0d..49837dd 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1244,7 +1244,6 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { # verbose -log "ld_options is $ld_options" # verbose -log "as_options is $as_options" # verbose -log "src_files is $src_files" -# verbose -log "actions is $actions" # verbose -log "binfile is $binfile" # Assemble each file in the test. @@ -1261,68 +1260,68 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } { } else { ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile } + } - # We have to use $CC to build PIE and shared library. - if { [ string match "c" $lang ] } { - set link_proc ld_simple_link - set link_cmd $CC - } elseif { [ string match "c++" $lang ] } { - set link_proc ld_simple_link - set link_cmd $CXX - } elseif { [ string match "-shared" $ld_options ] \ - || [ string match "-pie" $ld_options ] } { - set link_proc ld_simple_link - set link_cmd $CC - } else { - set link_proc ld_link - set link_cmd $ld - } + # We have to use $CC to build PIE and shared library. + if { [ string match "c" $lang ] } { + set link_proc ld_simple_link + set link_cmd $CC + } elseif { [ string match "c++" $lang ] } { + set link_proc ld_simple_link + set link_cmd $CXX + } elseif { [ string match "-shared" $ld_options ] \ + || [ string match "-pie" $ld_options ] } { + set link_proc ld_simple_link + set link_cmd $CC + } else { + set link_proc ld_link + set link_cmd $ld + } - if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] { - set failed 1 - } else { + if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] { + set failed 1 + } else { + set failed 0 + } + + # Check if exec_output is expected. + if { $warning != "" } then { + verbose -log "returned with: <$exec_output>, expected: <$warning>" + if { [regexp $warning $exec_output] } then { set failed 0 + } else { + set failed 1 } + } - # Check if exec_output is expected. - if { $warning != "" } then { - verbose -log "returned with: <$exec_output>, expected: <$warning>" - if { [regexp $warning $exec_output] } then { - set failed 0 - } else { - set failed 1 - } - } + if { $failed == 0 } { + send_log "Running: $binfile > $binfile.out\n" + verbose "Running: $binfile > $binfile.out" + catch "exec $binfile > $binfile.out" exec_output - if { $failed == 0 } { - send_log "Running: $binfile > $binfile.out\n" - verbose "Running: $binfile > $binfile.out" - catch "exec $binfile > $binfile.out" exec_output + if ![string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" 1 + set failed 1 + } else { + send_log "diff $binfile.out $srcdir/$subdir/$expfile\n" + verbose "diff $binfile.out $srcdir/$subdir/$expfile" + catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output + set exec_output [prune_warnings $exec_output] if ![string match "" $exec_output] then { send_log "$exec_output\n" verbose "$exec_output" 1 set failed 1 - } else { - send_log "diff $binfile.out $srcdir/$subdir/$expfile\n" - verbose "diff $binfile.out $srcdir/$subdir/$expfile" - catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output - set exec_output [prune_warnings $exec_output] - - if ![string match "" $exec_output] then { - send_log "$exec_output\n" - verbose "$exec_output" 1 - set failed 1 - } } } + } - if { $failed != 0 } { - fail $testname - } else { - set errcnt 0 - pass $testname - } + if { $failed != 0 } { + fail $testname + } else { + set errcnt 0 + pass $testname } } } |