diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2002-02-06 06:18:28 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2002-02-06 06:18:28 +0000 |
commit | e93c640ed29c9e5828e2a202ec41f8e3a2827e38 (patch) | |
tree | 880d53ba9fa0ec501f3b12e2edb64f5198d004a7 /gas | |
parent | ac3f04d7f1675e0b9e86265226541df58a763357 (diff) | |
download | fsf-binutils-gdb-e93c640ed29c9e5828e2a202ec41f8e3a2827e38.zip fsf-binutils-gdb-e93c640ed29c9e5828e2a202ec41f8e3a2827e38.tar.gz fsf-binutils-gdb-e93c640ed29c9e5828e2a202ec41f8e3a2827e38.tar.bz2 |
* gas/sh/pic.d, gas/sh/pic.s: New test.
* gas/sh/basic.exp: Run it.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/sh/basic.exp | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/sh/pic.d | 40 | ||||
-rw-r--r-- | gas/testsuite/gas/sh/pic.s | 41 |
4 files changed, 90 insertions, 3 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 80a5417..6624ee8 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,12 +1,16 @@ +2002-02-06 Alexandre Oliva <aoliva@redhat.com> + + * gas/sh/pic.d, gas/sh/pic.s: New test. + * gas/sh/basic.exp: Run it. + 2002-02-05 Alan Modra <amodra@bigpond.net.au> * gas/ppc/test1elf64.d: Tweak arch name. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> - * gas/testsuite/gas/sh/pcrel.d: New test. - * gas/testsuite/gas/sh/pcrel.s: Sources for new test. - * gas/testsuite/gas/sh/basic.exp: Run it. + * gas/sh/pcrel.d, gas/sh/pcrel.s: New test. + * gas/sh/basic.exp: Run it. 2002-02-04 Hans-Peter Nilsson <hp@bitrange.com> diff --git a/gas/testsuite/gas/sh/basic.exp b/gas/testsuite/gas/sh/basic.exp index c606dea..d68ac0a 100644 --- a/gas/testsuite/gas/sh/basic.exp +++ b/gas/testsuite/gas/sh/basic.exp @@ -91,5 +91,7 @@ if [istarget sh*-*-*] then { # Test DSP instructions run_dump_test "dsp" + run_dump_test "pic" + run_dump_test "pcrel" } diff --git a/gas/testsuite/gas/sh/pic.d b/gas/testsuite/gas/sh/pic.d new file mode 100644 index 0000000..f4ac775 --- /dev/null +++ b/gas/testsuite/gas/sh/pic.d @@ -0,0 +1,40 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#name: SH PIC constructs +# Test SH PIC constructs: + +.*: file format elf.*sh.* + +Disassembly of section \.text: +0x00000000 c7 0a mova 0x0000002c,r0 +0x00000002 dc 0a mov\.l 0x0000002c,r12 ! 0x0 +0x00000004 3c 0c add r0,r12 +0x00000006 d0 0a mov\.l 0x00000030,r0 ! 0x0 +0x00000008 00 ce mov\.l @\(r0,r12\),r0 +0x0000000a 40 0b jsr @r0 +0x0000000c 00 09 nop +0x0000000e d0 09 mov\.l 0x00000034,r0 ! 0x0 +0x00000010 30 cc add r12,r0 +0x00000012 40 0b jsr @r0 +0x00000014 00 09 nop +0x00000016 d1 08 mov\.l 0x00000038,r1 ! 0x0 +0x00000018 c7 07 mova 0x00000038,r0 +0x0000001a 30 1c add r1,r0 +0x0000001c 40 0b jsr @r0 +0x0000001e 00 09 nop +0x00000020 d0 06 mov\.l 0x0000003c,r0 ! 0x16 +0x00000022 40 0b jsr @r0 +0x00000024 00 09 nop +0x00000026 d0 06 mov\.l 0x00000040,r0 ! 0x14 +0x00000028 40 0b jsr @r0 +0x0000002a 00 09 nop + \.\.\. + 2c: R_SH_DIR32 GLOBAL_OFFSET_TABLE + 30: R_SH_GOT32 foo + 34: R_SH_GOTOFF foo + 38: R_SH_PLT32 foo +0x0000003c 00 00 \.word 0x0000 + 3c: R_SH_PLT32 foo +0x0000003e 00 16 mov\.l r1,@\(r0,r0\) +0x00000040 00 00 \.word 0x0000 + 40: R_SH_PLT32 foo +0x00000042 00 14 mov\.b r1,@\(r0,r0\) diff --git a/gas/testsuite/gas/sh/pic.s b/gas/testsuite/gas/sh/pic.s new file mode 100644 index 0000000..6e0c53e --- /dev/null +++ b/gas/testsuite/gas/sh/pic.s @@ -0,0 +1,41 @@ + .text + .align + + mova .Lgot, r0 + mov.l .Lgot, r12 + add r0, r12 + mov.l .Lfoogot, r0 + mov.l @(r0,r12), r0 + jsr @r0 + nop + mov.l .Lfoogotoff, r0 + add r12, r0 + jsr @r0 + nop + mov.l .Lfooplt, r1 + mova .Lfooplt, r0 + add r1, r0 + jsr @r0 + nop + mov.l .Lfooplt_old, r0 + jsr @r0 +.LPLTcall_old: + nop + mov.l .Lfooplt_new, r0 + jsr @r0 +.LPLTcall_new: + nop + + .p2align 2 +.Lgot: + .long GLOBAL_OFFSET_TABLE +.Lfoogot: + .long foo@GOT +.Lfoogotoff: + .long foo@GOTOFF +.Lfooplt: + .long foo@PLT +.Lfooplt_old: + .long foo@PLT + . - (.LPLTcall_old + 2) +.Lfooplt_new: + .long foo@PLT - (.LPLTcall_new + 2 - .) |