]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This commit was manufactured by cvs2svn to create branch 'binutils-
authornobody <>
Mon, 14 Nov 2011 13:43:24 +0000 (13:43 +0000)
committernobody <>
Mon, 14 Nov 2011 13:43:24 +0000 (13:43 +0000)
2_22-branch'.

Cherrypick from master 2011-11-14 13:43:23 UTC Maciej W. Rozycki <macro@linux-mips.org> ' gas/':
    gas/testsuite/gas/mips/micromips@relax-swap3.d
    gas/testsuite/gas/mips/mips16@relax-swap3.d
    gas/testsuite/gas/mips/relax-swap3.d
    gas/testsuite/gas/mips/relax-swap3.s

gas/testsuite/gas/mips/micromips@relax-swap3.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16@relax-swap3.d [new file with mode: 0644]
gas/testsuite/gas/mips/relax-swap3.d [new file with mode: 0644]
gas/testsuite/gas/mips/relax-swap3.s [new file with mode: 0644]

diff --git a/gas/testsuite/gas/mips/micromips@relax-swap3.d b/gas/testsuite/gas/mips/micromips@relax-swap3.d
new file mode 100644 (file)
index 0000000..d84d386
--- /dev/null
@@ -0,0 +1,22 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS relaxed macro with branch swapping
+#as: -32
+#source: relax-swap3.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 41a2 0000    lui     v0,0x0
+[      ]*[0-9a-f]+: R_MICROMIPS_HI16   bar
+[0-9a-f]+ <[^>]*> 3042 0000    addiu   v0,v0,0
+[      ]*[0-9a-f]+: R_MICROMIPS_LO16   bar
+[0-9a-f]+ <[^>]*> 4583         jr      v1
+[0-9a-f]+ <[^>]*> 0c00         nop
+[0-9a-f]+ <[^>]*> 41a2 0000    lui     v0,0x0
+[      ]*[0-9a-f]+: R_MICROMIPS_HI16   bar
+[0-9a-f]+ <[^>]*> 3042 0000    addiu   v0,v0,0
+[      ]*[0-9a-f]+: R_MICROMIPS_LO16   bar
+[0-9a-f]+ <[^>]*> 8dff         beqz    v1,[0-9a-f]+ <[^>]*>
+[      ]*[0-9a-f]+: R_MICROMIPS_PC7_S1 .*
+[0-9a-f]+ <[^>]*> 0c00         nop
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/mips16@relax-swap3.d b/gas/testsuite/gas/mips/mips16@relax-swap3.d
new file mode 100644 (file)
index 0000000..49949b4
--- /dev/null
@@ -0,0 +1,15 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS relaxed macro with branch swapping
+#as: -32
+#source: relax-swap3.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 0a00         la      v0,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> eb00         jr      v1
+[0-9a-f]+ <[^>]*> 6500         nop
+[0-9a-f]+ <[^>]*> f7ff 0a1c    la      v0,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 2300         beqz    v1,[0-9a-f]+ <[^>]*>
+       \.\.\.
+#pass
diff --git a/gas/testsuite/gas/mips/relax-swap3.d b/gas/testsuite/gas/mips/relax-swap3.d
new file mode 100644 (file)
index 0000000..fcc509b
--- /dev/null
@@ -0,0 +1,21 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS relaxed macro with branch swapping
+#as: -32
+#source: relax-swap3.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 3c020000     lui     v0,0x0
+[      ]*[0-9a-f]+: R_MIPS_HI16        bar
+[0-9a-f]+ <[^>]*> 24420000     addiu   v0,v0,0
+[      ]*[0-9a-f]+: R_MIPS_LO16        bar
+[0-9a-f]+ <[^>]*> 00600008     jr      v1
+[0-9a-f]+ <[^>]*> 00000000     nop
+[0-9a-f]+ <[^>]*> 3c020000     lui     v0,0x0
+[      ]*[0-9a-f]+: R_MIPS_HI16        bar
+[0-9a-f]+ <[^>]*> 24420000     addiu   v0,v0,0
+[      ]*[0-9a-f]+: R_MIPS_LO16        bar
+[0-9a-f]+ <[^>]*> 10600001     beqz    v1,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 00000000     nop
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/relax-swap3.s b/gas/testsuite/gas/mips/relax-swap3.s
new file mode 100644 (file)
index 0000000..497ecf8
--- /dev/null
@@ -0,0 +1,14 @@
+# Source file used to check the lack of branch swapping with a relaxed macro.
+
+       .text
+foo:
+       la      $2, bar
+       jr      $3
+
+       la      $2, bar
+       beqz    $3, 0f
+0:
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  2
+       .space  8