testsuite: Add check for unsupported TI ABI PRU features to testsuite
authorDimitar Dimitrov <dimitar@dinux.eu>
Wed, 12 Jun 2019 19:41:02 +0000 (19:41 +0000)
committerDimitar Dimitrov <dimitar@gcc.gnu.org>
Wed, 12 Jun 2019 19:41:02 +0000 (19:41 +0000)
gcc/testsuite/ChangeLog:

2019-06-12  Dimitar Dimitrov  <dimitar@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.

From-SVN: r272207

gcc/testsuite/ChangeLog
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/target-supports.exp
gcc/testsuite/lib/target-utils.exp

index 10e6551f74ccb5fd87d28f7ff017ccdf79a1e1ee..b8970c31ff540d26430b9510d0e3d5ad5011438b 100644 (file)
@@ -1,3 +1,10 @@
+2019-06-12  Dimitar Dimitrov  <dimitar@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.
+
 2019-06-12  Dimitar Dimitrov  <dimitar@dinux.eu>
 
        * lib/gcc-dg.exp: Bail on region overflow for tiny targets.
index c56e8e80ae0c63fec7a8c8aa9dcec1f024a6bba2..e23b63cf3d163f93b4c10347049675d8d4ce0983 100644 (file)
@@ -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
 }
 
index 2b3290619dcdb2996b5c2cd28eaa3a03415ae1f5..01472879062bfaf960b69273ae7febaf31c323a2 100644 (file)
@@ -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
index 23137d4702cceffdabdfad8b499a266b56248956..0dd1f3494e89095efaf952f6c6ad62fc4dcd125e 100644 (file)
@@ -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 ""
 }