Not all C language features are supported when -mabi=ti option is used for PRU target.
gcc/testsuite/ChangeLog: 2018-08-29 Dimitar Dimitrov <dimi...@dinux.eu> * lib/gcc-dg.exp: Filter unsupported features in PRU's TI ABI mode. * lib/target-utils.exp: Ditto. * lib/target-supports.exp (check_effective_target_function_pointers, check_effective_target_large_return_values): New. Signed-off-by: Dimitar Dimitrov <dimi...@dinux.eu> --- gcc/testsuite/lib/gcc-dg.exp | 11 +++++++++++ gcc/testsuite/lib/target-supports.exp | 26 ++++++++++++++++++++++++++ gcc/testsuite/lib/target-utils.exp | 8 ++++++++ 3 files changed, 45 insertions(+) diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 7ef9de59dc2..8f70232914b 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -407,6 +407,17 @@ proc gcc-dg-prune { system text } { return "::unsupported::memory full" } + if { [string match "*error: function pointers not supported*" $text] + && ![check_effective_target_function_pointers] } { + # The format here is important. See dg.exp. + return "::unsupported::funcptr" + } + if { [string match "*error: large return values not supported*" $text] + && ![check_effective_target_large_return_values] } { + # The format here is important. See dg.exp. + return "::unsupported::large return values" + } + return $text } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 7d4ea35babb..08c011317b4 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2619,6 +2619,32 @@ proc check_effective_target_ptr32plus { } { }] } +# Return 1 if target supports function pointers, 0 otherwise. + +proc check_effective_target_function_pointers { } { + if { [istarget pru-*-*] } { + return [check_no_compiler_messages func_ptr_avail assembly { + #ifdef __PRU_EABI_GNU__ + #error unsupported + #endif + }] + } + return 1 +} + +# Return 1 if target supports arbitrarily large return values, 0 otherwise. + +proc check_effective_target_large_return_values { } { + if { [istarget pru-*-*] } { + return [check_no_compiler_messages func_ptr_avail assembly { + #ifdef __PRU_EABI_GNU__ + #error unsupported + #endif + }] + } + return 1 +} + # Return 1 if we support 32-bit or larger array and structure sizes # using default options, 0 otherwise. Avoid false positive on # targets with 20 or 24 bit address spaces. diff --git a/gcc/testsuite/lib/target-utils.exp b/gcc/testsuite/lib/target-utils.exp index 732a1827a02..f636be2cb01 100644 --- a/gcc/testsuite/lib/target-utils.exp +++ b/gcc/testsuite/lib/target-utils.exp @@ -44,5 +44,13 @@ proc ${tool}_check_unsupported_p { output } { [string match "*exceeds local store*" $output] } { return "memory full" } + if { [string match "*error: function pointers not supported*" $output] + && ![check_effective_target_function_pointers] } { + return "function pointers not supported" + } + if { [string match "*error: large return values not supported*" $output] + && ![check_effective_target_large_return_values] } { + return "large return values not supported" + } return "" } -- 2.11.0