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