• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux  %s -o - | llvm-readobj -r | FileCheck %s
2
3// Check that the appropriate relocations were created.
4// For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.
5
6// CHECK: Relocations [
7// CHECK:   0x0 R_MIPS_HI16 _gp_disp
8// CHECK:   0x4 R_MIPS_LO16 _gp_disp
9// CHECK:   0x14 R_MIPS_GOT_HI16 ext_1
10// CHECK:   0x1C R_MIPS_GOT_LO16 ext_1
11// CHECK:   0x24 R_MIPS_CALL_HI16 printf
12// CHECK:   0x30 R_MIPS_CALL_LO16 printf
13// CHECK:   0x2C R_MIPS_GOT16 $.str
14// CHECK:   0x38 R_MIPS_LO16 $.str
15// CHECK: ]
16
17	.text
18	.abicalls
19	.section	.mdebug.abi32,"",@progbits
20	.file	"/home/espindola/llvm/llvm/test/MC/Mips/xgot.ll"
21	.text
22	.globl	fill
23	.align	2
24	.type	fill,@function
25	.set	nomips16
26	.ent	fill
27fill:                                   # @fill
28	.frame	$sp,24,$ra
29	.mask 	0x80000000,-4
30	.fmask	0x00000000,0
31	.set	noreorder
32	.set	nomacro
33	.set	noat
34# %bb.0:                                # %entry
35	lui	$2, %hi(_gp_disp)
36	addiu	$2, $2, %lo(_gp_disp)
37	addiu	$sp, $sp, -24
38	sw	$ra, 20($sp)            # 4-byte Folded Spill
39	addu	$gp, $2, $25
40	lui	$1, %got_hi(ext_1)
41	addu	$1, $1, $gp
42	lw	$1, %got_lo(ext_1)($1)
43	lw	$5, 0($1)
44	lui	$1, %call_hi(printf)
45	addu	$1, $1, $gp
46	lw	$2, %got($.str)($gp)
47	lw	$25, %call_lo(printf)($1)
48	jalr	$25
49	addiu	$4, $2, %lo($.str)
50	lw	$ra, 20($sp)            # 4-byte Folded Reload
51	jr	$ra
52	addiu	$sp, $sp, 24
53	.set	at
54	.set	macro
55	.set	reorder
56	.end	fill
57$tmp0:
58	.size	fill, ($tmp0)-fill
59
60	.type	$.str,@object           # @.str
61	.section	.rodata.str1.1,"aMS",@progbits,1
62$.str:
63	.asciz	"ext_1=%d, i=%d\n"
64	.size	$.str, 16
65
66
67	.text
68