aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-10-22 23:15:59 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-10-22 23:15:59 +0000
commitc84e5117321e3cb97f782629612f85786bbf815d (patch)
tree1561a160e70b08cede6b57a6ab0ee6d79b5714b8 /gas
parent2c0c15f9735e9a9b45a991802fe7382fe95de984 (diff)
downloadgdb-c84e5117321e3cb97f782629612f85786bbf815d.zip
gdb-c84e5117321e3cb97f782629612f85786bbf815d.tar.gz
gdb-c84e5117321e3cb97f782629612f85786bbf815d.tar.bz2
* gas/cris/rd-pcrel1.d, gas/cris/rd-pcrel1.s,
gas/cris/rd-pcrel2.d, gas/cris/rd-pcrel2.s: New tests.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/cris/rd-pcrel1.d45
-rw-r--r--gas/testsuite/gas/cris/rd-pcrel1.s55
-rw-r--r--gas/testsuite/gas/cris/rd-pcrel2.d40
-rw-r--r--gas/testsuite/gas/cris/rd-pcrel2.s60
5 files changed, 205 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d6ec0cc..383276b 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-23 Hans-Peter Nilsson <hp@axis.com>
+
+ * gas/cris/rd-pcrel1.d, gas/cris/rd-pcrel1.s,
+ gas/cris/rd-pcrel2.d, gas/cris/rd-pcrel2.s: New tests.
+
2002-10-21 Richard Sandiford <rsandifo@redhat.com>
* gas/mips/elf-rel7.[sd]: New test.
diff --git a/gas/testsuite/gas/cris/rd-pcrel1.d b/gas/testsuite/gas/cris/rd-pcrel1.d
new file mode 100644
index 0000000..4614c43
--- /dev/null
+++ b/gas/testsuite/gas/cris/rd-pcrel1.d
@@ -0,0 +1,45 @@
+#objdump: -dr
+
+.*: file format .*-cris
+
+Disassembly of section \.text:
+#...
+[ ]+28:[ ]+6fae 6e00 0000[ ]+move.d 6e <y03\+0xa>,r10
+[ ]+2e:[ ]+6fae dcff ffff[ ]+move.d 0xffffffdc,r10
+[ ]+34:[ ]+6fae 5c00 0000[ ]+move.d 5c <y01>,r10
+[ ]+3a:[ ]+6fae caff ffff[ ]+move.d 0xffffffca,r10
+[ ]+40:[ ]+6fae 5000 0000[ ]+move.d 50 <xx\+0x28>,r10
+[ ]+46:[ ]+6fae beff ffff[ ]+move.d 0xffffffbe,r10
+[ ]+4c:[ ]+3ef1 633a[ ]+move.d \[pc\+62\],r3
+[ ]+50:[ ]+b8f1 633a[ ]+move.d \[pc-72\],r3
+[ ]+54:[ ]+40f1 633a[ ]+move.d \[pc\+64\],r3
+0+58 <y00>:
+[ ]+58:[ ]+b0f1 633a[ ]+move.d \[pc-80\],r3
+0+5c <y01>:
+[ ]+5c:[ ]+38f1 633a[ ]+move.d \[pc\+56\],r3
+0+60 <y02>:
+[ ]+60:[ ]+a8f1 633a[ ]+move.d \[pc-88\],r3
+0+64 <y03>:
+#...
+[ ]+480:[ ]+5ffd 0a04 633a[ ]+move.d \[pc\+1034\],r3
+[ ]+486:[ ]+5ffd 82fb 633a[ ]+move.d \[pc-1150\],r3
+[ ]+48c:[ ]+5ffd fc03 633a[ ]+move.d \[pc\+1020\],r3
+0+492 <yy00>:
+[ ]+492:[ ]+5ffd 74fb 633a[ ]+move.d \[pc-1164\],r3
+0+498 <yy01>:
+[ ]+498:[ ]+5ffd f003 633a[ ]+move.d \[pc\+1008\],r3
+0+49e <yy02>:
+[ ]+49e:[ ]+5ffd 68fb 633a[ ]+move.d \[pc-1176\],r3
+#...
+[ ]+18f2e:[ ]+6ffd ce86 0100 633a[ ]+move.d \[pc\+186ce <yy\+0x17e42>\],r3
+[ ]+18f36:[ ]+6ffd d270 feff 633a[ ]+move.d \[pc\+fffe70d2 <z\+0xfffb5ad4>\],r3
+[ ]+18f3e:[ ]+6ffd ba86 0100 633a[ ]+move.d \[pc\+186ba <yy\+0x17e2e>\],r3
+0+18f46 <z00>:
+[ ]+18f46:[ ]+6ffd be70 feff 633a[ ]+move.d \[pc\+fffe70be <z\+0xfffb5ac0>\],r3
+0+18f4e <z01>:
+[ ]+18f4e:[ ]+6ffd aa86 0100 633a[ ]+move.d \[pc\+186aa <yy\+0x17e1e>\],r3
+0+18f56 <z02>:
+[ ]+18f56:[ ]+6ffd ae70 feff 633a[ ]+move.d \[pc\+fffe70ae <z\+0xfffb5ab0>\],r3
+#...
+0+315fe <z>:
+[ ]+315fe:[ ]+0f05[ ]+nop
diff --git a/gas/testsuite/gas/cris/rd-pcrel1.s b/gas/testsuite/gas/cris/rd-pcrel1.s
new file mode 100644
index 0000000..3920f4b
--- /dev/null
+++ b/gas/testsuite/gas/cris/rd-pcrel1.s
@@ -0,0 +1,55 @@
+; Test that pc-relative expressions give expected results for
+; various expressions.
+ .text
+ .space 10
+x:
+ .space 30
+xx:
+ move.d y-.,r10
+ move.d x-.,r10
+ move.d y-(.+6),r10
+ move.d x-(.+6),r10
+ move.d y-.-6,r10
+ move.d x-.-6,r10
+ move.d [pc+y-(.+12)],r3
+ move.d [pc+x-(.+2)],r3
+ move.d [pc+y-(y00-2)],r3
+y00:
+ move.d [pc+x-(y01-2)],r3
+y01:
+ move.d [pc+y-y02+2],r3
+y02:
+ move.d [pc+x-y03+2],r3
+y03:
+ .space 50
+y:
+ nop
+ .space 1000
+ move.d [pc+yy-(.+2)],r3
+ move.d [pc+x-(.+2)],r3
+ move.d [pc+yy-(yy00-2)],r3
+yy00:
+ move.d [pc+x-(yy01-2)],r3
+yy01:
+ move.d [pc+yy-yy02+2],r3
+yy02:
+ move.d [pc+x-yy03+2],r3
+yy03:
+ .space 1000
+yy:
+ nop
+ .space 100000
+ move.d [pc+z-(.+2)],r3
+ move.d [pc+x-(.+2)],r3
+ move.d [pc+z-(z00-2)],r3
+z00:
+ move.d [pc+x-(z01-2)],r3
+z01:
+ move.d [pc+z-z02+2],r3
+z02:
+ move.d [pc+x-z03+2],r3
+z03:
+ .space 100000
+z:
+ nop
+
diff --git a/gas/testsuite/gas/cris/rd-pcrel2.d b/gas/testsuite/gas/cris/rd-pcrel2.d
new file mode 100644
index 0000000..6359865
--- /dev/null
+++ b/gas/testsuite/gas/cris/rd-pcrel2.d
@@ -0,0 +1,40 @@
+#objdump: -dr
+
+.*: file format .*-cris
+
+Disassembly of section \.text:
+
+0+ <z>:
+[ ]+0:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8
+[ ]+4:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8
+[ ]+a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8
+[ ]+e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8
+[ ]+14:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8
+[ ]+1a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd <x8\+0xffff7f9d>\],r8
+[ ]+22:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8
+[ ]+28:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 <x8\+0x7fa2>\],r8
+0+30 <x>:
+[ ]+30:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8
+0+34 <x1>:
+[ ]+34:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8
+0+3a <x2>:
+[ ]+3a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8
+0+3e <x3>:
+[ ]+3e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8
+0+44 <x4>:
+[ ]+44:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8
+0+4a <x5>:
+[ ]+4a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd <x8\+0xffff7f9d>\],r8
+0+52 <x6>:
+[ ]+52:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8
+0+58 <x7>:
+[ ]+58:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 <x8\+0x7fa2>\],r8
+0+60 <x8>:
+[ ]+60:[ ]+80f1 688a[ ]+move.d \[pc-128\],r8
+[ ]+64:[ ]+5ffd 7dff 688a[ ]+move.d \[pc-131\],r8
+[ ]+6a:[ ]+7ff1 688a[ ]+move.d \[pc\+127\],r8
+[ ]+6e:[ ]+5ffd 8200 688a[ ]+move.d \[pc\+130\],r8
+[ ]+74:[ ]+5ffd 0080 688a[ ]+move.d \[pc-32768\],r8
+[ ]+7a:[ ]+6ffd fd7f ffff 688a[ ]+move.d \[pc\+ffff7ffd <x8\+0xffff7f9d>\],r8
+[ ]+82:[ ]+5ffd ff7f 688a[ ]+move.d \[pc\+32767\],r8
+[ ]+88:[ ]+6ffd 0280 0000 688a[ ]+move.d \[pc\+8002 <x8\+0x7fa2>\],r8
diff --git a/gas/testsuite/gas/cris/rd-pcrel2.s b/gas/testsuite/gas/cris/rd-pcrel2.s
new file mode 100644
index 0000000..922560a
--- /dev/null
+++ b/gas/testsuite/gas/cris/rd-pcrel2.s
@@ -0,0 +1,60 @@
+; Test border-cases for relaxation of pc-relative expressions.
+
+ .macro relaxcode
+ .endm
+
+ .text
+
+; Region of relaxation is after insn, same segment
+z:
+ move.d [pc-(x1-x+128-4)],r8 ; 4
+ move.d [pc-(x2-x+129-8)],r8 ; 6
+ move.d [pc+x3-x+127-14],r8 ; 4
+ move.d [pc+x4-x+128-18],r8 ; 6
+ move.d [pc-(x5-x+32768-26)],r8 ; 6
+ move.d [pc-(x6-x+32769-32)],r8 ; 8
+ move.d [pc+x7-x+32767-40],r8 ; 6
+ move.d [pc+x8-x+32768-46],r8 ; 8
+
+ .p2align 1
+
+; Region of relaxation is around insn, same segment
+x:
+ move.d [pc-(x1-x+128-4)],r8 ; 4
+x1:
+ move.d [pc-(x2-x+129-8)],r8 ; 6
+x2:
+ move.d [pc+x3-x+127-14],r8 ; 4
+x3:
+ move.d [pc+x4-x+128-18],r8 ; 6
+x4:
+ move.d [pc-(x5-x+32768-26)],r8 ; 6
+x5:
+ move.d [pc-(x6-x+32769-32)],r8 ; 8
+x6:
+ move.d [pc+x7-x+32767-40],r8 ; 6
+x7:
+ move.d [pc+x8-x+32768-46],r8 ; 8
+x8:
+
+; Region of relaxation is before insn, same segment.
+ move.d [pc-(x1-x+128-4)],r8 ; 4
+ move.d [pc-(x2-x+129-8)],r8 ; 6
+ move.d [pc+x3-x+127-14],r8 ; 4
+ move.d [pc+x4-x+128-18],r8 ; 6
+ move.d [pc-(x5-x+32768-26)],r8 ; 6
+ move.d [pc-(x6-x+32769-32)],r8 ; 8
+ move.d [pc+x7-x+32767-40],r8 ; 6
+ move.d [pc+x8-x+32768-46],r8 ; 8
+
+; Region of relaxation is in other segment.
+ .section .text.other
+y:
+ move.d [pc-(x1-x+128-4)],r8 ; 4
+ move.d [pc-(x2-x+129-8)],r8 ; 6
+ move.d [pc+x3-x+127-14],r8 ; 4
+ move.d [pc+x4-x+128-18],r8 ; 6
+ move.d [pc-(x5-x+32768-26)],r8 ; 6
+ move.d [pc-(x6-x+32769-32)],r8 ; 8
+ move.d [pc+x7-x+32767-40],r8 ; 6
+ move.d [pc+x8-x+32768-46],r8 ; 8