aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/ppc/ppc.exp2
-rw-r--r--gas/testsuite/gas/ppc/rop-checks.d3
-rw-r--r--gas/testsuite/gas/ppc/rop-checks.l17
-rw-r--r--gas/testsuite/gas/ppc/rop-checks.s18
-rw-r--r--gas/testsuite/gas/ppc/rop.d27
-rw-r--r--gas/testsuite/gas/ppc/rop.s21
6 files changed, 88 insertions, 0 deletions
diff --git a/gas/testsuite/gas/ppc/ppc.exp b/gas/testsuite/gas/ppc/ppc.exp
index bec3151..6f61ad0 100644
--- a/gas/testsuite/gas/ppc/ppc.exp
+++ b/gas/testsuite/gas/ppc/ppc.exp
@@ -146,5 +146,7 @@ run_dump_test "stringop"
run_dump_test "xvtlsbb"
run_dump_test "rightmost"
run_dump_test "scalarquad"
+run_dump_test "rop"
+run_dump_test "rop-checks"
run_dump_test "dcbt"
diff --git a/gas/testsuite/gas/ppc/rop-checks.d b/gas/testsuite/gas/ppc/rop-checks.d
new file mode 100644
index 0000000..b7ef25e
--- /dev/null
+++ b/gas/testsuite/gas/ppc/rop-checks.d
@@ -0,0 +1,3 @@
+#as: -mpower10
+#name: Test Return-Oriented Programming checks
+#error_output: rop-checks.l
diff --git a/gas/testsuite/gas/ppc/rop-checks.l b/gas/testsuite/gas/ppc/rop-checks.l
new file mode 100644
index 0000000..83ffbee
--- /dev/null
+++ b/gas/testsuite/gas/ppc/rop-checks.l
@@ -0,0 +1,17 @@
+[^:]*: Assembler messages:
+[^:]*:3: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:4: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:5: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:6: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:7: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:8: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:9: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:10: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:11: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:12: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:13: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:14: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:15: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:16: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:17: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
+[^:]*:18: Error: invalid offset: must be in the range \[-512, -8\] and be a multiple of 8
diff --git a/gas/testsuite/gas/ppc/rop-checks.s b/gas/testsuite/gas/ppc/rop-checks.s
new file mode 100644
index 0000000..83ca35a
--- /dev/null
+++ b/gas/testsuite/gas/ppc/rop-checks.s
@@ -0,0 +1,18 @@
+ .text
+_start:
+ hashst 20,8(1)
+ hashst 21,0(1)
+ hashst 22,-12(1)
+ hashst 23,-520(1)
+ hashchk 20,8(1)
+ hashchk 21,0(1)
+ hashchk 22,-12(1)
+ hashchk 23,-520(1)
+ hashstp 20,8(1)
+ hashstp 21,0(1)
+ hashstp 22,-12(1)
+ hashstp 23,-520(1)
+ hashchkp 20,8(1)
+ hashchkp 21,0(1)
+ hashchkp 22,-12(1)
+ hashchkp 23,-520(1)
diff --git a/gas/testsuite/gas/ppc/rop.d b/gas/testsuite/gas/ppc/rop.d
new file mode 100644
index 0000000..2671dd6
--- /dev/null
+++ b/gas/testsuite/gas/ppc/rop.d
@@ -0,0 +1,27 @@
+#as: -mpower8
+#objdump: -d -Mpower8
+#name: Return-Oriented Programming tests
+
+.*
+
+
+Disassembly of section \.text:
+
+0+0 <_start>:
+.*: (7f e1 a5 a5|a5 a5 e1 7f) hashst r20,-8\(r1\)
+.*: (7f c1 ad a5|a5 ad c1 7f) hashst r21,-16\(r1\)
+.*: (7c 01 b5 a5|a5 b5 01 7c) hashst r22,-256\(r1\)
+.*: (7c 01 bd a4|a4 bd 01 7c) hashst r23,-512\(r1\)
+.*: (7f e1 a5 e5|e5 a5 e1 7f) hashchk r20,-8\(r1\)
+.*: (7f c1 ad e5|e5 ad c1 7f) hashchk r21,-16\(r1\)
+.*: (7c 01 b5 e5|e5 b5 01 7c) hashchk r22,-256\(r1\)
+.*: (7c 01 bd e4|e4 bd 01 7c) hashchk r23,-512\(r1\)
+.*: (7f e1 a5 25|25 a5 e1 7f) hashstp r20,-8\(r1\)
+.*: (7f c1 ad 25|25 ad c1 7f) hashstp r21,-16\(r1\)
+.*: (7c 01 b5 25|25 b5 01 7c) hashstp r22,-256\(r1\)
+.*: (7c 01 bd 24|24 bd 01 7c) hashstp r23,-512\(r1\)
+.*: (7f e1 a5 65|65 a5 e1 7f) hashchkp r20,-8\(r1\)
+.*: (7f c1 ad 65|65 ad c1 7f) hashchkp r21,-16\(r1\)
+.*: (7c 01 b5 65|65 b5 01 7c) hashchkp r22,-256\(r1\)
+.*: (7c 01 bd 64|64 bd 01 7c) hashchkp r23,-512\(r1\)
+#pass
diff --git a/gas/testsuite/gas/ppc/rop.s b/gas/testsuite/gas/ppc/rop.s
new file mode 100644
index 0000000..22e45f4
--- /dev/null
+++ b/gas/testsuite/gas/ppc/rop.s
@@ -0,0 +1,21 @@
+# These instructions are new in POWER10, but enabled for POWER8 and
+# later cpus. On POWER8 and POWER9, these instructions behave as
+# nop's.
+ .text
+_start:
+ hashst 20,-8(1)
+ hashst 21,-16(1)
+ hashst 22,-256(1)
+ hashst 23,-512(1)
+ hashchk 20,-8(1)
+ hashchk 21,-16(1)
+ hashchk 22,-256(1)
+ hashchk 23,-512(1)
+ hashstp 20,-8(1)
+ hashstp 21,-16(1)
+ hashstp 22,-256(1)
+ hashstp 23,-512(1)
+ hashchkp 20,-8(1)
+ hashchkp 21,-16(1)
+ hashchkp 22,-256(1)
+ hashchkp 23,-512(1)