aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-powerpc/aix-ref-1-32.od30
-rw-r--r--ld/testsuite/ld-powerpc/aix-ref-1-64.od30
-rw-r--r--ld/testsuite/ld-powerpc/aix-ref-1.s57
-rw-r--r--ld/testsuite/ld-powerpc/aix52.exp5
5 files changed, 128 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 767747c..3a2dc34 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-23 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * ld-powerpc/aix-ref-1-32.od, ld-powerpc/aix-ref-1-64.od,
+ ld-powerpc/aix-ref-1.s: New tests.
+ * ld-powerpc/aix52.exp: Run them.
+
2010-01-14 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/orphan4.d: Support 64bit targets.
diff --git a/ld/testsuite/ld-powerpc/aix-ref-1-32.od b/ld/testsuite/ld-powerpc/aix-ref-1-32.od
new file mode 100644
index 0000000..1ba90ec
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-ref-1-32.od
@@ -0,0 +1,30 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+.* <foo1>:
+.*: 60 00 00 00 oril r0,r0,0
+ .*: R_REF foo2\+.*
+.*: 80 22 00 00 l r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+.*: 4e 80 00 20 br
+
+.* <foo2>:
+.*: 60 00 00 00 oril r0,r0,0
+ .*: R_REF foo6\+.*
+ .*: R_REF foo4\+.*
+.*: 80 22 00 00 l r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+
+.* <foo4>:
+.*: 60 00 00 00 oril r0,r0,0
+.*: 80 22 00 00 l r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+
+.* <foo6>:
+.*: 60 00 00 00 oril r0,r0,0
+.*: 80 22 00 00 l r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+ \.\.\.
diff --git a/ld/testsuite/ld-powerpc/aix-ref-1-64.od b/ld/testsuite/ld-powerpc/aix-ref-1-64.od
new file mode 100644
index 0000000..9cc6e9d
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-ref-1-64.od
@@ -0,0 +1,30 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+.* <foo1>:
+ .*: 60 00 00 00 nop
+ .*: R_REF foo2\+.*
+ .*: e8 22 00 00 ld r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+ .*: 4e 80 00 20 blr
+
+.* <foo2>:
+ .*: 60 00 00 00 nop
+ .*: R_REF foo6\+.*
+ .*: R_REF foo4\+.*
+ .*: e8 22 00 00 ld r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+
+.* <foo4>:
+ .*: 60 00 00 00 nop
+ .*: e8 22 00 00 ld r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+
+.* <foo6>:
+ .*: 60 00 00 00 nop
+ .*: e8 22 00 00 ld r1,0\(r2\)
+ .*: R_TOC stuff\+.*
+ \.\.\.
diff --git a/ld/testsuite/ld-powerpc/aix-ref-1.s b/ld/testsuite/ld-powerpc/aix-ref-1.s
new file mode 100644
index 0000000..33445a6
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-ref-1.s
@@ -0,0 +1,57 @@
+ .macro loadtoc,sym
+ .if size == 32
+ lwz 1,\sym(2)
+ .else
+ ld 1,\sym(2)
+ .endif
+ .endm
+
+ .toc
+LC01: .tc stuff[TC],stuff[RW]
+
+ .globl foo1
+ .csect foo1[pr]
+foo1:
+ .align 8
+ nop
+ loadtoc LC01
+
+ .globl foo2
+ .csect foo2[pr]
+foo2:
+ nop
+ loadtoc LC01
+ .ref foo4 , foo6
+
+ .globl foo3
+ .csect foo3[pr]
+foo3:
+ nop
+ loadtoc LC01
+
+ .globl foo4
+ .csect foo4[pr]
+foo4:
+ nop
+ loadtoc LC01
+
+ .globl foo5
+ .csect foo5[pr]
+foo5:
+ nop
+ loadtoc LC01
+ .ref foo3
+
+ .globl foo6
+ .csect foo6[pr]
+foo6:
+ nop
+ loadtoc LC01
+
+ .csect foo1[pr]
+ blr
+ .ref foo2
+
+ .csect stuff[rw]
+stuff:
+ .long 1
diff --git a/ld/testsuite/ld-powerpc/aix52.exp b/ld/testsuite/ld-powerpc/aix52.exp
index d608490..2f00cff 100644
--- a/ld/testsuite/ld-powerpc/aix52.exp
+++ b/ld/testsuite/ld-powerpc/aix52.exp
@@ -196,6 +196,11 @@ set aix52tests {
"" {aix-rel-1.s}
{{objdump -hr aix-rel-1.od}} "aix-rel-1.ro"}
+ {".ref test 1" "-efoo1"
+ "" {aix-ref-1.s}
+ {{objdump -dr aix-ref-1-SIZE.od}}
+ "aix-ref-1"}
+
{"Weak test 1 (rel)" "-r"
"" {aix-weak-1a.s aix-weak-1b.s}
{{nm {} aix-weak-1-rel.nd} {objdump -h aix-weak-1-rel.hd}}