From b48e2217672b79a81448ff675ad9dea8a325bfe1 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Wed, 12 Jun 2019 19:41:02 +0000 Subject: [PATCH] testsuite: Add check for unsupported TI ABI PRU features to testsuite gcc/testsuite/ChangeLog: 2019-06-12 Dimitar Dimitrov * 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. From-SVN: r272207 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/lib/gcc-dg.exp | 11 +++++++++++ gcc/testsuite/lib/target-supports.exp | 26 ++++++++++++++++++++++++++ gcc/testsuite/lib/target-utils.exp | 8 ++++++++ 4 files changed, 52 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 10e6551..b8970c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2019-06-12 Dimitar Dimitrov + * 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. + +2019-06-12 Dimitar Dimitrov + * lib/gcc-dg.exp: Bail on region overflow for tiny targets. * lib/target-utils.exp: Ditto. * lib/target-supports.exp: Declare PRU target as tiny. diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index c56e8e8..e23b63c 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -422,6 +422,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 2b32906..0147287 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2644,6 +2644,32 @@ proc check_effective_target_size20plus { } { }] } +# 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 large_return_values assembly { + #ifdef __PRU_EABI_GNU__ + #error unsupported + #endif + }] + } + return 1 +} + # Return 1 if we support 24-bit or larger array and structure sizes # using default options, 0 otherwise. # This implies at least a 32-bit address space, as no targets have an address diff --git a/gcc/testsuite/lib/target-utils.exp b/gcc/testsuite/lib/target-utils.exp index 23137d4..0dd1f34 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.7.4