[gcc(refs/users/meissner/heads/work003)] PowerPC tests: Add prefixed/pcrel tests.

Michael Meissner meissner@gcc.gnu.org
Wed Jun 3 03:45:34 GMT 2020


https://gcc.gnu.org/g:d1fee070f298c5d7d17201a730305fbecd5c0fcf

commit d1fee070f298c5d7d17201a730305fbecd5c0fcf
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Jun 2 23:44:10 2020 -0400

    PowerPC tests: Add prefixed/pcrel tests.
    
    2020-06-02  Michael Meissner  <meissner@linux.ibm.com>
    
            * lib/target-supports.exp (check_effective_target_powerpc_pcrel):
            New.
            (check_effective_target_powerpc_prefixed_addr): New.

Diff:
---
 gcc/testsuite/lib/target-supports.exp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index b335108358d..8bd29519211 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2163,6 +2163,25 @@ proc check_p9vector_hw_available { } {
     }]
 }
 
+# Return 1 if the target generates PC-relative instructions automatically for
+# the PowerPC 'future' machine.
+proc check_effective_target_powerpc_pcrel { } {
+    return [check_no_messages_and_pattern powerpc_pcrel \
+	{\mpla\M} assembly {
+	    static unsigned short s;
+	    unsigned short *p_foo (void) { return &s; }
+	} {-O2 -mcpu=future}]
+}
+
+# Return 1 if the target generates prefixed instructions automatically for the
+# PowerPC 'future' machine.
+proc check_effective_target_powerpc_prefixed_addr { } {
+    return [check_no_messages_and_pattern powerpc_prefixed_addr \
+	{\mplwz\M} assembly {
+	    unsigned int foo (unsigned int *p) { return p[0x12345]; }
+	} {-O2 -mcpu=future}]
+}
+
 # Return 1 if the target supports executing power9 modulo instructions, 0
 # otherwise.  Cache the result.


More information about the Gcc-cvs mailing list