1 # RUN: llvm-mc %s -triple=mips64-unknown-linux -show-encoding \
2 # RUN: -mcpu=mips3 | FileCheck -check-prefix=N64 %s
4 # RUN: llvm-mc %s -triple=mips64-unknown-linux -show-encoding \
5 # RUN: -mattr=+xgot -mcpu=mips3 | FileCheck -check-prefix=XGOT %s
9 # N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A]
10 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
12 # XGOT: lui $5, %got_hi(symbol) # encoding: [0x3c,0x05,A,A]
13 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
14 # XGOT: daddu $5, $5, $gp # encoding: [0x00,0xbc,0x28,0x2d]
15 # XGOT: ld $5, %got_lo(symbol)($5) # encoding: [0xdc,0xa5,A,A]
16 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
19 # N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A]
20 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
21 # N64: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d]
23 # XGOT: lui $5, %got_hi(symbol) # encoding: [0x3c,0x05,A,A]
24 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
25 # XGOT: daddu $5, $5, $gp # encoding: [0x00,0xbc,0x28,0x2d]
26 # XGOT: ld $5, %got_lo(symbol)($5) # encoding: [0xdc,0xa5,A,A]
27 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
28 # XGOT: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d]
31 # N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A]
32 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
33 # N64: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d]
35 # XGOT: lui $1, %got_hi(symbol) # encoding: [0x3c,0x01,A,A]
36 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
37 # XGOT: daddu $1, $1, $gp # encoding: [0x00,0x3c,0x08,0x2d]
38 # XGOT: ld $1, %got_lo(symbol)($1) # encoding: [0xdc,0x21,A,A]
39 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
40 # XGOT: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d]
43 # N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A]
44 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
45 # N64: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08]
47 # XGOT: lui $5, %got_hi(symbol+8) # encoding: [0x3c,0x05,A,A]
48 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
49 # XGOT: daddu $5, $5, $gp # encoding: [0x00,0xbc,0x28,0x2d]
50 # XGOT: ld $5, %got_lo(symbol)($5) # encoding: [0xdc,0xa5,A,A]
51 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
52 # XGOT: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08]
55 # N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A]
56 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
57 # N64: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08]
58 # N64: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d]
60 # XGOT: lui $5, %got_hi(symbol+8) # encoding: [0x3c,0x05,A,A]
61 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
62 # XGOT: daddu $5, $5, $gp # encoding: [0x00,0xbc,0x28,0x2d]
63 # XGOT: ld $5, %got_lo(symbol)($5) # encoding: [0xdc,0xa5,A,A]
64 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
65 # XGOT: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08]
66 # XGOT: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d]
69 # N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A]
70 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
71 # N64: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08]
72 # N64: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d]
74 # XGOT: lui $1, %got_hi(symbol+8) # encoding: [0x3c,0x01,A,A]
75 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
76 # XGOT: daddu $1, $1, $gp # encoding: [0x00,0x3c,0x08,0x2d]
77 # XGOT: ld $1, %got_lo(symbol)($1) # encoding: [0xdc,0x21,A,A]
78 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
79 # XGOT: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08]
80 # XGOT: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d]
83 # N64: ld $5, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x85,A,A]
84 # N64: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_Mips_GOT_DISP
86 ## FIXME: GAS generates R_MIPS_GOT_PAGE / R_MIPS_GOT_OFST pair of relocations.
87 # XGOT: ld $5, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x85,A,A]
88 # XGOT: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_Mips_GOT_DISP
91 # PIC expansions involving $25 are special.
93 # N64: ld $25, %call16(symbol)($gp) # encoding: [0xdf,0x99,A,A]
94 # N64: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16
96 # XGOT: lui $25, %call_hi(symbol) # encoding: [0x3c,0x19,A,A]
97 # XGOT: # fixup A - offset: 0, value: %call_hi(symbol), kind: fixup_Mips_CALL_HI16
98 # XGOT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
99 # XGOT: ld $25, %call_lo(symbol)($25) # encoding: [0xdf,0x39,A,A]
100 # XGOT: # fixup A - offset: 0, value: %call_lo(symbol), kind: fixup_Mips_CALL_LO16
103 # N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A]
104 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
105 # N64: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d]
107 # XGOT: lui $25, %got_hi(symbol) # encoding: [0x3c,0x19,A,A]
108 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
109 # XGOT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
110 # XGOT: ld $25, %got_lo(symbol)($25) # encoding: [0xdf,0x39,A,A]
111 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
112 # XGOT: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d]
115 # N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A]
116 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
117 # N64: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d]
119 # XGOT: lui $1, %got_hi(symbol) # encoding: [0x3c,0x01,A,A]
120 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
121 # XGOT: daddu $1, $1, $gp # encoding: [0x00,0x3c,0x08,0x2d]
122 # XGOT: ld $1, %got_lo(symbol)($1) # encoding: [0xdc,0x21,A,A]
123 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
124 # XGOT: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d]
127 # N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A]
128 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
129 # N64: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
131 # XGOT: lui $25, %got_hi(symbol+8) # encoding: [0x3c,0x19,A,A]
132 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
133 # XGOT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
134 # XGOT: ld $25, %got_lo(symbol)($25) # encoding: [0xdf,0x39,A,A]
135 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
136 # XGOT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
138 dla $
25, symbol+
8($
6)
139 # N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A]
140 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
141 # N64: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
142 # N64: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d]
144 # XGOT: lui $25, %got_hi(symbol+8) # encoding: [0x3c,0x19,A,A]
145 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
146 # XGOT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
147 # XGOT: ld $25, %got_lo(symbol)($25) # encoding: [0xdf,0x39,A,A]
148 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
149 # XGOT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
150 # XGOT: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d]
152 dla $
25, symbol+
8($
25)
153 # N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A]
154 # N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
155 # N64: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08]
156 # N64: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d]
158 # XGOT: lui $1, %got_hi(symbol+8) # encoding: [0x3c,0x01,A,A]
159 # XGOT: # fixup A - offset: 0, value: %got_hi(symbol+8), kind: fixup_Mips_GOT_HI16
160 # XGOT: daddu $1, $1, $gp # encoding: [0x00,0x3c,0x08,0x2d]
161 # XGOT: ld $1, %got_lo(symbol)($1) # encoding: [0xdc,0x21,A,A]
162 # XGOT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
163 # XGOT: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08]
164 # XGOT: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d]
167 # N64: ld $25, %got_disp(.Ltmp1)($gp) # encoding: [0xdf,0x99,A,A]
168 # N64: # fixup A - offset: 0, value: %got_disp(.Ltmp1), kind: fixup_Mips_GOT_DISP
170 ## FIXME: GAS generates R_MIPS_GOT_PAGE / R_MIPS_GOT_OFST pair of relocations.
171 # XGOT: ld $25, %got_disp(.Ltmp1)($gp) # encoding: [0xdf,0x99,A,A]
172 # XGOT: # fixup A - offset: 0, value: %got_disp(.Ltmp1), kind: fixup_Mips_GOT_DISP