Home | History | Annotate | Download | only in Mips
      1 // This addresses bug 14456. We were not writing
      2 // out the addend to the gprel16 relocation. The
      3 // addend is stored in the instruction immediate
      4 // field.
      5 
      6 // RUN: llvm-mc -mcpu=mips32r2 -triple=mipsel-pc-linux -filetype=obj -relocation-model=static %s -o - \
      7 // RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
      8 // RUN: | FileCheck %s
      9 // RUN: llvm-mc -mcpu=mips32r2 -triple=mips-pc-linux -filetype=obj -relocation-model=static %s -o - \
     10 // RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
     11 // RUN: | FileCheck %s
     12 
     13 	.text
     14 	.abicalls
     15 	.option	pic0
     16 	.section	.mdebug.abi32,"",@progbits
     17 	.file	"/home/espindola/llvm/llvm/test/MC/Mips/mips_gprel16.ll"
     18 	.text
     19 	.globl	testvar1
     20 	.align	2
     21 	.type	testvar1,@function
     22 	.set	nomips16
     23 	.ent	testvar1
     24 testvar1:                               # @testvar1
     25 	.frame	$sp,0,$ra
     26 	.mask 	0x00000000,0
     27 	.fmask	0x00000000,0
     28 	.set	noreorder
     29 	.set	nomacro
     30 	.set	noat
     31 # BB#0:                                 # %entry
     32 // CHECK: lw ${{[0-9]+}}, 0($gp)
     33 	lw	$1, %gp_rel(var1)($gp)
     34 	jr	$ra
     35 	sltu	$2, $zero, $1
     36 	.set	at
     37 	.set	macro
     38 	.set	reorder
     39 	.end	testvar1
     40 $tmp0:
     41 	.size	testvar1, ($tmp0)-testvar1
     42 
     43 	.globl	testvar2
     44 	.align	2
     45 	.type	testvar2,@function
     46 	.set	nomips16
     47 	.ent	testvar2
     48 testvar2:                               # @testvar2
     49 	.frame	$sp,0,$ra
     50 	.mask 	0x00000000,0
     51 	.fmask	0x00000000,0
     52 	.set	noreorder
     53 	.set	nomacro
     54 	.set	noat
     55 # BB#0:                                 # %entry
     56 // CHECK: lw ${{[0-9]+}}, 4($gp)
     57 	lw	$1, %gp_rel(var2)($gp)
     58 	jr	$ra
     59 	sltu	$2, $zero, $1
     60 	.set	at
     61 	.set	macro
     62 	.set	reorder
     63 	.end	testvar2
     64 $tmp1:
     65 	.size	testvar2, ($tmp1)-testvar2
     66 
     67 	.type	var1,@object            # @var1
     68 	.local	var1
     69 	.comm	var1,4,4
     70 	.type	var2,@object            # @var2
     71 	.local	var2
     72 	.comm	var2,4,4
     73 
     74