Hi, As the failure of test case gcc.target/powerpc/pr92398.p9-.c in PR106345 shows, some test sources for some powerpc effective targets use empty translation unit wrongly. The test sources could go with options like "-ansi -pedantic-errors", then those effective target checkings will fail unexpectedly with the error messages like:
error: ISO C forbids an empty translation unit [-Wpedantic] This patch is to fix empty TUs with one dummy variable definition accordingly. Tested on powerpc64-linux-gnu P7 and P8 and powerpc64le-linux-gnu P9 and P10. Excepting for the failures on gcc.target/powerpc/pr92398.p9-.c fixed, I can see it helps to bring back some testing coverage like: NA->PASS: gcc.target/powerpc/pr92398.p9+.c NA->PASS: gcc.target/powerpc/pr93453-1.c I'll push this soon if no objections. BR, Kewen ----- PR testsuite/106345 gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_powerpc_sqrt): Add a variable definition to avoid pedwarn about empty translation unit. (check_effective_target_has_arch_pwr5): Likewise. (check_effective_target_has_arch_pwr6): Likewise. (check_effective_target_has_arch_pwr7): Likewise. (check_effective_target_has_arch_pwr8): Likewise. (check_effective_target_has_arch_pwr9): Likewise. (check_effective_target_has_arch_pwr10): Likewise. (check_effective_target_has_arch_ppc64): Likewise. (check_effective_target_ppc_float128): Likewise. (check_effective_target_ppc_float128_insns): Likewise. (check_effective_target_powerpc_vsx): Likewise. --- gcc/testsuite/lib/target-supports.exp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4ed7b25b9a4..aac2a557f5d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6262,6 +6262,7 @@ proc check_effective_target_powerpc_sqrt { } { #ifndef _ARCH_PPCSQ #error _ARCH_PPCSQ is not defined #endif + int dummy; } {}] } @@ -6373,6 +6374,7 @@ proc check_effective_target_has_arch_pwr5 { } { #error does not have power5 support. #else /* "has power5 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6383,6 +6385,7 @@ proc check_effective_target_has_arch_pwr6 { } { #error does not have power6 support. #else /* "has power6 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6393,6 +6396,7 @@ proc check_effective_target_has_arch_pwr7 { } { #error does not have power7 support. #else /* "has power7 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6403,6 +6407,7 @@ proc check_effective_target_has_arch_pwr8 { } { #error does not have power8 support. #else /* "has power8 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6413,6 +6418,7 @@ proc check_effective_target_has_arch_pwr9 { } { #error does not have power9 support. #else /* "has power9 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6423,6 +6429,7 @@ proc check_effective_target_has_arch_pwr10 { } { #error does not have power10 support. #else /* "has power10 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6433,6 +6440,7 @@ proc check_effective_target_has_arch_ppc64 { } { #error does not have ppc64 support. #else /* "has ppc64 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6523,6 +6531,7 @@ proc check_effective_target_ppc_float128 { } { #ifndef __FLOAT128__ nope no good #endif + int dummy; }] } @@ -6533,6 +6542,7 @@ proc check_effective_target_ppc_float128_insns { } { #ifndef __FLOAT128_HARDWARE__ nope no good #endif + int dummy; }] } @@ -6543,6 +6553,7 @@ proc check_effective_target_powerpc_vsx { } { #ifndef __VSX__ nope no vsx #endif + int dummy; }] } -- 2.27.0