aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog10
-rw-r--r--gas/testsuite/gas/all/gas.exp2
-rw-r--r--gas/testsuite/gas/mips/lui-2.l2
-rw-r--r--gas/testsuite/gas/mips/mips.exp9
-rw-r--r--gas/testsuite/gas/mips/pcrel-1.d14
-rw-r--r--gas/testsuite/gas/mips/pcrel-1.s13
-rw-r--r--gas/testsuite/gas/mips/pcrel-2.d8
-rw-r--r--gas/testsuite/gas/mips/pcrel-2.s7
-rw-r--r--gas/testsuite/gas/mips/pcrel-3.l7
-rw-r--r--gas/testsuite/gas/mips/pcrel-3.s11
-rw-r--r--gas/testsuite/gas/mips/pcrel-4-32.d18
-rw-r--r--gas/testsuite/gas/mips/pcrel-4-64.d21
-rw-r--r--gas/testsuite/gas/mips/pcrel-4-n32.d13
-rw-r--r--gas/testsuite/gas/mips/pcrel-4.s6
14 files changed, 139 insertions, 2 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 18ef92f..a7bec28 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2014-03-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gas/all/gas.exp: Remove XFAIL of forward.d for MIPS.
+ * gas/mips/pcrel-1.s, gas/mips/pcrel-1.d, gas/mips/pcrel-2.s,
+ gas/mips/pcrel-2.d, gas/mips/pcrel-3.s, gas/mips/pcrel-3.l,
+ gas/mips/pcrel-4.s, gas/mips/pcrel-4-32.d, gas/mips/pcrel-4-n32.d,
+ gas/mips/pcrel-4-64.d: New tests.
+ * gas/mips/mips.exp: Run them.
+ * gas/mips/lui-2.l: Tweak error message for line 7.
+
2014-03-20 Ilya Tocar <ilya.tocar@intel.com>
* gas/i386/avx512pf-intel.d: Change memory size for vgatherpf0qps,
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index 4c63efb..7d635b7 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -99,7 +99,7 @@ case $target_triplet in {
default {
# Some targets don't manage to resolve BFD_RELOC_8 for constants.
setup_xfail "alpha*-*-*" "*c30*-*-*" "*c4x*-*-*" \
- "d\[13\]0v*-*-*" "i860-*-*" "mips*-*-*" \
+ "d\[13\]0v*-*-*" "i860-*-*" \
"nds32*-*-*" "pdp11-*-*" "xtensa*-*-*"
run_dump_test forward
}
diff --git a/gas/testsuite/gas/mips/lui-2.l b/gas/testsuite/gas/mips/lui-2.l
index ed97e85..635f97d 100644
--- a/gas/testsuite/gas/mips/lui-2.l
+++ b/gas/testsuite/gas/mips/lui-2.l
@@ -1,5 +1,5 @@
.*\.s: Assembler messages:
.*\.s:10: Error: invalid operands \(\*UND\* and \*UND\* sections\) for `/'
-.*\.s:7: Error: can't resolve `bar' {\*UND\* section} - `foo' {\.text section}
+.*\.s:7: Error: PC-relative reference to a different section
.*\.s:8: Error: can't resolve `baz' {\*UND\* section} - `bar' {\*UND\* section}
.*\.s:9: Error: can't resolve `\.text' {\.text section} - `baz' {\*UND\* section}
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index e3c4e93..628f482 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1169,4 +1169,13 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test_arches "msa64" [mips_arch_list_matching mips64r2]
run_dump_test_arches "msa-relax" [mips_arch_list_matching mips32r2]
run_dump_test_arches "msa-branch" [mips_arch_list_matching mips32r2]
+
+ run_dump_test "pcrel-1"
+ run_dump_test "pcrel-2"
+ run_list_test "pcrel-3" "" "Invalid cross-section PC-relative references"
+ run_dump_test "pcrel-4-32"
+ if $has_newabi {
+ run_dump_test "pcrel-4-n32"
+ run_dump_test "pcrel-4-64"
+ }
}
diff --git a/gas/testsuite/gas/mips/pcrel-1.d b/gas/testsuite/gas/mips/pcrel-1.d
new file mode 100644
index 0000000..5c9f655
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-1.d
@@ -0,0 +1,14 @@
+#objdump: -dr
+#name: Locally-resolvable PC-relative code references
+
+.*: file format .*
+
+Disassembly of section .text:
+
+00000000 <func>:
+ 0: 3c040001 lui a0,0x1
+ 4: 2484800c addiu a0,a0,-32756
+ ...
+
+00008010 <foo>:
+#pass
diff --git a/gas/testsuite/gas/mips/pcrel-1.s b/gas/testsuite/gas/mips/pcrel-1.s
new file mode 100644
index 0000000..ba93a5b
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-1.s
@@ -0,0 +1,13 @@
+ .text
+ .ent func
+func:
+ lui $4,%hi(foo-.)
+ addiu $4,%lo(foo-.)
+ .end func
+
+ .space 0x8008
+
+ .ent foo
+foo:
+ nop
+ .end foo
diff --git a/gas/testsuite/gas/mips/pcrel-2.d b/gas/testsuite/gas/mips/pcrel-2.d
new file mode 100644
index 0000000..e1692e0
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-2.d
@@ -0,0 +1,8 @@
+#objdump: -s
+#name: Locally-resolvable PC-relative data references
+#as: -EB
+
+#...
+Contents of section \.data:
+ 0000 ff0f000e 0000000c 00000000 00000008 .*
+#pass
diff --git a/gas/testsuite/gas/mips/pcrel-2.s b/gas/testsuite/gas/mips/pcrel-2.s
new file mode 100644
index 0000000..781141e
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-2.s
@@ -0,0 +1,7 @@
+ .data
+ .byte 0xff
+ .byte frob-.
+ .half frob-.
+ .word frob-.
+ .quad frob-.
+frob:
diff --git a/gas/testsuite/gas/mips/pcrel-3.l b/gas/testsuite/gas/mips/pcrel-3.l
new file mode 100644
index 0000000..f2bfc51
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-3.l
@@ -0,0 +1,7 @@
+.*: Assembler messages:
+.*:4: Error: PC-relative reference to a different section
+.*:5: Error: PC-relative reference to a different section
+.*:6: Error: PC-relative reference to a different section
+.*:9: Error: PC-relative reference to a different section
+.*:10: Error: PC-relative reference to a different section
+.*:11: Error: PC-relative reference to a different section
diff --git a/gas/testsuite/gas/mips/pcrel-3.s b/gas/testsuite/gas/mips/pcrel-3.s
new file mode 100644
index 0000000..6db741c
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-3.s
@@ -0,0 +1,11 @@
+ .text
+ .ent func
+func:
+ lui $4,%hi(foo-.)
+ addiu $4,%lo(foo-.)
+ lw $4,%got(foo-.)($gp)
+ .end func
+
+ .byte foo-.
+ .half foo-.
+ .quad foo-.
diff --git a/gas/testsuite/gas/mips/pcrel-4-32.d b/gas/testsuite/gas/mips/pcrel-4-32.d
new file mode 100644
index 0000000..06bc52b
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-4-32.d
@@ -0,0 +1,18 @@
+#objdump: -sr
+#name: Valid cross-section PC-relative references (o32)
+#as: -32 -EB
+#source: pcrel-4.s
+
+.*: file format .*
+
+RELOCATION RECORDS FOR \[\.data\]:
+OFFSET TYPE VALUE
+00000000 R_MIPS_PC32 foo
+00000004 R_MIPS_PC32 foo
+00000008 R_MIPS_PC32 foo
+0000000c R_MIPS_PC32 foo
+
+#...
+Contents of section \.data:
+ 0000 00000000 00000004 00000008 fffffff0 ................
+#pass
diff --git a/gas/testsuite/gas/mips/pcrel-4-64.d b/gas/testsuite/gas/mips/pcrel-4-64.d
new file mode 100644
index 0000000..931ff96
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-4-64.d
@@ -0,0 +1,21 @@
+#objdump: -r
+#name: Valid cross-section PC-relative references (n64)
+#as: -64 -mips3
+#source: pcrel-4.s
+
+.*: file format .*
+
+RELOCATION RECORDS FOR \[\.data\]:
+OFFSET TYPE VALUE
+0+000 R_MIPS_PC32 foo
+0+000 R_MIPS_NONE \*ABS\*
+0+000 R_MIPS_NONE \*ABS\*
+0+004 R_MIPS_PC32 foo\+0x0+004
+0+004 R_MIPS_NONE \*ABS\*\+0x0+004
+0+004 R_MIPS_NONE \*ABS\*\+0x0+004
+0+008 R_MIPS_PC32 foo\+0x0+008
+0+008 R_MIPS_NONE \*ABS\*\+0x0+008
+0+008 R_MIPS_NONE \*ABS\*\+0x0+008
+0+00c R_MIPS_PC32 foo-0x0+010
+0+00c R_MIPS_NONE \*ABS\*-0x0+010
+0+00c R_MIPS_NONE \*ABS\*-0x0+010
diff --git a/gas/testsuite/gas/mips/pcrel-4-n32.d b/gas/testsuite/gas/mips/pcrel-4-n32.d
new file mode 100644
index 0000000..56ec6ef
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-4-n32.d
@@ -0,0 +1,13 @@
+#objdump: -r
+#name: Valid cross-section PC-relative references (n32)
+#as: -n32 -mips3
+#source: pcrel-4.s
+
+.*: file format .*
+
+RELOCATION RECORDS FOR \[\.data\]:
+OFFSET TYPE VALUE
+00000000 R_MIPS_PC32 foo
+00000004 R_MIPS_PC32 foo\+0x00000004
+00000008 R_MIPS_PC32 foo\+0x00000008
+0000000c R_MIPS_PC32 foo-0x00000010
diff --git a/gas/testsuite/gas/mips/pcrel-4.s b/gas/testsuite/gas/mips/pcrel-4.s
new file mode 100644
index 0000000..8f332dc
--- /dev/null
+++ b/gas/testsuite/gas/mips/pcrel-4.s
@@ -0,0 +1,6 @@
+ .data
+ .word foo-.
+ .word foo-(.-4)
+ .word foo+8-.
+ .word foo-.-16
+