* 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-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>
* ld-elf/orphan-region.d, ld-elf/orphan-region.ld,
--- /dev/null
+#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?.*
+#...
--- /dev/null
+.section .zzz,"ax",%progbits
+.long 0
+.text
+.long 0
--- /dev/null
+.section .zzz,"ax",%progbits
+.long 0
+.text
+.long 0
set end_2 0
set differences 0
set diff_pass 0
+ set fail_if_match 0
if [file exists $file_1] then {
set file_a [open $file_1 r]
set end_2 1
set diff_pass 1
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 ] {
if { [gets $file_b line_b] == $eof } {
set end_2 1
set differences 1
}
+ if { $fail_if_match } {
+ if { $differences == 0 } {
+ set differences 1
+ } else {
+ set differences 0
+ }
+ }
+
close $file_a
close $file_b