aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2002-09-18 21:33:07 +0000
committerChris Demetriou <cgd@google.com>2002-09-18 21:33:07 +0000
commit885add9520d0f5e7eab8d56b93d791064805657d (patch)
tree7cd456ff9e73466bf46a1263cf6b765a78d7bafd /gas/testsuite
parent65551fa46cc1ef69a04fe817c221c3949a56c139 (diff)
downloadgdb-885add9520d0f5e7eab8d56b93d791064805657d.zip
gdb-885add9520d0f5e7eab8d56b93d791064805657d.tar.gz
gdb-885add9520d0f5e7eab8d56b93d791064805657d.tar.bz2
[ gas/ChangeLog ]
2002-09-18 Chris Demetriou <cgd@broadcom.com> * config/tc-mips.c (IS_SEXT_32BIT_NUM): Move closer to top of file. (IS_SEXT_16BIT_NUM): New macro. (macro_build_ldst_constoffset): New function, to build a set of instructions to do a load or store from a constant offset relative to a given register. (macro, s_cprestore): Use macro_build_ldst_constoffset to implement .cprestore pseudo-op. [ gas/testsuite/ChangeLog ] 2002-09-18 Chris Demetriou <cgd@broadcom.com> * gas/mips/mips-abi32-pic2.s: New file. * gas/mips/mips-abi32-pic2.d: New file. * gas/mips/mips.exp: Run new test. [ plus, fixed date on prev. gas/testsuite/ChangeLog entry. ]
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/mips/mips-abi32-pic2.d74
-rw-r--r--gas/testsuite/gas/mips/mips-abi32-pic2.s107
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
4 files changed, 189 insertions, 1 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 7ab5e58..6ba6567 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,4 +1,10 @@
-2002-09-12 Chris Demetriou <cgd@broadcom.com>
+2002-09-18 Chris Demetriou <cgd@broadcom.com>
+
+ * gas/mips/mips-abi32-pic2.s: New file.
+ * gas/mips/mips-abi32-pic2.d: New file.
+ * gas/mips/mips.exp: Run new test.
+
+2002-09-18 Chris Demetriou <cgd@broadcom.com>
* gas/mips/baddata1.s: New file.
* gas/mips/baddata1.l: New file.
diff --git a/gas/testsuite/gas/mips/mips-abi32-pic2.d b/gas/testsuite/gas/mips/mips-abi32-pic2.d
new file mode 100644
index 0000000..1f3811e
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips-abi32-pic2.d
@@ -0,0 +1,74 @@
+#objdump: -d -mmips:8000 -r --prefix-addresses --show-raw-insn
+#as: -march=8000 -EB -mabi=32 -KPIC
+#name: MIPS -mabi=32 test 2 (SVR4 PIC)
+
+.*: +file format.*
+
+Disassembly of section \.text:
+0+000 <[^>]*> 3c1c0000 lui gp,0x0
+ 0: R_MIPS_HI16 _gp_disp
+0+004 <[^>]*> 279c0000 addiu gp,gp,0
+ 4: R_MIPS_LO16 _gp_disp
+0+008 <[^>]*> 0399e021 addu gp,gp,t9
+0+00c <[^>]*> afbc0008 sw gp,8\(sp\)
+0+010 <[^>]*> 8f990000 lw t9,0\(gp\)
+ 10: R_MIPS_GOT16 \.text
+0+014 <[^>]*> 00000000 nop
+0+018 <[^>]*> 273900d8 addiu t9,t9,216
+ 18: R_MIPS_LO16 \.text
+0+01c <[^>]*> 0320f809 jalr t9
+0+020 <[^>]*> 00000000 nop
+0+024 <[^>]*> 8fbc0008 lw gp,8\(sp\)
+0+028 <[^>]*> 00000000 nop
+0+02c <[^>]*> 0320f809 jalr t9
+0+030 <[^>]*> 00000000 nop
+0+034 <[^>]*> 8fbc0008 lw gp,8\(sp\)
+0+038 <[^>]*> 3c1c0000 lui gp,0x0
+ 38: R_MIPS_HI16 _gp_disp
+0+03c <[^>]*> 279c0000 addiu gp,gp,0
+ 3c: R_MIPS_LO16 _gp_disp
+0+040 <[^>]*> 0399e021 addu gp,gp,t9
+0+044 <[^>]*> 3c010001 lui at,0x1
+0+048 <[^>]*> 003d0821 addu at,at,sp
+0+04c <[^>]*> ac3c8000 sw gp,-32768\(at\)
+0+050 <[^>]*> 8f990000 lw t9,0\(gp\)
+ 50: R_MIPS_GOT16 \.text
+0+054 <[^>]*> 00000000 nop
+0+058 <[^>]*> 273900d8 addiu t9,t9,216
+ 58: R_MIPS_LO16 \.text
+0+05c <[^>]*> 0320f809 jalr t9
+0+060 <[^>]*> 00000000 nop
+0+064 <[^>]*> 3c010001 lui at,0x1
+0+068 <[^>]*> 003d0821 addu at,at,sp
+0+06c <[^>]*> 8c3c8000 lw gp,-32768\(at\)
+0+070 <[^>]*> 00000000 nop
+0+074 <[^>]*> 0320f809 jalr t9
+0+078 <[^>]*> 00000000 nop
+0+07c <[^>]*> 3c010001 lui at,0x1
+0+080 <[^>]*> 003d0821 addu at,at,sp
+0+084 <[^>]*> 8c3c8000 lw gp,-32768\(at\)
+0+088 <[^>]*> 3c1c0000 lui gp,0x0
+ 88: R_MIPS_HI16 _gp_disp
+0+08c <[^>]*> 279c0000 addiu gp,gp,0
+ 8c: R_MIPS_LO16 _gp_disp
+0+090 <[^>]*> 0399e021 addu gp,gp,t9
+0+094 <[^>]*> 3c010001 lui at,0x1
+0+098 <[^>]*> 003d0821 addu at,at,sp
+0+09c <[^>]*> ac3c0000 sw gp,0\(at\)
+0+0a0 <[^>]*> 8f990000 lw t9,0\(gp\)
+ a0: R_MIPS_GOT16 \.text
+0+0a4 <[^>]*> 00000000 nop
+0+0a8 <[^>]*> 273900d8 addiu t9,t9,216
+ a8: R_MIPS_LO16 \.text
+0+0ac <[^>]*> 0320f809 jalr t9
+0+0b0 <[^>]*> 00000000 nop
+0+0b4 <[^>]*> 3c010001 lui at,0x1
+0+0b8 <[^>]*> 003d0821 addu at,at,sp
+0+0bc <[^>]*> 8c3c0000 lw gp,0\(at\)
+0+0c0 <[^>]*> 00000000 nop
+0+0c4 <[^>]*> 0320f809 jalr t9
+0+0c8 <[^>]*> 00000000 nop
+0+0cc <[^>]*> 3c010001 lui at,0x1
+0+0d0 <[^>]*> 003d0821 addu at,at,sp
+0+0d4 <[^>]*> 8c3c0000 lw gp,0\(at\)
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/mips-abi32-pic2.s b/gas/testsuite/gas/mips/mips-abi32-pic2.s
new file mode 100644
index 0000000..3e22e26
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips-abi32-pic2.s
@@ -0,0 +1,107 @@
+
+ .text
+ .ent func1
+func1:
+ .frame $sp,0,$31
+ .set noreorder
+ .cpload $25 # 0000 lui gp,hi(_gp_disp)
+ # 0004 addiu gp,gp,lo(_gp_disp)
+ # 0008 addu gp,gp,t9
+ .set reorder
+ .cprestore 8 # 000c sw gp,8(sp)
+
+ jal end # 0010 lw t9,got(.text)(gp)
+ # 0014 nop
+ # 0018 addiu t9,t9,lo(end)
+ # 001c jalr t9
+ # 0020 nop
+ # 0024 lw gp,8(sp)
+
+ # Avoid confusion: avoid the 'lw' above being put into the delay
+ # slot for the jalr below!
+ .set noreorder
+ nop # 0028 nop
+ .set reorder
+
+ jal $25 # 002c jalr t9
+ # 0030 nop
+ # 0034 lw gp,8(sp)
+ .end func1
+
+
+ .text
+ .ent func2
+func2:
+ .frame $sp,0,$31
+ .set noreorder
+ .cpload $25 # 0038 lui gp,hi(_gp_disp)
+ # 003c addiu gp,gp,lo(_gp_disp)
+ # 0040 addu gp,gp,t9
+ .set reorder
+ .cprestore 32768 # 0044 lui at,0x1
+ # 0048 addu at,at,sp
+ # 004c sw gp,-32768(at)
+
+ jal end # 0050 lw t9,got(.text)(gp)
+ # 0054 nop
+ # 0058 addiu t9,t9,lo(end)
+ # 005c jalr t9
+ # 0060 nop
+ # 0064 lui at,0x1
+ # 0068 addu at,at,sp
+ # 006c lw gp,-32768(at)
+
+ # Avoid confusion: avoid the 'lw' above being put into the delay
+ # slot for the jalr below!
+ .set noreorder
+ nop # 0070 nop
+ .set reorder
+
+ jal $25 # 0074 jalr t9
+ # 0078 nop
+ # 007c lui at,0x1
+ # 0080 addu at,at,sp
+ # 0084 lw gp,-32768(at)
+ .end func2
+
+
+ .text
+ .ent func3
+func3:
+ .frame $sp,0,$31
+ .set noreorder
+ .cpload $25 # 0088 lui gp,hi(_gp_disp)
+ # 008c addiu gp,gp,lo(_gp_disp)
+ # 0090 addu gp,gp,t9
+ .set reorder
+ .cprestore 65536 # 0094 lui at,0x1
+ # 0098 addu at,at,sp
+ # 009c sw gp,0(at)
+
+ jal end # 00a0 lw t9,got(.text)(gp)
+ # 00a4 nop
+ # 00a8 addiu t9,t9,lo(end)
+ # 00ac jalr t9
+ # 00b0 nop
+ # 00b4 lui at,0x1
+ # 00b8 addu at,at,sp
+ # 00bc lw gp,0(at)
+
+ # Avoid confusion: avoid the 'lw' above being put into the delay
+ # slot for the jalr below!
+ .set noreorder
+ nop # 00c0 nop
+ .set reorder
+
+ jal $25 # 00c4 jalr t9
+ # 00c8 nop
+ # 00cc lui at,0x1
+ # 00d0 addu at,at,sp
+ # 00d4 lw gp,0(at)
+
+ .end func3
+
+end:
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 12613ea..d23390d 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -193,6 +193,7 @@ if { [istarget mips*-*-*] } then {
run_dump_test "mips-abi32"
run_dump_test "mips-abi32-pic"
+ run_dump_test "mips-abi32-pic2"
run_dump_test "elf${el}-rel"
if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*]