aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/lib/target-supports.exp19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index b335108..a595042 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 PowerPC target generates PC-relative instructions
+# automatically for targets that support PC-relative instructions.
+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 PowerPC target generates prefixed instructions automatically
+# for targets that support prefixed instructions.
+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.