1# REQUIRES: hexagon
2# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %s -o %t.o
3# RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=RELOC %s
4# RUN: ld.lld %t.o -o %t
5# RUN: llvm-objdump -d --print-imm-hex %t | FileCheck %s
6
7	.globl	_start
8	.type	_start, @function
9_start:
10r0 = ugp
11
12# RELOC:      0x4 R_HEX_TPREL_32_6_X a 0x0
13# RELOC-NEXT: 0x8 R_HEX_TPREL_16_X a 0x0
14# CHECK:      { immext(#0xffffffc0)
15# CHECK-NEXT:   r1 = add(r0,##-0x10) }
16                r1 = add(r0,##a@TPREL)
17
18# RELOC-NEXT: 0xC R_HEX_TPREL_32_6_X a 0x0
19# RELOC-NEXT: 0x10 R_HEX_TPREL_11_X a 0x0
20# CHECK:      { immext(#0xffffffc0)
21# CHECK-NEXT:   r2 = memw(r0+##-0x10) }
22                r2 = memw(r0+##a@TPREL)
23
24# RELOC-NEXT: 0x14 R_HEX_TPREL_HI16 a 0x0
25# R_HEX_TPREL_HI16
26# CHECK: {      r3.h = #0xffff }
27                r3.h = #a@TPREL
28
29# RELOC-NEXT: 0x18 R_HEX_TPREL_LO16 a 0x0
30# R_HEX_TPREL_LO16
31# CHECK: {      r3.l = #0xfff0 }
32                r3.l = #a@TPREL
33
34# RELOC-NEXT: 0x1C R_HEX_TPREL_16 a 0x0
35# CHECK: {      r4 = #-0x10 }
36                r4 = #a@TPREL
37
38        .section        .tdata,"awT",@progbits
39        .globl  a
40        .p2align        2
41a:
42        .word   1
43        .size   a, 4
44
45        .globl  b
46        .p2align        2
47b:
48        .word   2
49        .size   b, 4
50
51        .globl  c
52        .p2align        2
53c:
54        .word   3
55        .size   c, 4
56
57        .globl  d
58        .p2align        2
59d:
60        .word   4
61        .size   d, 4
62