Similar to the existing ptr32plus, add a proc returning whether the
target uses 64-bit or larger pointers.  It can be useful immediately in
the CTF testsuite, and likely elsewhere.

Tested on x86_64-pc-linux-gnu and with cross for arm-eabi cortex-m3
in the CTF testsuite.

gcc/testsuite/

        * lib/target-supports.exp (check_effective_target_ptr64plus): New.
        * gcc.dg/debug/ctf/ctf-array-7.c: Use it here.

Suggested-by: Andrew Pinski <andrew.pin...@oss.qualcomm.com>
---
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-7.c | 2 +-
 gcc/testsuite/lib/target-supports.exp        | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-array-7.c 
b/gcc/testsuite/gcc.dg/debug/ctf/ctf-array-7.c
index f064f6fa5fe..a2ff967afdb 100644
--- a/gcc/testsuite/gcc.dg/debug/ctf/ctf-array-7.c
+++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-array-7.c
@@ -6,7 +6,7 @@
    represented.  Arrays with too many elements are encoded with
    CTF_K_UNKNOWN to indicate that they cannot be represented.  */
 
-/* { dg-do compile { target { lp64 || llp64 } } } */
+/* { dg-do compile { target ptr64plus } } */
 /* { dg-options "-O0 -gctf -dA" } */
 
 int   rep[0xffffffff];
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 2ab405a1513..9aa795f7030 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3928,6 +3928,15 @@ proc check_effective_target_ptr32plus { } {
     }]
 }
 
+# Return 1 if we're generating 64-bit or larger pointers using default
+# options, 0 otherwise.
+
+proc check_effective_target_ptr64plus { } {
+       return [check_no_compiler_messages ptr64plus object {
+               int dummy[sizeof (void *) >= 8 ? 1 : -1];
+       }]
+}
+
 # Return 1 if we support 16-bit or larger array and structure sizes
 # using default options, 0 otherwise.
 # This implies at least a 20-bit address space, as no targets have an address
-- 
2.47.2

Reply via email to