1 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \
3 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 | \
5 # N32 should be acceptable too but it currently errors out.
6 # N64 should be acceptable too but we cannot convert la to dla yet.
9 la $
5, symbol
# CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A]
10 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
11 la $
5, symbol
($
6) # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A]
12 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
13 # CHECK: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21]
14 la $
6, symbol
($
6) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A]
15 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
16 # CHECK: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21]
17 la $
5, symbol+
8 # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A]
18 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
19 # CHECK: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08]
20 la $
5, symbol+
8($
6) # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A]
21 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
22 # CHECK: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08]
23 # CHECK: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21]
24 la $
6, symbol+
8($
6) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A]
25 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
26 # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08]
27 # CHECK: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21]
28 la $
5, 1f
# CHECK: lw $5, %got($tmp0)($gp) # encoding: [0x8f,0x85,A,A]
29 # CHECK: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_Mips_GOT
30 # CHECK: addiu $5, $5, %lo($tmp0) # encoding: [0x24,0xa5,A,A]
31 # CHECK: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16
34 # PIC expansions involving $25 are special.
35 la $
25, symbol
# CHECK: lw $25, %call16(symbol)($gp) # encoding: [0x8f,0x99,A,A]
36 # CHECK: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16
37 la $
25, symbol
($
6) # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A]
38 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
39 # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21]
40 la $
25, symbol
($
25) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A]
41 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
42 # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21]
43 la $
25, symbol+
8 # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A]
44 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
45 # CHECK: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
46 la $
25, symbol+
8($
6) # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A]
47 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
48 # CHECK: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
49 # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21]
50 la $
25, symbol+
8($
25) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A]
51 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT
52 # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08]
53 # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21]
54 la $
25, 1f
# CHECK: lw $25, %got($tmp1)($gp) # encoding: [0x8f,0x99,A,A]
55 # CHECK: # fixup A - offset: 0, value: %got($tmp1), kind: fixup_Mips_GOT
56 # CHECK: addiu $25, $25, %lo($tmp1) # encoding: [0x27,0x39,A,A]
57 # CHECK: # fixup A - offset: 0, value: %lo($tmp1), kind: fixup_Mips_LO16