1 From 80b672d804357f2a1be04ac4e5a4d4c7d0d3b348 Mon Sep 17 00:00:00 2001
2 From: "H.J. Lu" <hjl.tools@gmail.com>
3 Date: Wed, 14 Nov 2012 15:54:04 +0000
4 Subject: [PATCH 03/27] Assemble all sources files in each test
6 * ld-elf/shared.exp (build_cxx_tests): Move out the commented out
9 * lib/ld-lib.exp (run_ld_link_exec_tests): Assemble all sources
12 ld/testsuite/ChangeLog | 8 ++++
13 ld/testsuite/ld-elf/shared.exp | 8 ++--
14 ld/testsuite/lib/ld-lib.exp | 97 ++++++++++++++++++++--------------------
15 3 files changed, 60 insertions(+), 53 deletions(-)
17 diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
18 index ffcfa7e..e02432f 100644
19 --- a/ld/testsuite/ChangeLog
20 +++ b/ld/testsuite/ChangeLog
22 +2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
24 + * ld-elf/shared.exp (build_cxx_tests): Move out the commented out
27 + * lib/ld-lib.exp (run_ld_link_exec_tests): Assemble all sources
30 2012-10-16 Sofiane Naci <sofiane.naci@arm.com>
32 * ld-aarch64/tlsle-symbol-offset.s: New file.
33 diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
34 index c00f3e5..c9f2056 100644
35 --- a/ld/testsuite/ld-elf/shared.exp
36 +++ b/ld/testsuite/ld-elf/shared.exp
37 @@ -336,14 +336,14 @@ set build_cxx_tests {
38 {del.cc new.cc} {} "libnew1b.so" "c++"}
42 - {"Run with libdl3a.so"
43 - "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
44 - {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
45 # "-shared -Bsymbolic" only works with gcc 4.5.0 and newer.
46 # {"Run with libdl3b.so"
47 # "tmpdir/libdl3b.so" ""
48 # {dl3main.cc} "dl3b" "dl3b.out" "" "c++"}
50 + {"Run with libdl3a.so"
51 + "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
52 + {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
53 {"Run with libdl3c.so"
54 "-Wl,--no-as-needed tmpdir/libdl3c.so" ""
55 {dl3main.cc} "dl3c" "dl3a.out" "" "c++"}
56 diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
57 index bb4cb0d..49837dd 100644
58 --- a/ld/testsuite/lib/ld-lib.exp
59 +++ b/ld/testsuite/lib/ld-lib.exp
60 @@ -1244,7 +1244,6 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
61 # verbose -log "ld_options is $ld_options"
62 # verbose -log "as_options is $as_options"
63 # verbose -log "src_files is $src_files"
64 -# verbose -log "actions is $actions"
65 # verbose -log "binfile is $binfile"
67 # Assemble each file in the test.
68 @@ -1261,68 +1260,68 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
70 ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
74 - # We have to use $CC to build PIE and shared library.
75 - if { [ string match "c" $lang ] } {
76 - set link_proc ld_simple_link
78 - } elseif { [ string match "c++" $lang ] } {
79 - set link_proc ld_simple_link
81 - } elseif { [ string match "-shared" $ld_options ] \
82 - || [ string match "-pie" $ld_options ] } {
83 - set link_proc ld_simple_link
86 - set link_proc ld_link
89 + # We have to use $CC to build PIE and shared library.
90 + if { [ string match "c" $lang ] } {
91 + set link_proc ld_simple_link
93 + } elseif { [ string match "c++" $lang ] } {
94 + set link_proc ld_simple_link
96 + } elseif { [ string match "-shared" $ld_options ] \
97 + || [ string match "-pie" $ld_options ] } {
98 + set link_proc ld_simple_link
101 + set link_proc ld_link
105 - if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] {
108 + if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] {
114 + # Check if exec_output is expected.
115 + if { $warning != "" } then {
116 + verbose -log "returned with: <$exec_output>, expected: <$warning>"
117 + if { [regexp $warning $exec_output] } then {
124 - # Check if exec_output is expected.
125 - if { $warning != "" } then {
126 - verbose -log "returned with: <$exec_output>, expected: <$warning>"
127 - if { [regexp $warning $exec_output] } then {
133 + if { $failed == 0 } {
134 + send_log "Running: $binfile > $binfile.out\n"
135 + verbose "Running: $binfile > $binfile.out"
136 + catch "exec $binfile > $binfile.out" exec_output
138 - if { $failed == 0 } {
139 - send_log "Running: $binfile > $binfile.out\n"
140 - verbose "Running: $binfile > $binfile.out"
141 - catch "exec $binfile > $binfile.out" exec_output
142 + if ![string match "" $exec_output] then {
143 + send_log "$exec_output\n"
144 + verbose "$exec_output" 1
147 + send_log "diff $binfile.out $srcdir/$subdir/$expfile\n"
148 + verbose "diff $binfile.out $srcdir/$subdir/$expfile"
149 + catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output
150 + set exec_output [prune_warnings $exec_output]
152 if ![string match "" $exec_output] then {
153 send_log "$exec_output\n"
154 verbose "$exec_output" 1
157 - send_log "diff $binfile.out $srcdir/$subdir/$expfile\n"
158 - verbose "diff $binfile.out $srcdir/$subdir/$expfile"
159 - catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output
160 - set exec_output [prune_warnings $exec_output]
162 - if ![string match "" $exec_output] then {
163 - send_log "$exec_output\n"
164 - verbose "$exec_output" 1
171 - if { $failed != 0 } {
177 + if { $failed != 0 } {