From 8be965c5f058f79554ec3376afac994e6e3ad1b7 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 27 Apr 2017 17:53:28 +0100 Subject: ld: Find and run some tests using a wildcard pattern Find the ld-script/provide-*.d tests using a wildcard, then run them in a loop. This will make it easier to add more tests in the future. Some associated clean up is required. ld/ChangeLog: * testsuite/ld-scripts/provide-3.d: Add xfail directive. * testsuite/ld-scripts/provide-4.d: Use new map file name. * testsuite/ld-scripts/provide-5.d: Use new map file name. * testsuite/ld-scripts/provide-4-map.d: Renamed to... * testsuite/ld-scripts/provide-4.map: ...this. * testsuite/ld-scripts/provide-5-map.d: Renamed to... * testsuite/ld-scripts/provide-5.map: ...this. * testsuite/ld-scripts/provide.exp: Move xfail into provide-3.d file, and run tests in a loop. --- ld/ChangeLog | 12 ++++++++++++ ld/testsuite/ld-scripts/provide-3.d | 1 + ld/testsuite/ld-scripts/provide-4-map.d | 13 ------------- ld/testsuite/ld-scripts/provide-4.d | 2 +- ld/testsuite/ld-scripts/provide-4.map | 13 +++++++++++++ ld/testsuite/ld-scripts/provide-5-map.d | 6 ------ ld/testsuite/ld-scripts/provide-5.d | 2 +- ld/testsuite/ld-scripts/provide-5.map | 6 ++++++ ld/testsuite/ld-scripts/provide.exp | 12 ++++++------ 9 files changed, 40 insertions(+), 27 deletions(-) delete mode 100644 ld/testsuite/ld-scripts/provide-4-map.d create mode 100644 ld/testsuite/ld-scripts/provide-4.map delete mode 100644 ld/testsuite/ld-scripts/provide-5-map.d create mode 100644 ld/testsuite/ld-scripts/provide-5.map (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 1357b89..f96517e 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,17 @@ 2018-01-11 Andrew Burgess + * testsuite/ld-scripts/provide-3.d: Add xfail directive. + * testsuite/ld-scripts/provide-4.d: Use new map file name. + * testsuite/ld-scripts/provide-5.d: Use new map file name. + * testsuite/ld-scripts/provide-4-map.d: Renamed to... + * testsuite/ld-scripts/provide-4.map: ...this. + * testsuite/ld-scripts/provide-5-map.d: Renamed to... + * testsuite/ld-scripts/provide-5.map: ...this. + * testsuite/ld-scripts/provide.exp: Move xfail into provide-3.d + file, and run tests in a loop. + +2018-01-11 Andrew Burgess + * ldexp.c (exp_print_tree): Use '=' instead of ',' when printing PROVIDE statements. * testsuite/ld-scripts/provide-4.map: Update expected output. diff --git a/ld/testsuite/ld-scripts/provide-3.d b/ld/testsuite/ld-scripts/provide-3.d index c8b12da..a5855e6 100644 --- a/ld/testsuite/ld-scripts/provide-3.d +++ b/ld/testsuite/ld-scripts/provide-3.d @@ -1,3 +1,4 @@ #source: provide-3.s #ld: -T provide-3.t #error: symbol defined in linker script and object file +#xfail: "*-*-*" diff --git a/ld/testsuite/ld-scripts/provide-4-map.d b/ld/testsuite/ld-scripts/provide-4-map.d deleted file mode 100644 index 6ef936c..0000000 --- a/ld/testsuite/ld-scripts/provide-4-map.d +++ /dev/null @@ -1,13 +0,0 @@ -#... -Linker script and memory map -#... - \[!provide\] +PROVIDE \(foo = 0x1\) - \[!provide\] +PROVIDE \(bar = 0x2\) - 0x0+3 +PROVIDE \(baz = 0x3\) -#... - 0x0+2000 +foo - \[!provide\] +PROVIDE \(loc1 = ALIGN \(\., 0x10\)\) - 0x0+2010 +PROVIDE \(loc2 = ALIGN \(\., 0x10\)\) - \[!provide\] +PROVIDE \(loc3 = \(loc1 \+ 0x20\)\) - 0x0+2030 +loc4 = \(loc2 \+ 0x20\) -#... diff --git a/ld/testsuite/ld-scripts/provide-4.d b/ld/testsuite/ld-scripts/provide-4.d index a7d37e3..18699f2 100644 --- a/ld/testsuite/ld-scripts/provide-4.d +++ b/ld/testsuite/ld-scripts/provide-4.d @@ -1,7 +1,7 @@ #source: provide-2.s #ld: -T provide-4.t #PROG: nm -#map: provide-4-map.d +#map: provide-4.map #... 0+3 A baz 0+2000 D foo diff --git a/ld/testsuite/ld-scripts/provide-4.map b/ld/testsuite/ld-scripts/provide-4.map new file mode 100644 index 0000000..6ef936c --- /dev/null +++ b/ld/testsuite/ld-scripts/provide-4.map @@ -0,0 +1,13 @@ +#... +Linker script and memory map +#... + \[!provide\] +PROVIDE \(foo = 0x1\) + \[!provide\] +PROVIDE \(bar = 0x2\) + 0x0+3 +PROVIDE \(baz = 0x3\) +#... + 0x0+2000 +foo + \[!provide\] +PROVIDE \(loc1 = ALIGN \(\., 0x10\)\) + 0x0+2010 +PROVIDE \(loc2 = ALIGN \(\., 0x10\)\) + \[!provide\] +PROVIDE \(loc3 = \(loc1 \+ 0x20\)\) + 0x0+2030 +loc4 = \(loc2 \+ 0x20\) +#... diff --git a/ld/testsuite/ld-scripts/provide-5-map.d b/ld/testsuite/ld-scripts/provide-5-map.d deleted file mode 100644 index 78b0bcb..0000000 --- a/ld/testsuite/ld-scripts/provide-5-map.d +++ /dev/null @@ -1,6 +0,0 @@ -#... -Linker script and memory map -#... - 0x0+10 +foo = 0x10 - \[!provide\] +PROVIDE \(foo = bar\) -#... diff --git a/ld/testsuite/ld-scripts/provide-5.d b/ld/testsuite/ld-scripts/provide-5.d index 1b14fa6..2a8baec 100644 --- a/ld/testsuite/ld-scripts/provide-5.d +++ b/ld/testsuite/ld-scripts/provide-5.d @@ -1,6 +1,6 @@ #source: provide-5.s #ld: -T provide-5.t #PROG: nm -#map: provide-5-map.d +#map: provide-5.map #... 0+10 A foo diff --git a/ld/testsuite/ld-scripts/provide-5.map b/ld/testsuite/ld-scripts/provide-5.map new file mode 100644 index 0000000..78b0bcb --- /dev/null +++ b/ld/testsuite/ld-scripts/provide-5.map @@ -0,0 +1,6 @@ +#... +Linker script and memory map +#... + 0x0+10 +foo = 0x10 + \[!provide\] +PROVIDE \(foo = bar\) +#... diff --git a/ld/testsuite/ld-scripts/provide.exp b/ld/testsuite/ld-scripts/provide.exp index 3a0b2e8..01bf934 100644 --- a/ld/testsuite/ld-scripts/provide.exp +++ b/ld/testsuite/ld-scripts/provide.exp @@ -36,11 +36,11 @@ if [istarget "x86_64-*-mingw*"] then { set LDFLAGS "$LDFLAGS --image-base 0" } -run_dump_test provide-1 -run_dump_test provide-2 -setup_xfail *-*-* -run_dump_test provide-3 -run_dump_test provide-4 -run_dump_test provide-5 +set test_list [lsort [glob -nocomplain $srcdir/$subdir/provide-*.d]] +foreach test_file $test_list { + set test_name [file rootname $test_file] + verbose $test_name + run_dump_test $test_name +} set LDFLAGS "$saved_LDFLAGS" -- cgit v1.1