diff mbox series

[05/11] testsuite: Add check for unsupported TI ABI PRU features to testsuite

Message ID 20180613185805.7833-6-dimitar@dinux.eu
State New
Headers show
Series New backend for the TI PRU processor | expand

Commit Message

Dimitar Dimitrov June 13, 2018, 6:57 p.m. UTC
Not all C language features are supported when -mabi=ti option is
used for PRU target.

gcc/testsuite/ChangeLog:

2018-06-13  Dimitar Dimitrov  <dimitar@dinux.eu>

	* lib/gcc-dg.exp: Filter unsupported features in PRU's TI ABI mode.
	* lib/target-utils.exp: Ditto.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/lib/gcc-dg.exp       | 11 +++++++++++
 gcc/testsuite/lib/target-utils.exp |  8 ++++++++
 2 files changed, 19 insertions(+)

Comments

Jeff Law June 22, 2018, 4:42 p.m. UTC | #1
On 06/13/2018 12:57 PM, Dimitar Dimitrov wrote:
> Not all C language features are supported when -mabi=ti option is
> used for PRU target.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-06-13  Dimitar Dimitrov  <dimitar@dinux.eu>
> 
> 	* lib/gcc-dg.exp: Filter unsupported features in PRU's TI ABI mode.
> 	* lib/target-utils.exp: Ditto.
I think a level of indirection would be better here.  ie, define a new
routines that indicate if the target has function pointers and large
return values and call that routine from within gcc-dg-prune and
*_check_supported_p.

Those routines would obviously return true for pru :-)

With that change this will be OK once the rest of the kit is approved.

jeff
diff mbox series

Patch

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index c5ab850c840..f4976520282 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -388,6 +388,17 @@  proc gcc-dg-prune { system text } {
 	return "::unsupported::memory full"
     }
 
+    if {[string match "pru-*" $system] && \
+	    [string match "*error: function pointers not supported with -mabi=ti option*" $text]} {
+	# The format here is important.  See dg.exp.
+	return "::unsupported::abi"
+    }
+    if {[string match "pru-*" $system] && \
+	    [string match "*error: large return values not supported with -mabi=ti option*" $text]} {
+	# The format here is important.  See dg.exp.
+	return "::unsupported::abi"
+    }
+
     return $text
 }
 
diff --git a/gcc/testsuite/lib/target-utils.exp b/gcc/testsuite/lib/target-utils.exp
index 732a1827a02..e288447ef1d 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 {[istarget pru-*] && \
+	    [string match "*error: large return values not supported with -mabi=ti option*" $output]} {
+	return "abi not supported"
+    }
+    if {[istarget pru-*] && \
+	    [string match "*error: function pointers not supported with -mabi=ti option*" $output]} {
+	return "abi not supported"
+    }
     return ""
 }