1# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \ 2# RUN: FileCheck %s 3# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 | \ 4# RUN: FileCheck %s 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. 7 8.option pic2 9la $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 11la $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] 14la $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] 17la $5, symbol+8 # CHECK: lw $5, %got(symbol+8)($gp) # encoding: [0x8f,0x85,A,A] 18 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 19la $5, symbol+8($6) # CHECK: lw $5, %got(symbol+8)($gp) # encoding: [0x8f,0x85,A,A] 20 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 21 # CHECK: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21] 22la $6, symbol+8($6) # CHECK: lw $1, %got(symbol+8)($gp) # encoding: [0x8f,0x81,A,A] 23 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 24 # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] 25 # CHECK: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21] 26la $5, 1f # CHECK: lw $5, %got($tmp0)($gp) # encoding: [0x8f,0x85,A,A] 27 # CHECK: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_Mips_GOT 28 # CHECK: addiu $5, $5, %lo($tmp0) # encoding: [0x24,0xa5,A,A] 29 # CHECK: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16 301: 31 32# PIC expansions involving $25 are special. 33la $25, symbol # CHECK: lw $25, %call16(symbol)($gp) # encoding: [0x8f,0x99,A,A] 34 # CHECK: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16 35la $25, symbol($6) # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] 36 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT 37 # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] 38la $25, symbol($25) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] 39 # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT 40 # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] 41la $25, symbol+8 # CHECK: lw $25, %got(symbol+8)($gp) # encoding: [0x8f,0x99,A,A] 42 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 43la $25, symbol+8($6) # CHECK: lw $25, %got(symbol+8)($gp) # encoding: [0x8f,0x99,A,A] 44 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 45 # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] 46la $25, symbol+8($25) # CHECK: lw $1, %got(symbol+8)($gp) # encoding: [0x8f,0x81,A,A] 47 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 48 # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] 49 # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] 50la $25, 1f # CHECK: lw $25, %got($tmp1)($gp) # encoding: [0x8f,0x99,A,A] 51 # CHECK: # fixup A - offset: 0, value: %got($tmp1), kind: fixup_Mips_GOT 52 # CHECK: addiu $25, $25, %lo($tmp1) # encoding: [0x27,0x39,A,A] 53 # CHECK: # fixup A - offset: 0, value: %lo($tmp1), kind: fixup_Mips_LO16 541: 55