aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-02-04 04:01:32 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-02-04 04:01:32 +0000
commitc4a42e0f58139c32ccb5d2e8d05ff2148c7b0afe (patch)
tree4fbfa347b9552b5fe67d15491dbb13589138dc35 /gas/testsuite
parenta73c86fb732868e52699b4dc05bcb6134db9f6df (diff)
downloadgdb-c4a42e0f58139c32ccb5d2e8d05ff2148c7b0afe.zip
gdb-c4a42e0f58139c32ccb5d2e8d05ff2148c7b0afe.tar.gz
gdb-c4a42e0f58139c32ccb5d2e8d05ff2148c7b0afe.tar.bz2
* gas/mmix/basep-8.d, gas/mmix/basep-9.s, gas/mmix/basep-9.d,
gas/mmix/err-bpo6.s, gas/mmix/basep-8.s, gas/mmix/basep-10.d, gas/mmix/basep-10.s, gas/mmix/basep-11.s, gas/mmix/basep-11.d: New tests for base-plus-offset relocations and global register allocations for weak and common symbols.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/mmix/basep-10.d34
-rw-r--r--gas/testsuite/gas/mmix/basep-10.s16
-rw-r--r--gas/testsuite/gas/mmix/basep-11.d25
-rw-r--r--gas/testsuite/gas/mmix/basep-11.s13
-rw-r--r--gas/testsuite/gas/mmix/basep-8.d30
-rw-r--r--gas/testsuite/gas/mmix/basep-8.s9
-rw-r--r--gas/testsuite/gas/mmix/basep-9.d29
-rw-r--r--gas/testsuite/gas/mmix/basep-9.s9
-rw-r--r--gas/testsuite/gas/mmix/err-bpo6.s21
10 files changed, 194 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index cf48ac9..c7edba1 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2002-02-04 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gas/mmix/basep-8.d, gas/mmix/basep-9.s, gas/mmix/basep-9.d,
+ gas/mmix/err-bpo6.s, gas/mmix/basep-8.s, gas/mmix/basep-10.d,
+ gas/mmix/basep-10.s, gas/mmix/basep-11.s, gas/mmix/basep-11.d: New
+ tests for base-plus-offset relocations and global register
+ allocations for weak and common symbols.
+
2002-02-02 Alan Modra <amodra@bigpond.net.au>
* gas/elf/elf.exp: Don't special case v850.
diff --git a/gas/testsuite/gas/mmix/basep-10.d b/gas/testsuite/gas/mmix/basep-10.d
new file mode 100644
index 0000000..6a24e9d
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-10.d
@@ -0,0 +1,34 @@
+#as: -linker-allocated-gregs
+#objdump: -srt
+
+.*: file format elf64-mmix
+
+SYMBOL TABLE:
+0+ l d \.text 0+
+0+ l d \.data 0+
+0+ l d \.bss 0+
+0+4 l \.text 0+ w4
+0+10 l \.text 0+ w2
+0+ l d \.MMIX\.reg_contents 0+
+0+c w \.text 0+ w1
+0+8 w \.text 0+ w3
+
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+6 R_MMIX_BASE_PLUS_OFFSET w1
+0+a R_MMIX_REG \.MMIX\.reg_contents
+0+e R_MMIX_REG \.MMIX\.reg_contents\+0x0+8
+0+12 R_MMIX_REG \.MMIX\.reg_contents\+0x0+8
+
+RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]:
+OFFSET TYPE VALUE
+0+ R_MMIX_64 w3
+0+8 R_MMIX_64 \.text\+0x0+4
+
+Contents of section \.text:
+ 0000 fd000000 232a0000 232b0000 232c000c .*
+ 0010 232d0000 .*
+Contents of section \.data:
+Contents of section \.MMIX\.reg_contents:
+ 0000 00000000 00000000 00000000 00000000 .*
diff --git a/gas/testsuite/gas/mmix/basep-10.s b/gas/testsuite/gas/mmix/basep-10.s
new file mode 100644
index 0000000..5d6ed76
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-10.s
@@ -0,0 +1,16 @@
+# Test that we handle weak symbols with base-plus-offset relocs mixed with
+# GREG defs.
+ .weak w1
+ .weak w3
+ GREG w4
+ GREG w3
+ SWYM
+w4:
+ LDA $42,w1
+w3:
+ LDA $43,w3
+w1:
+ LDA $44,w2
+w2:
+ LDA $45,w4
+
diff --git a/gas/testsuite/gas/mmix/basep-11.d b/gas/testsuite/gas/mmix/basep-11.d
new file mode 100644
index 0000000..36eacf9
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-11.d
@@ -0,0 +1,25 @@
+#as: -linker-allocated-gregs
+#objdump: -srt
+
+.*: file format elf64-mmix
+
+SYMBOL TABLE:
+0+ l d \.text 0+
+0+ l d \.data 0+
+0+ l d \.bss 0+
+0+4 l \.text 0+ w4
+0+10 l \.text 0+ w2
+0+c w \.text 0+ w1
+0+8 w \.text 0+ w3
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+6 R_MMIX_BASE_PLUS_OFFSET w1
+0+a R_MMIX_BASE_PLUS_OFFSET w3
+0+e R_MMIX_BASE_PLUS_OFFSET \.text\+0x0+10
+0+12 R_MMIX_BASE_PLUS_OFFSET \.text\+0x0+4
+
+Contents of section \.text:
+ 0000 fd000000 232a0000 232b0000 232c0000 .*
+ 0010 232d0000 .*
+Contents of section \.data:
diff --git a/gas/testsuite/gas/mmix/basep-11.s b/gas/testsuite/gas/mmix/basep-11.s
new file mode 100644
index 0000000..17b7903
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-11.s
@@ -0,0 +1,13 @@
+# Test that we handle weak symbols with base-plus-offset relocs.
+ .weak w1
+ .weak w3
+ SWYM
+w4:
+ LDA $42,w1
+w3:
+ LDA $43,w3
+w1:
+ LDA $44,w2
+w2:
+ LDA $45,w4
+
diff --git a/gas/testsuite/gas/mmix/basep-8.d b/gas/testsuite/gas/mmix/basep-8.d
new file mode 100644
index 0000000..71cd3ab
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-8.d
@@ -0,0 +1,30 @@
+#as: -linker-allocated-gregs
+#objdump: -drt
+
+# Since we don't merge BPO-relocs until linking with
+# -linker-allocated-gregs, we automatically correctly handle the two
+# seemingly neighboring comm-symbols that don't merge well at
+# assembly-time.
+
+.*: file format elf64-mmix
+
+SYMBOL TABLE:
+0+ l d \.text 0+
+0+ l d \.data 0+
+0+ l d \.bss 0+
+0+ l \.bss 0+4 comm_symbol3
+0+4 l \.bss 0+4 comm_symbol4
+0+4 O \*COM\* 0+4 comm_symbol1
+0+4 O \*COM\* 0+4 comm_symbol2
+
+Disassembly of section \.text:
+
+0+ <\.text>:
+ 0: 232a0000 addu \$42,\$0,0
+ 2: R_MMIX_BASE_PLUS_OFFSET comm_symbol1
+ 4: 232b0000 addu \$43,\$0,0
+ 6: R_MMIX_BASE_PLUS_OFFSET comm_symbol2
+ 8: 232c0000 addu \$44,\$0,0
+ a: R_MMIX_BASE_PLUS_OFFSET \.bss
+ c: 232d0000 addu \$45,\$0,0
+ e: R_MMIX_BASE_PLUS_OFFSET \.bss\+0x4
diff --git a/gas/testsuite/gas/mmix/basep-8.s b/gas/testsuite/gas/mmix/basep-8.s
new file mode 100644
index 0000000..fd2371c
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-8.s
@@ -0,0 +1,9 @@
+# Test that we handle COMM-type symbols with base-plus-offset relocs.
+ .comm comm_symbol1,4,4
+ .lcomm comm_symbol3,4
+ LDA $42,comm_symbol1
+ LDA $43,comm_symbol2
+ LDA $44,comm_symbol3
+ LDA $45,comm_symbol4
+ .comm comm_symbol2,4,4
+ .lcomm comm_symbol4,4
diff --git a/gas/testsuite/gas/mmix/basep-9.d b/gas/testsuite/gas/mmix/basep-9.d
new file mode 100644
index 0000000..9bc9155
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-9.d
@@ -0,0 +1,29 @@
+#objdump: -srt
+
+.*: file format elf64-mmix
+
+SYMBOL TABLE:
+0+ l d \.text 0+
+0+ l d \.data 0+
+0+ l d \.bss 0+
+0+ l \.bss 0+4 comm_symbol3
+0+4 l \.bss 0+4 comm_symbol4
+0+ l d \.MMIX\.reg_contents 0+
+0+4 O \*COM\* 0+4 comm_symbol1
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+2 R_MMIX_REG \.MMIX\.reg_contents\+0x0+8
+0+6 R_MMIX_REG \.MMIX\.reg_contents
+0+a R_MMIX_REG \.MMIX\.reg_contents
+
+RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]:
+OFFSET TYPE VALUE
+0+ R_MMIX_64 \.bss
+0+8 R_MMIX_64 comm_symbol1
+
+Contents of section \.text:
+ 0000 232a0000 232c0000 232d0004 .*
+Contents of section \.data:
+Contents of section \.MMIX\.reg_contents:
+ 0000 00000000 00000000 00000000 00000000 .*
diff --git a/gas/testsuite/gas/mmix/basep-9.s b/gas/testsuite/gas/mmix/basep-9.s
new file mode 100644
index 0000000..d36326e
--- /dev/null
+++ b/gas/testsuite/gas/mmix/basep-9.s
@@ -0,0 +1,9 @@
+# Test that we handle COMM-type symbols with base-plus-offset relocs.
+ .comm comm_symbol1,4,4
+ .lcomm comm_symbol3,4
+ GREG comm_symbol1
+ GREG comm_symbol3
+ LDA $42,comm_symbol1
+ LDA $44,comm_symbol3
+ LDA $45,comm_symbol4
+ .lcomm comm_symbol4,4
diff --git a/gas/testsuite/gas/mmix/err-bpo6.s b/gas/testsuite/gas/mmix/err-bpo6.s
new file mode 100644
index 0000000..7efe1f7
--- /dev/null
+++ b/gas/testsuite/gas/mmix/err-bpo6.s
@@ -0,0 +1,21 @@
+% { dg-do assemble { target mmix-*-* } }
+
+# Test that we handle COMM-type symbols with base-plus-offset relocs, but
+# that we don't merge ones that may be separately merged with other
+# symbols at link-time. Likewise for weak symbols.
+ .comm comm_symbol1,4,4
+ .lcomm comm_symbol3,4
+ GREG comm_symbol1
+ GREG comm_symbol3
+ GREG xx
+ .weak xx
+xx:
+ LDA $47,yy % { dg-error "no suitable GREG definition" "" }
+ LDA $46,xx
+ LDA $42,comm_symbol1
+ LDA $43,comm_symbol2 % { dg-error "no suitable GREG definition" "" }
+ LDA $44,comm_symbol3
+ LDA $45,comm_symbol4
+yy:
+ .comm comm_symbol2,4,4
+ .lcomm comm_symbol4,4