summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/tic80/relocs1.s
blob: 149e3956ed23df60425a29ff003f16f77c0100a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;; This is the hand hacked output of the TI C compiler for a simple
;; test program that contains local/global functions, local/global
;; function calls, and an "if" and "for" statement.

	.file	   "relocs1.s"

	.global	_xfunc

_sfunc:
         addu      -16,r1,r1
         st        12(r1),r31
         st        0(r1),r2
         jsr       _xfunc(r0),r31
         ld        0(r1),r2
         ld        12(r1),r31
         jsr       r31(r0),r0
         addu      16,r1,r1

	.global	_gfunc

_gfunc:
         addu      -16,r1,r1
         st        12(r1),r31
         st        0(r1),r2
         jsr       _sfunc(r0),r31
         ld        0(r1),r2
         ld        12(r1),r31
         jsr       r31(r0),r0
         addu      16,r1,r1


	.global	_branches

_branches:
         addu      -16,r1,r1
         st        12(r1),r31
         st        0(r1),r2
         ld        0(r1),r2
         st        4(r1),r2
         ld        0(r1),r2
         ld        4(r1),r3
         addu      10,r2,r2
         cmp       r3,r2,r2
         bbo.a     L12,r2,ge.w
L8:
         ld        4(r1),r2
         bbz.a     L10,r2,0
         jsr       _gfunc(r0),r31
         ld        4(r1),r2
         br.a      L11
L10:
         jsr       _xfunc(r0),r31
         ld        4(r1),r2
L11:
         ld        4(r1),r2
         addu      1,r2,r2
         st        4(r1),r2
         ld        0(r1),r3
         ld        4(r1),r2
         addu      10,r3,r3
         cmp       r2,r3,r2
         bbo.a     L8,r2,lt.w
L12:
         ld        12(r1),r31
         jsr       r31(r0),r0
         addu      16,r1,r1