[04/11] testsuite: Add check for overflowed IMEM region to testsuite

Message ID 20180613185805.7833-5-dimitar@dinux.eu
State New
Headers show
Series
  • New backend for the TI PRU processor
Related show

Commit Message

Dimitar Dimitrov June 13, 2018, 6:57 p.m.
PRU architecture supports maximum 256k program memory (IMEM). Some GCC
test cases manage to produce executables bigger than that.

gcc/testsuite/ChangeLog:

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

	* 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.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/lib/gcc-dg.exp          | 5 +++++
 gcc/testsuite/lib/target-supports.exp | 5 +++++
 gcc/testsuite/lib/target-utils.exp    | 4 ++++
 3 files changed, 14 insertions(+)

Comments

Jeff Law June 22, 2018, 4:40 p.m. | #1
On 06/13/2018 12:57 PM, Dimitar Dimitrov wrote:
> PRU architecture supports maximum 256k program memory (IMEM). Some GCC
> test cases manage to produce executables bigger than that.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-06-13  Dimitar Dimitrov  <dimitar@dinux.eu>
> 
> 	* 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.
This is fine once the rest of the port is approved.

jeff

Patch

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index a15c5d5e2a6..c5ab850c840 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -375,6 +375,11 @@  proc gcc-dg-prune { system text } {
         return "::unsupported::memory full"
     }
 
+    if { [regexp "(^|\n)\[^\n\]*: region \[^\n\]* overflowed" $text] 
+          && [check_effective_target_tiny] } {
+	return "::unsupported::memory full"
+    }
+
     # Likewise, if we see ".text exceeds local store range" or
     # similar.
     if {[string match "spu-*" $system] && \
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index b92e54b6ec3..8d5f7e0720c 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8786,6 +8786,11 @@  proc check_effective_target_tiny {} {
              && [check_effective_target_avr_tiny] } {
          set et_target_tiny_saved 1
        }
+       # PRU Program Counter is 16-bits, and trampolines are not supported.
+       # Hence directly declare as a tiny target.
+       if [istarget pru-*-*] {
+         set et_target_tiny_saved 1
+       }
     }
 
     return $et_target_tiny_saved
diff --git a/gcc/testsuite/lib/target-utils.exp b/gcc/testsuite/lib/target-utils.exp
index bd39cc5bc79..732a1827a02 100644
--- a/gcc/testsuite/lib/target-utils.exp
+++ b/gcc/testsuite/lib/target-utils.exp
@@ -35,6 +35,10 @@  proc ${tool}_check_unsupported_p { output } {
           && [check_effective_target_tiny] } {
         return "memory full"
      }
+    if { [regexp "(^|\n)\[^\n\]*: region \[^\n\]* overflowed" $output]
+          && [check_effective_target_tiny] } {
+	return "memory full"
+    }
 
     if { [istarget spu-*-*] && \
 	     [string match "*exceeds local store*" $output] } {