+2002-02-01 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gas/mmix/basep-1b.d, gas/mmix/basep-2b.d, gas/mmix/basep-7.d,
+ gas/mmix/err-bpo2.s, gas/mmix/basep-3b.d, gas/mmix/err-bpo3.s,
+ gas/mmix/basep-4.d, gas/mmix/err-bpo4.s, gas/mmix/err-bpo5.s,
+ gas/mmix/basep-5.d, gas/mmix/basep-6.d: New tests.
+
2002-01-22 Alexandre Oliva <aoliva@redhat.com>
* gas/mn10300/basic.exp (run_list_test): New proc, from alpha.
--- /dev/null
+#source: basep-1.s
+#as: -linker-allocated-gregs
+#objdump: -dr
+
+# Check that this test isn't mistreated with -linker-allocated-gregs.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <a>:
+ 0: 0000002a trap 0,0,42
+ 4: 8d2b0034 ldo \$43,\$0,52
+ 6: R_MMIX_REG \.MMIX\.reg_contents
--- /dev/null
+#source: basep-2.s
+#as: --no-predefined-syms -linker-allocated-gregs
+#objdump: -dr
+
+# Check that this test isn't mistreated with -linker-allocated-gregs.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0000000000000000 <a>:
+ 0: 0000002a trap 0,0,42
+ 4: 8d2b0034 ldo \$43,\$0,52
+ 6: R_MMIX_REG \.MMIX\.reg_contents\+0x8
+ \.\.\.
+
+0000000000000108 <d>:
+ 108: 0000001c trap 0,0,28
+ 10c: 8d8f000c ldo \$143,\$0,12
+ 10e: R_MMIX_REG \.MMIX\.reg_contents
+ 110: 8df3000c ldo \$243,\$0,12
+ 112: R_MMIX_REG \.MMIX\.reg_contents\+0x8
+ 114: 23670028 addu \$103,\$0,40
+ 116: R_MMIX_REG \.MMIX\.reg_contents
+ 118: 230d0018 addu \$13,\$0,24
+ 11a: R_MMIX_REG \.MMIX\.reg_contents\+0x8
--- /dev/null
+#source: basep-3.s
+#as: -linker-allocated-gregs
+#objdump: -dr
+
+# Check that this test isn't mistreated with -linker-allocated-gregs.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <Main>:
+ 0: bf2a0000 pushgo \$42,\$0,0
+ 2: R_MMIX_REG \.MMIX\.reg_contents
+ 4: fd000000 swym 0,0,0
+
+0+8 <extfn>:
+ 8: f8000000 pop 0,0
--- /dev/null
+#source: err-bpo2.s
+#as: -linker-allocated-gregs
+#objdump: -dr
+
+# The -linker-allocated-gregs option validates omissions of GREG.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <a>:
+ 0: 0000002a trap 0,0,42
+ 4: 8d2b0000 ldo \$43,\$0,0
+ 6: R_MMIX_BASE_PLUS_OFFSET \.text\+0x34
--- /dev/null
+#source: err-bpo3.s
+#as: -linker-allocated-gregs
+#objdump: -dr
+
+# The -linker-allocated-gregs option validates omissions of GREG.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <a>:
+ 0: 0000002a trap 0,0,42
+ 4: 8d2b0000 ldo \$43,\$0,0
+ 6: R_MMIX_BASE_PLUS_OFFSET \.text\+0x34
+ \.\.\.
+
+0+108 <d>:
+ 108: 0000001c trap 0,0,28
+ 10c: 8d8f0000 ldo \$143,\$0,0
+ 10e: R_MMIX_BASE_PLUS_OFFSET \.text\+0x114
+ 110: 8df30000 ldo \$243,\$0,0
+ 112: R_MMIX_BASE_PLUS_OFFSET \.text\+0xc
+ 114: 23670000 addu \$103,\$0,0
+ 116: R_MMIX_BASE_PLUS_OFFSET \.text\+0x130
+ 118: 230d0000 addu \$13,\$0,0
+ 11a: R_MMIX_BASE_PLUS_OFFSET \.text\+0x18
--- /dev/null
+#source: err-bpo4.s
+#as: -linker-allocated-gregs
+#objdump: -dr
+
+# The -linker-allocated-gregs option validates omissions of GREG.
+
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <Main>:
+ 0: bf2a0000 pushgo \$42,\$0,0
+ 2: R_MMIX_BASE_PLUS_OFFSET fn
+ 4: fd000000 swym 0,0,0
+
+0+8 <extfn>:
+ 8: f8000000 pop 0,0
--- /dev/null
+#source: err-bpo5.s
+#as: -linker-allocated-gregs
+#objdump: -drt
+
+# The -linker-allocated-gregs option validates omissions of GREG.
+# Note the inconsequence in relocs regarding forward and backward
+# references (not specific to this functionality); they may change.
+
+.*: file format elf64-mmix
+
+SYMBOL TABLE:
+0+ l d \.text 0+
+0+ l d \.data 0+
+0+ l d \.bss 0+
+0+2a l \*ABS\* 0+ a
+0+70 l \*ABS\* 0+ b
+0+48 l \*ABS\* 0+ c
+0+3 l \*ABS\* 0+ d
+
+Disassembly of section \.text:
+
+0+ <\.text>:
+ 0: 8d2b0000 ldo \$43,\$0,0
+ 2: R_MMIX_BASE_PLUS_OFFSET \*ABS\*\+0x5e
+ 4: 232f0000 addu \$47,\$0,0
+ 6: R_MMIX_BASE_PLUS_OFFSET \*ABS\*\+0x9a
+ 8: 23300000 addu \$48,\$0,0
+ a: R_MMIX_BASE_PLUS_OFFSET \*ABS\*\+0x86
+ c: 8d2b0000 ldo \$43,\$0,0
+ e: R_MMIX_BASE_PLUS_OFFSET c\+0x2
+ 10: 232f0000 addu \$47,\$0,0
+ 12: R_MMIX_BASE_PLUS_OFFSET d\+0xd4
+ 14: 23300000 addu \$48,\$0,0
+ 16: R_MMIX_BASE_PLUS_OFFSET c\+0x15
--- /dev/null
+% { dg-do assemble { target mmix-*-* } }
+
+# Check that base-plus-offset relocs without suitable GREGs are not passed
+# through (without -linker-allocated-gregs).
+a TETRA 42
+ LDO $43,a+52 % { dg-error "no suitable GREG definition" "" }
--- /dev/null
+% { dg-do assemble { target mmix-*-* } }
+
+# Base-plus-offset without -linker-allocated-gregs.
+
+a TETRA 42
+ LDO $43,a+52 % { dg-error "no suitable GREG definition" "" }
+
+ LOC @+256
+d TETRA 28
+ LDO $143,d+12 % { dg-error "no suitable GREG definition" "" }
+ LDO $243,a+12 % { dg-error "no suitable GREG definition" "" }
+ LDA $103,d+40 % { dg-error "no suitable GREG definition" "" }
+ LDA $13,a+24 % { dg-error "no suitable GREG definition" "" }
--- /dev/null
+% { dg-do assemble { target mmix-*-* } }
+
+# Base-plus-offset without -linker-allocated-gregs.
+
+Main PUSHGO $42,fn % { dg-error "no suitable GREG definition" "" }
+ SWYM 0
+extfn POP 0,0
--- /dev/null
+% { dg-do assemble { target mmix-*-* } }
+
+# Base-plus-offset without -linker-allocated-gregs. Note the constant.
+
+a IS 42
+b IS 112
+ LDO $43,a+52 % { dg-error "no suitable GREG definition" "" }
+ LDA $47,a+112 % { dg-error "no suitable GREG definition" "" }
+ LDA $48,b+22 % { dg-error "no suitable GREG definition" "" }
+ LDO $43,c+2 % { dg-error "no suitable GREG definition" "" }
+ LDA $47,d+212 % { dg-error "no suitable GREG definition" "" }
+ LDA $48,c+21 % { dg-error "no suitable GREG definition" "" }
+c IS 72
+d IS 3