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 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+8)($gp) # encoding: [0x8f,0x85,A,A] 18 # CHECK: # fixup A - offset: 0, value: %got(symbol+8), kind: fixup_Mips_GOT 19 la $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] 22 la $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] 26 la $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 30 1: 31 32 # PIC expansions involving $25 are special. 33 la $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 35 la $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] 38 la $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] 41 la $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 43 la $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] 46 la $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] 50 la $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 54 1: 55