From 2bd7f877afeadd6da4c6b1dfc4d0489e9c0efb55 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 7 Feb 2017 22:31:46 +0000 Subject: ld: Add additional checking for warnings/errors in testsuite This commit adds new actions to the run_cc_link_tests mechanism in the linker testsuite. Previously this procedure could take a parameter containing a regular expression that would be matched against warnings from the linker. After this commit the warnings parameter is removed, instead, the actions list can contain the actions 'warning', 'error', 'warning_output', or 'error_output'. The action names are chosen to match the actions already present in the run_dump_test procedure. These new actions allow for the current warning checking, but also allow for checking of errors using a regular expression. More interestingly, the *_output actions allow for the warning/error patterns to be placed in a separate file. The small number of tests that make use of the warning parameter have been updated to the new mechanism. Later commits will make use of the new features added in this commit. ld/ChangeLog: * testsuite/lib/ld-lib.exp (run_cc_link_tests): Add warning, error, warning_output, and error_output actions. Remove separate warnings parameter. * testsuite/ld-elf/shared.exp (build_tests): Updated to use 'warning' action. * testsuite/ld-plugin/lto.exp (lto_link_tests): Likewise. --- ld/testsuite/ld-elf/shared.exp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ld/testsuite/ld-elf') diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 2946262..9d5a9d9 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -103,8 +103,10 @@ set build_tests { {begin.c end.c} {} "libbar.so"} {"Build warn libbar.so" "-shared" "-fPIC" - {beginwarn.c end.c} {{readelf {-S --wide} libbarw.rd}} "libbarw.so" - "c" {^.*\): warning: function foo is deprecated$} } + {beginwarn.c end.c} + {{readelf {-S --wide} libbarw.rd} + {warning "^.*\\): warning: function foo is deprecated$"}} + "libbarw.so" "c"} {"Build hidden libbar.so" "-shared" "-fPIC" {begin.c endhidden.c} {} "libbarh.so"} -- cgit v1.1