1
# DP: Reliably prune GCC notes in C++ compat suite
3
in testing the rs6000 ABI patches I noted a weird effect: usually, the
4
-Wpsabi warning notes are ignored in the compat test suites, so we get
5
a clean test run anyway.
7
However, when running the C++ version of the struct-layout-1.exp case
8
*alone* (using RUNTESTFLAGS=struct-layout-1.exp), suddenly tests are
9
failing because of those extra notes. This does *not* happen with
10
the C version of that suite ...
12
It turns out that that pruning those notes is supposed to happen
13
from within gcc-defs.exp:${tool}_check_compile:
14
if { [info proc ${tool}-dg-prune] != "" } {
16
set gcc_output [${tool}-dg-prune $target_triplet $gcc_output]
19
However, the g++-dg-prune routine is defined in g++-dg.exp, which
20
is never included from g++.dg/compat/struct-layout-1.exp (directly
21
or indirectly). Now, when running the full suite, that file would
22
have been loaded by some earlier g++.dg .exp file, so everything
23
works out. But when running struct-layout-1.exp stand-alone, the
24
g++-dg-prune routine is never defined and thus silently no pruning
27
To fix this, the following patch simply loads g++-dg.exp directly
28
from g++.dg/compat/struct-layout-1.exp.
30
Tested on powerpc64-linux and powerpc64le-linux.
32
OK for mainline (and 4.8/4.9 once the rs6000 ABI patches are
39
gcc/testsuite/ChangeLog:
41
* g++.dg/compat/struct-layout-1.exp: Load g++-dg.exp
44
--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
45
+++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
46
@@ -89,6 +89,9 @@ proc compat-use-tst-compiler { } {
47
# This must be done after the compat-use-*-compiler definitions.
50
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
55
# Save variables for the C++ compiler under test, which each test will