+2003-10-18 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * ld-mmix/greg-14.d, ld-mmix/greg-5.d, ld-mmix/pushja1b.d,
+ ld-mmix/pushja1f.d, ld-mmix/pushja7b.d, ld-mmix/pushja7f.d: Pass
+ --no-pushj-stubs to the assembler.
+ * ld-mmix/pushjs2b.d, ld-mmix/greg-14s.d, ld-mmix/pushjs1.d,
+ ld-mmix/greg-5s.d, ld-mmix/pushjs3b.d, ld-mmix/pushja1f-s.d,
+ ld-mmix/pushjs1m.d, ld-mmix/pushja7b-s.d, ld-mmix/pushja7f-s.d,
+ ld-mmix/pushja1b-s.d, ld-mmix/pushjs2.d, ld-mmix/pushjs3.d,
+ ld-mmix/pushjs4b.d, ld-mmix/pushjs4.d, ld-mmix/pushjs1bm.d,
+ ld-mmix/pushjs1b.d, ld-mmix/pushjs2m.d, ld-mmix/pushjs1r.d,
+ ld-mmix/pushjs3m.d, ld-mmix/pushjs2bm.d, ld-mmix/pushjs4m.d,
+ ld-mmix/pushjs3bm.d, ld-mmix/pushjs2r.d, ld-mmix/pushjs4bm.d,
+ ld-mmix/pushjs3r.d, ld-mmix/pushjs4r.d: New tests.
+
2003-10-15 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* ld-sh/sh64/rd-sh64.exp: If the test matches *-dso.d, copy
#source: gregpsj1.s
#source: start.s
#source: a.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m mmo
#objdump: -dt
--- /dev/null
+#source: greg-1.s
+#source: gregpsj1.s
+#source: start.s
+#source: a.s
+#as: -x
+#ld: -m mmo
+#objdump: -dt
+
+# Like greg-14, but using PUSHJ stubs.
+
+.*: file format mmo
+SYMBOL TABLE:
+0+4 g \.text Main
+0+4 g \.text _start
+0+fe g \*REG\* areg
+0+8 g \.text a
+Disassembly of section \.text:
+0+ <(Main|_start)-0x4>:
+ 0: f2fe0002 pushj areg,8 <a>
+0+4 <(Main|_start)>:
+ 4: e3fd0001 setl \$253,0x1
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
#source: gregpsj1.s
#source: start.s
#source: a.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m elf64mmix
#objdump: -dt
--- /dev/null
+#source: greg-1.s
+#source: gregpsj1.s
+#source: start.s
+#source: a.s
+#as: -x
+#ld: -m elf64mmix
+#objdump: -dt
+
+# Like greg-3, but a different expanding insn.
+
+.*: file format elf64-mmix
+SYMBOL TABLE:
+0+ l d .text 0+
+2000000000000000 l d .data 0+
+2000000000000000 l d .sbss 0+
+2000000000000000 l d .bss 0+
+0+7f0 l d \.MMIX\.reg_contents 0+
+0+ l d \*ABS\* 0+
+0+ l d \*ABS\* 0+
+0+ l d \*ABS\* 0+
+0+4 g \.text 0+ _start
+0+fe g \*REG\* 0+ areg
+#...
+0+8 g \.text 0+ a
+Disassembly of section \.text:
+0+ <_start-0x4>:
+ 0: f2fe0002 pushj \$254,8 <a>
+0+4 <_start>:
+ 4: e3fd0001 setl \$253,0x1
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
--- /dev/null
+#source: start.s
+#source: a.s
+#source: pushja.s
+#as: -x
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Like pushja1b but with PUSHJ stub.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <_start>:
+ 0: e3fd0001 setl \$253,0x1
+0+4 <a>:
+ 4: e3fd0004 setl \$253,0x4
+0+8 <pushja>:
+ 8: e3fd0002 setl \$253,0x2
+ c: f30cfffe pushj \$12,4 <a>
+ 10: e3fd0003 setl \$253,0x3
#source: start.s
#source: a.s
#source: pushja.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m elf64mmix
#objdump: -dr
--- /dev/null
+#source: start.s
+#source: pushja.s
+#source: a.s
+#as: -x
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Like pushja1f, but with PUSHJ stub.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <_start>:
+ 0: e3fd0001 setl \$253,0x1
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <a>
+ c: e3fd0003 setl \$253,0x3
+0+10 <a>:
+ 10: e3fd0004 setl \$253,0x4
#source: start.s
#source: pushja.s
#source: a.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m elf64mmix
#objdump: -dr
--- /dev/null
+#source: start.s
+#source: a.s
+#source: pushja.s
+#as: -x
+#ld: -m mmo
+#objdump: -dr
+
+# Like pushja7b, but with PUSHJ stub.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <(Main|_start)>:
+ 0: e3fd0001 setl \$253,0x1
+0+4 <a>:
+ 4: e3fd0004 setl \$253,0x4
+0+8 <pushja>:
+ 8: e3fd0002 setl \$253,0x2
+ c: f30cfffe pushj \$12,4 <a>
+ 10: e3fd0003 setl \$253,0x3
#source: start.s
#source: a.s
#source: pushja.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m mmo
#objdump: -dr
--- /dev/null
+#source: start.s
+#source: pushja.s
+#source: a.s
+#as: -x
+#ld: -m mmo
+#objdump: -dr
+
+# Like pushja7f, but with PUSHJ stub.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <(Main|_start)>:
+ 0: e3fd0001 setl \$253,0x1
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <a>
+ c: e3fd0003 setl \$253,0x3
+0+10 <a>:
+ 10: e3fd0004 setl \$253,0x4
#source: start.s
#source: pushja.s
#source: a.s
-#as: -x
+#as: -x --no-pushj-stubs
#ld: -m mmo
#objdump: -dr
--- /dev/null
+#source: start4.s
+#source: pushja.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within the offset range gets no
+# stub expansion, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20cffff pushj \$12,40004 <a>
+ c: e3fd0003 setl \$253,0x3
+ \.\.\.
+0+40004 <a>:
+ 40004: e3fd0004 setl \$253,0x4
+0+40008 <_start>:
+ 40008: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: start4.s
+#source: nop123.s
+#source: a.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within the offset range gets no
+# stub expansion, backwards, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <a-0x4>:
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+40004 <pushja>:
+ 40004: e3fd0002 setl \$253,0x2
+ 40008: f30c0000 pushj \$12,8 <a>
+ 4000c: e3fd0003 setl \$253,0x3
+0+40010 <_start>:
+ 40010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: nop123.s
+#source: a.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within the offset range gets no
+# stub expansion, backwards, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <a-0x8>:
+ 0: fd010203 swym 1,2,3
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+40004 <pushja>:
+ 40004: e3fd0002 setl \$253,0x2
+ 40008: f30c0000 pushj \$12,8 <a>
+ 4000c: e3fd0003 setl \$253,0x3
+0+40010 <Main>:
+ 40010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within the offset range gets no
+# stub expansion, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20cffff pushj \$12,40004 <a>
+ c: e3fd0003 setl \$253,0x3
+ \.\.\.
+0+40004 <a>:
+ 40004: e3fd0004 setl \$253,0x4
+0+40008 <Main>:
+ 40008: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: nop123.s
+#ld: -r -m elf64mmix
+#objdump: -dr
+
+# When linking relocatable, check that PUSHJ with a distance to the end of
+# the section just within the offset range gets no stub expansion.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0000 pushj \$12,8 <pushja\+0x4>
+ 8: R_MMIX_PUSHJ_STUBBABLE a
+ c: e3fd0003 setl \$253,0x3
+ \.\.\.
+ 40000: fd010203 swym 1,2,3
--- /dev/null
+#source: start4.s
+#source: pushja.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the PUSHJ offset range gets
+# a JMP stub expansion, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f000ffff jmp 4000c <a>
+ \.\.\.
+0+4000c <a>:
+ 4000c: e3fd0004 setl \$253,0x4
+0+40010 <_start>:
+ 40010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: start4.s
+#source: nop123.s
+#source: a.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the offset range gets a JMP
+# stub expansion, backwards, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <a-0x4>:
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+40008 <pushja>:
+ 40008: e3fd0002 setl \$253,0x2
+ 4000c: f20c0002 pushj \$12,40014 <pushja\+0xc>
+ 40010: e3fd0003 setl \$253,0x3
+ 40014: f1fefffd jmp 8 <a>
+0+40018 <_start>:
+ 40018: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: nop123.s
+#source: a.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the offset range gets a JMP
+# stub expansion, backwards, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <a-0x8>:
+ 0: fd010203 swym 1,2,3
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+40008 <pushja>:
+ 40008: e3fd0002 setl \$253,0x2
+ 4000c: f20c0002 pushj \$12,40014 <pushja\+0xc>
+ 40010: e3fd0003 setl \$253,0x3
+ 40014: f1fefffd jmp 8 <a>
+0+40018 <Main>:
+ 40018: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the PUSHJ offset range gets
+# a JMP stub expansion, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f000ffff jmp 4000c <a>
+ \.\.\.
+0+4000c <a>:
+ 4000c: e3fd0004 setl \$253,0x4
+0+40010 <Main>:
+ 40010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: ext1l.s
+#source: pad2p18m32.s
+#source: pad16.s
+#source: nop123.s
+#ld: -r -m elf64mmix
+#objdump: -dr
+
+# When linking relocatably, check that PUSHJ with a distance to the end of
+# the section just outside the offset range gets expanded.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f0000000 jmp 10 <pushja\+0xc>
+ 10: R_MMIX_JMP a
+ \.\.\.
+0+24 <ext1>:
+ 24: fd040810 swym 4,8,16
+ \.\.\.
+ 40018: fd010203 swym 1,2,3
--- /dev/null
+#source: start4.s
+#source: pushja.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within reach of JMP gets it, ELF
+# version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f0ffffff jmp 400000c <a>
+ \.\.\.
+0+400000c <a>:
+ 400000c: e3fd0004 setl \$253,0x4
+0+4000010 <_start>:
+ 4000010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: start4.s
+#source: nop123.s
+#source: a.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pushja.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just inside the offset range of a JMP
+# stub expansion works, backwards, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <a-0x4>:
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+3fffffc <pushja>:
+ 3fffffc: e3fd0002 setl \$253,0x2
+ 4000000: f20c0002 pushj \$12,4000008 <pushja\+0xc>
+ 4000004: e3fd0003 setl \$253,0x3
+ 4000008: f1000000 jmp 8 <a>
+0+400000c <_start>:
+ 400000c: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: nop123.s
+#source: a.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pushja.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just inside the offset range of a JMP
+# stub expansion works, backwards, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <a-0x8>:
+ 0: fd010203 swym 1,2,3
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+3fffffc <pushja>:
+ 3fffffc: e3fd0002 setl \$253,0x2
+ 4000000: f20c0002 pushj \$12,4000008 <pushja\+0xc>
+ 4000004: e3fd0003 setl \$253,0x3
+ 4000008: f1000000 jmp 8 <a>
+0+400000c <Main>:
+ 400000c: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just within reach of JMP gets it, mmo
+# version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f0ffffff jmp 400000c <a>
+ \.\.\.
+0+400000c <a>:
+ 400000c: e3fd0004 setl \$253,0x4
+0+4000010 <Main>:
+ 4000010: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: undef-2.s
+#source: nop123.s
+#source: pad16.s
+#source: pad2p18m32.s
+#ld: -r -m elf64mmix
+#objdump: -dr
+
+# When linking relocatably, check two expanded stubbable PUSHJs.
+
+# With better relaxation support for relocatable links, both should be
+# able to pass through unexpanded. Right now, we just check that they can
+# coexist peacefully.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f0000000 jmp 10 <pushja\+0xc>
+ 10: R_MMIX_JMP a
+ \.\.\.
+ 24: f2050001 pushj \$5,28 <pushja\+0x24>
+ 28: f0000000 jmp 28 <pushja\+0x24>
+ 28: R_MMIX_JMP undefd
+ \.\.\.
+ 3c: fd010203 swym 1,2,3
+ \.\.\.
--- /dev/null
+#source: start4.s
+#source: pushja.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside reach of JMP works; it will
+# get the full expansion, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: e3ff0020 setl \$255,0x20
+ 14: e6ff0400 incml \$255,0x400
+ 18: e5ff0000 incmh \$255,0x0
+ 1c: e4ff0000 inch \$255,0x0
+ 20: 9f00ff00 go \$0,\$255,0
+ \.\.\.
+0+4000020 <a>:
+ 4000020: e3fd0004 setl \$253,0x4
+0+4000024 <_start>:
+ 4000024: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: start4.s
+#source: nop123.s
+#source: a.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m elf64mmix
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the offset range of a JMP
+# stub expansion works, backwards, ELF version.
+
+.*: file format elf64-mmix
+Disassembly of section \.init:
+0+ <_start>:
+ 0: e37704a6 setl \$119,0x4a6
+Disassembly of section \.text:
+0+4 <a-0x4>:
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+4000000 <pushja>:
+ 4000000: e3fd0002 setl \$253,0x2
+ 4000004: f20c0002 pushj \$12,400000c <pushja\+0xc>
+ 4000008: e3fd0003 setl \$253,0x3
+ 400000c: e3ff0008 setl \$255,0x8
+ 4000010: e6ff0000 incml \$255,0x0
+ 4000014: e5ff0000 incmh \$255,0x0
+ 4000018: e4ff0000 inch \$255,0x0
+ 400001c: 9f00ff00 go \$0,\$255,0
+0+4000020 <_start>:
+ 4000020: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: nop123.s
+#source: a.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pushja.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside the offset range of a JMP
+# stub expansion works, backwards, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <a-0x8>:
+ 0: fd010203 swym 1,2,3
+ 4: fd010203 swym 1,2,3
+0+8 <a>:
+ 8: e3fd0004 setl \$253,0x4
+ \.\.\.
+0+4000000 <pushja>:
+ 4000000: e3fd0002 setl \$253,0x2
+ 4000004: f20c0002 pushj \$12,400000c <pushja\+0xc>
+ 4000008: e3fd0003 setl \$253,0x3
+ 400000c: e3ff0008 setl \$255,0x8
+ 4000010: e6ff0000 incml \$255,0x0
+ 4000014: e5ff0000 incmh \$255,0x0
+ 4000018: e4ff0000 inch \$255,0x0
+ 400001c: 9f00ff00 go \$0,\$255,0
+0+4000020 <Main>:
+ 4000020: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: pad2p26m32.s
+#source: pad16.s
+#source: pad4.s
+#source: pad4.s
+#source: pad4.s
+#source: a.s
+#source: start.s
+#ld: -m mmo
+#objdump: -dr
+
+# Check that PUSHJ with an offset just outside reach of JMP works; it will
+# get the full expansion, mmo version.
+
+.*: file format mmo
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: e3ff0020 setl \$255,0x20
+ 14: e6ff0400 incml \$255,0x400
+ 18: e5ff0000 incmh \$255,0x0
+ 1c: e4ff0000 inch \$255,0x0
+ 20: 9f00ff00 go \$0,\$255,0
+ \.\.\.
+0+4000020 <a>:
+ 4000020: e3fd0004 setl \$253,0x4
+0+4000024 <Main>:
+ 4000024: e3fd0001 setl \$253,0x1
--- /dev/null
+#source: nop123.s
+#source: pushja.s
+#source: undef-2.s
+#source: pad2p18m32.s
+#source: nop123.s
+#ld: -r -m elf64mmix
+#objdump: -dr
+
+# When linking relocatably, check two stubbable PUSHJ:s, one expanded.
+
+# With better relaxation support for relocatable links, both should be
+# able to pass through unexpanded. Right now, we just check that they can
+# coexist peacefully.
+
+.*: file format elf64-mmix
+Disassembly of section \.text:
+0+ <pushja-0x4>:
+ 0: fd010203 swym 1,2,3
+0+4 <pushja>:
+ 4: e3fd0002 setl \$253,0x2
+ 8: f20c0002 pushj \$12,10 <pushja\+0xc>
+ c: e3fd0003 setl \$253,0x3
+ 10: f0000000 jmp 10 <pushja\+0xc>
+ 10: R_MMIX_JMP a
+ \.\.\.
+ 24: f2050000 pushj \$5,24 <pushja\+0x20>
+ 24: R_MMIX_PUSHJ_STUBBABLE undefd
+ \.\.\.
+ 40008: fd010203 swym 1,2,3