Assemble all sources files in each test
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 17 Sep 2012 19:51:25 +0000 (19:51 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 17 Sep 2012 19:51:25 +0000 (19:51 +0000)
* 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.

ld/testsuite/ChangeLog
ld/testsuite/ld-elf/shared.exp
ld/testsuite/lib/ld-lib.exp

index 839da5b34c661751f5fa40dd12583bd99d1e0b34..c969379bdbd3ca928fd82725f02b90efda1c3e1c 100644 (file)
@@ -1,3 +1,11 @@
+2012-09-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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.
+
 2012-09-12  Chris Schlumberger-Socha  <chris.schlumberger-socha@arm.com>
 
        * ld-aarch64/aarch64-elf.exp: New reloc tests.
index c00f3e588a1d04df88f8f67658e28e591cdf4b3d..c9f20560e8fa13fcdbf23cbbe44fc831ad4e5e64 100644 (file)
@@ -336,14 +336,14 @@ set build_cxx_tests {
    {del.cc new.cc} {} "libnew1b.so" "c++"}
 }
 
-set run_cxx_tests {
-    {"Run with libdl3a.so"
-     "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
-     {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
 # "-shared -Bsymbolic" only works with gcc 4.5.0 and newer.
 #    {"Run with libdl3b.so"
 #     "tmpdir/libdl3b.so" ""
 #     {dl3main.cc} "dl3b" "dl3b.out" "" "c++"}
+set run_cxx_tests {
+    {"Run with libdl3a.so"
+     "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
+     {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
     {"Run with libdl3c.so"
      "-Wl,--no-as-needed tmpdir/libdl3c.so" ""
      {dl3main.cc} "dl3c" "dl3a.out" "" "c++"}
index bb4cb0da500ee13163a6f4c3cb3c1cdcb02a1227..49837dd4b17fb7245213c14324fd4f4680685d26 100644 (file)
@@ -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
        }
     }
 }