From 32a96f364b9e54a5f42d8367ef770efead63cd50 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 7 Feb 2011 00:04:09 +0000 Subject: [PATCH] PR gas/3041 * gas/m68k/p3041pcrel.s, * gas/m68k/p3041pcrel.d: New test. * gas/m68k/all.exp: Add "p3041pcrel" and enable p3041 tests for all m68k-aout targets. --- gas/testsuite/ChangeLog | 7 ++++++ gas/testsuite/gas/m68k/all.exp | 3 ++- gas/testsuite/gas/m68k/p3041pcrel.d | 38 +++++++++++++++++++++++++++++ gas/testsuite/gas/m68k/p3041pcrel.s | 28 +++++++++++++++++++++ 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/m68k/p3041pcrel.d create mode 100644 gas/testsuite/gas/m68k/p3041pcrel.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 412fbc0436e..166d8db22ed 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-02-07 Vincent Riviere + + PR gas/3041 + * gas/m68k/p3041pcrel.s, * gas/m68k/p3041pcrel.d: New test. + * gas/m68k/all.exp: Add "p3041pcrel" and enable p3041 tests for + all m68k-aout targets. + 2011-02-04 Bernd Schmidt * gas/tic6x/dir-junk.l: Remove tests for .atomic and .noatomic. diff --git a/gas/testsuite/gas/m68k/all.exp b/gas/testsuite/gas/m68k/all.exp index f4bdfa77459..b3db085a678 100644 --- a/gas/testsuite/gas/m68k/all.exp +++ b/gas/testsuite/gas/m68k/all.exp @@ -71,9 +71,10 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then { gas_test_error "p11673.s" "-march=isab" "movel immediate with offset unsupported on isab" - if { [istarget *-*-netbsd] } then { + if { [istarget *-*-*aout] || [istarget *-*-netbsd] || [istarget *-*-openbsd*] } then { run_dump_test p3041 run_dump_test p3041data + run_dump_test p3041pcrel } set testname "68000 operands" diff --git a/gas/testsuite/gas/m68k/p3041pcrel.d b/gas/testsuite/gas/m68k/p3041pcrel.d new file mode 100644 index 00000000000..91168cc9cd7 --- /dev/null +++ b/gas/testsuite/gas/m68k/p3041pcrel.d @@ -0,0 +1,38 @@ +#name: PR 3041 pcrel +#as: -m68000 +#objdump: -tdr + +.*: file format .* + +SYMBOL TABLE: +00000024 w \.text 0000 00 0f mytext +0000002e w \.data 0000 00 10 mydata +0000003a w \.bss 0000 00 11 mybss + +Disassembly of section \.text: + +00000000 <.*>: + 0: 41fa fffe lea %pc@\(0 <.*>\),%a0 + 2: DISP16 mytext + 4: 41fa fffc lea %pc@\(2 <.*>\),%a0 + 6: DISP16 mytext + 8: 41fa fff2 lea %pc@\(fffffffc <.*>\),%a0 + a: DISP16 mytext + c: 41fa fff2 lea %pc@\(0 <.*>\),%a0 + e: DISP16 mydata + 10: 41fa fff1 lea %pc@\(3 <.*>\),%a0 + 12: DISP16 mydata + 14: 41fa ffe9 lea %pc@\(ffffffff <.*>\),%a0 + 16: DISP16 mydata + 18: 41fa ffe6 lea %pc@\(0 <.*>\),%a0 + 1a: DISP16 mybss + 1c: 41fa ffe3 lea %pc@\(1 <.*>\),%a0 + 1e: DISP16 mybss + 20: 41fa ffdc lea %pc@\(fffffffe <.*>\),%a0 + 22: DISP16 mybss + +00000024 : + 24: 4e71 nop + 26: 4e71 nop + 28: 4e71 nop + 2a: 4e71 nop diff --git a/gas/testsuite/gas/m68k/p3041pcrel.s b/gas/testsuite/gas/m68k/p3041pcrel.s new file mode 100644 index 00000000000..59d61ead42c --- /dev/null +++ b/gas/testsuite/gas/m68k/p3041pcrel.s @@ -0,0 +1,28 @@ + lea mytext(%pc),%a0 + lea mytext+2(%pc),%a0 + lea mytext-4(%pc),%a0 + lea mydata(%pc),%a0 + lea mydata+3(%pc),%a0 + lea mydata-1(%pc),%a0 + lea mybss(%pc),%a0 + lea mybss+1(%pc),%a0 + lea mybss-2(%pc),%a0 + .weak mytext +mytext: + nop + nop + nop + nop + + .data + .word 0x8081 + .weak mydata +mydata: + .word 0x8283 + .word 0x8485 + + .bss + .skip 6 + .weak mybss +mybss: + .skip 2 -- 2.30.2