xref: /llvm-project/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll (revision f6f474c4ef9694a4ca8f08d59fd112c250fb9c73)
1*f6f474c4SPaul Kirth;; The test in this file do not appear in tls-models.ll because
2*f6f474c4SPaul Kirth;; they are not auto-generated.
3*f6f474c4SPaul Kirth; RUN: llc -mtriple=riscv64 -relocation-model=pic -enable-tlsdesc < %s \
4*f6f474c4SPaul Kirth; RUN:     | llvm-mc -triple=riscv64 -filetype=obj -o - \
5*f6f474c4SPaul Kirth; RUN:     | llvm-readelf --symbols - \
6*f6f474c4SPaul Kirth; RUN:     | FileCheck %s
7*f6f474c4SPaul Kirth
8*f6f474c4SPaul Kirth; RUN: llc -mtriple=riscv32 -relocation-model=pic -enable-tlsdesc < %s \
9*f6f474c4SPaul Kirth; RUN:     | llvm-mc -triple=riscv32 -filetype=obj -o - \
10*f6f474c4SPaul Kirth; RUN:     | llvm-readelf --symbols - \
11*f6f474c4SPaul Kirth; RUN:     | FileCheck %s
12*f6f474c4SPaul Kirth
13*f6f474c4SPaul Kirth; Check that TLS symbols are lowered correctly based on the specified
14*f6f474c4SPaul Kirth; model. Make sure they're external to avoid them all being optimised to Local
15*f6f474c4SPaul Kirth; Exec for the executable.
16*f6f474c4SPaul Kirth
17*f6f474c4SPaul Kirth@unspecified = external thread_local global i32
18*f6f474c4SPaul Kirth
19*f6f474c4SPaul Kirthdefine ptr @f1() nounwind {
20*f6f474c4SPaul Kirthentry:
21*f6f474c4SPaul Kirth  ret ptr @unspecified
22*f6f474c4SPaul Kirth  ; CHECK: Symbol table '.symtab' contains 7 entries:
23*f6f474c4SPaul Kirth  ; CHECK: TLS {{.*}} unspecified
24*f6f474c4SPaul Kirth}
25