3 # RUN: llvm-mc --filetype=obj --triple=loongarch32 %s -o %t.32.o
4 # RUN: llvm-mc --filetype=obj --triple=loongarch64 %s -o %t.64.o
6 # RUN: ld.lld %t.32.o -o %t.32
7 # RUN: llvm-nm -p %t.32 | FileCheck --check-prefixes=NM %s
8 # RUN: llvm-objdump -d --no-show-raw-insn %t.32 | FileCheck --check-prefixes=LE %s
10 # RUN: ld.lld %t.64.o -o %t.64
11 # RUN: llvm-objdump -d --no-show-raw-insn %t.64 | FileCheck --check-prefixes=LE %s
13 # RUN: not ld.lld -shared %t.32.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
15 # ERR: error: relocation R_LARCH_TLS_LE_HI20 against .LANCHOR0 cannot be used with -shared
16 # ERR: error: relocation R_LARCH_TLS_LE_LO12 against .LANCHOR0 cannot be used with -shared
17 # ERR: error: relocation R_LARCH_TLS_LE_HI20 against a cannot be used with -shared
18 # ERR: error: relocation R_LARCH_TLS_LE_LO12 against a cannot be used with -shared
20 # NM: {{0*}}00000008 b .LANCHOR0
21 # NM: {{0*}}00000800 B a
23 ## .LANCHOR0@tprel = 8
26 # LE-NEXT: ori $a0, $a0, 8
27 # LE-NEXT: lu12i.w $a1, 0
28 # LE-NEXT: ori $a1, $a1, 2048
33 la.tls.le $a0
, .LANCHOR0
36 .section .tbss,"awT",@nobits