PRU architecture supports maximum 256k program memory (IMEM). Some GCC
test cases manage to produce executables bigger than that.

gcc/testsuite/ChangeLog:

2019-06-07  Dimitar Dimitrov  <dimi...@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 <dimi...@dinux.eu>
---
 gcc/testsuite/lib/target-supports.exp | 5 +++++
 gcc/testsuite/lib/target-utils.exp    | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index b60eab6d75d..2b3290619dc 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8765,6 +8765,11 @@ proc check_effective_target_tiny {} {
            && [check_effective_target_avr_tiny] } {
           return 1
       }
+      # PRU Program Counter is 16-bits, and trampolines are not supported.
+      # Hence directly declare as a tiny target.
+      if [istarget pru-*-*] {
+          return 1
+      }
       return 0
     }]
 }
diff --git a/gcc/testsuite/lib/target-utils.exp 
b/gcc/testsuite/lib/target-utils.exp
index e847fdd4279..23137d4702c 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] } {
-- 
2.11.0

Reply via email to