aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils-2.23.1/backport/0003-Assemble-all-sources-files-in-each-test.patch
blob: be0888590a6c9c6523a1536e8c7243039512c1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
From 80b672d804357f2a1be04ac4e5a4d4c7d0d3b348 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 14 Nov 2012 15:54:04 +0000
Subject: [PATCH 03/27] 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.
---
 ld/testsuite/ChangeLog         |    8 ++++
 ld/testsuite/ld-elf/shared.exp |    8 ++--
 ld/testsuite/lib/ld-lib.exp    |   97 ++++++++++++++++++++--------------------
 3 files changed, 60 insertions(+), 53 deletions(-)

diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index ffcfa7e..e02432f 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-14  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-10-16  Sofiane Naci  <sofiane.naci@arm.com>
 
 	* ld-aarch64/tlsle-symbol-offset.s: New file.
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index c00f3e5..c9f2056 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -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++"}
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
 	}
     }
 }
-- 
1.7.9.5