PR ld/11304
* ld-elf/pr11304.d: New test. * ld-elf/pr11304a.s: New test. * ld-elf/pr11304b.s: New test. * lib/ld-lib.exp (regexp_diff): Add support for #failif.
This commit is contained in:
parent
0f020cefaa
commit
bb6be443ae
5 changed files with 40 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2010-03-19 Jie Zhang <jie@codesourcery.com>
|
||||||
|
|
||||||
|
PR ld/11304
|
||||||
|
* ld-elf/pr11304.d: New test.
|
||||||
|
* ld-elf/pr11304a.s: New test.
|
||||||
|
* ld-elf/pr11304b.s: New test.
|
||||||
|
* lib/ld-lib.exp (regexp_diff): Add support for #failif.
|
||||||
|
|
||||||
2010-03-15 Daniel Jacobowitz <dan@codesourcery.com>
|
2010-03-15 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* ld-elf/orphan-region.d, ld-elf/orphan-region.ld,
|
* ld-elf/orphan-region.d, ld-elf/orphan-region.ld,
|
||||||
|
|
11
ld/testsuite/ld-elf/pr11304.d
Normal file
11
ld/testsuite/ld-elf/pr11304.d
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#source: pr11304a.s
|
||||||
|
#source: pr11304b.s
|
||||||
|
#ld: -e 0 --section-start .zzz=0x800000
|
||||||
|
#readelf: -S --wide
|
||||||
|
|
||||||
|
#failif
|
||||||
|
#...
|
||||||
|
\[[ 0-9]+\] \.zzz[ \t]+PROGBITS[ \t0-9a-f]+AX?.*
|
||||||
|
#...
|
||||||
|
\[[ 0-9]+\] \.zzz[ \t]+PROGBITS[ \t0-9a-f]+AX?.*
|
||||||
|
#...
|
4
ld/testsuite/ld-elf/pr11304a.s
Normal file
4
ld/testsuite/ld-elf/pr11304a.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.section .zzz,"ax",%progbits
|
||||||
|
.long 0
|
||||||
|
.text
|
||||||
|
.long 0
|
4
ld/testsuite/ld-elf/pr11304b.s
Normal file
4
ld/testsuite/ld-elf/pr11304b.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.section .zzz,"ax",%progbits
|
||||||
|
.long 0
|
||||||
|
.text
|
||||||
|
.long 0
|
|
@ -1039,6 +1039,7 @@ proc regexp_diff { file_1 file_2 } {
|
||||||
set end_2 0
|
set end_2 0
|
||||||
set differences 0
|
set differences 0
|
||||||
set diff_pass 0
|
set diff_pass 0
|
||||||
|
set fail_if_match 0
|
||||||
|
|
||||||
if [file exists $file_1] then {
|
if [file exists $file_1] then {
|
||||||
set file_a [open $file_1 r]
|
set file_a [open $file_1 r]
|
||||||
|
@ -1071,6 +1072,10 @@ proc regexp_diff { file_1 file_2 } {
|
||||||
set end_2 1
|
set end_2 1
|
||||||
set diff_pass 1
|
set diff_pass 1
|
||||||
break
|
break
|
||||||
|
} elseif [ string match "#failif" $line_b ] {
|
||||||
|
send_log "fail if no difference\n"
|
||||||
|
verbose "fail if no difference" 3
|
||||||
|
set fail_if_match 1
|
||||||
} elseif [ string match "#..." $line_b ] {
|
} elseif [ string match "#..." $line_b ] {
|
||||||
if { [gets $file_b line_b] == $eof } {
|
if { [gets $file_b line_b] == $eof } {
|
||||||
set end_2 1
|
set end_2 1
|
||||||
|
@ -1123,6 +1128,14 @@ proc regexp_diff { file_1 file_2 } {
|
||||||
set differences 1
|
set differences 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { $fail_if_match } {
|
||||||
|
if { $differences == 0 } {
|
||||||
|
set differences 1
|
||||||
|
} else {
|
||||||
|
set differences 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
close $file_a
|
close $file_a
|
||||||
close $file_b
|
close $file_b
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue