aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/hppa/reloc/.Sanitize1
-rw-r--r--gas/testsuite/gas/hppa/reloc/applybug.s130
2 files changed, 131 insertions, 0 deletions
diff --git a/gas/testsuite/gas/hppa/reloc/.Sanitize b/gas/testsuite/gas/hppa/reloc/.Sanitize
index 577c109..baf760f 100644
--- a/gas/testsuite/gas/hppa/reloc/.Sanitize
+++ b/gas/testsuite/gas/hppa/reloc/.Sanitize
@@ -26,6 +26,7 @@ Do-first:
Things-to-keep:
+applybug.s
blebug.s
blebug2.s
blebug3.s
diff --git a/gas/testsuite/gas/hppa/reloc/applybug.s b/gas/testsuite/gas/hppa/reloc/applybug.s
new file mode 100644
index 0000000..0ec11df
--- /dev/null
+++ b/gas/testsuite/gas/hppa/reloc/applybug.s
@@ -0,0 +1,130 @@
+ .SPACE $PRIVATE$
+ .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+ .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+ .SPACE $TEXT$
+ .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+ .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+ .IMPORT $global$,DATA
+ .IMPORT $$dyncall,MILLICODE
+; gcc_compiled.:
+ .SPACE $PRIVATE$
+ .SUBSPA $DATA$
+
+ .align 4
+tab___2
+ .word L$0002
+ .word L$0003
+ .word L$0004
+ .SPACE $TEXT$
+ .SUBSPA $CODE$
+
+ .align 4
+ .EXPORT execute,CODE
+ .EXPORT execute,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR
+execute
+ .PROC
+ .CALLINFO FRAME=0,NO_CALLS
+ .ENTRY
+ addil L'buf-$global$,%r27
+ ldo R'buf-$global$(%r1),%r20
+ ldil L'L$0002,%r19
+ movb,<> %r26,%r26,L$0002
+ ldo R'L$0002(%r19),%r22
+ copy 0,%r21
+ addil L'tab___2-$global$,%r27
+ ldo R'tab___2-$global$(%r1),%r23
+ addil L'optab-$global$,%r27
+ ldo R'optab-$global$(%r1),%r20
+L$0009
+ sh2add %r21,%r23,%r19
+ ldh 2(0,%r19),%r19
+ ldo 1(%r21),%r21
+ sub %r19,%r22,%r19
+ comib,>= 2,%r21,L$0009
+ sths,ma %r19,2(0,%r20)
+ bv,n 0(%r2)
+L$0002
+ ldi 120,%r19
+ stbs,ma %r19,1(0,%r20)
+ ldhs,ma 2(0,%r26),%r19
+ add %r22,%r19,%r19
+ bv,n 0(%r19)
+L$0003
+ ldi 121,%r19
+ stbs,ma %r19,1(0,%r20)
+ ldhs,ma 2(0,%r26),%r19
+ add %r22,%r19,%r19
+ bv,n 0(%r19)
+L$0004
+ ldi 122,%r19
+ stb %r19,0(0,%r20)
+ bv 0(%r2)
+ stbs,mb 0,1(0,%r20)
+ .EXIT
+ .PROCEND
+ .IMPORT __main,CODE
+ .IMPORT strcmp,CODE
+ .SPACE $TEXT$
+ .SUBSPA $LIT$
+
+ .align 4
+L$C0000
+ .STRING "xyxyz\x00"
+ .IMPORT abort,CODE
+ .IMPORT exit,CODE
+ .SPACE $TEXT$
+ .SUBSPA $CODE$
+
+ .align 4
+ .EXPORT main,CODE
+ .EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
+main
+ .PROC
+ .CALLINFO FRAME=128,CALLS,SAVE_RP
+ .ENTRY
+ stw %r2,-20(0,%r30)
+ .CALL
+ bl __main,%r2
+ ldo 128(%r30),%r30
+ .CALL ARGW0=GR
+ bl execute,%r2
+ copy 0,%r26
+ addil L'optab-$global$,%r27
+ copy %r1,%r19
+ ldo R'optab-$global$(%r19),%r21
+ ldh 2(0,%r21),%r20
+ ldh R'optab-$global$(%r19),%r19
+ addil L'p-$global$,%r27
+ copy %r1,%r22
+ sth %r20,R'p-$global$(%r22)
+ ldo R'p-$global$(%r22),%r26
+ sth %r20,4(0,%r26)
+ sth %r19,2(0,%r26)
+ ldh 4(0,%r21),%r19
+ .CALL ARGW0=GR
+ bl execute,%r2
+ sth %r19,6(0,%r26)
+ addil L'buf-$global$,%r27
+ copy %r1,%r19
+ ldo R'buf-$global$(%r19),%r26
+ ldil L'L$C0000,%r25
+ .CALL ARGW0=GR,ARGW1=GR
+ bl strcmp,%r2
+ ldo R'L$C0000(%r25),%r25
+ comib,=,n 0,%r28,L$0011
+ .CALL
+ bl abort,%r2
+ nop
+L$0011
+ .CALL ARGW0=GR
+ bl exit,%r2
+ copy 0,%r26
+ nop
+ .EXIT
+ .PROCEND
+ .SPACE $PRIVATE$
+ .SUBSPA $BSS$
+
+optab .comm 10
+buf .comm 10
+p .comm 10