llvm-project/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll
Paul Kirth f6f474c4ef
[llvm][lld] Pre-commit tests for RISCV TLSDESC symbols
Currently, we mistakenly mark the local labels used in RISC-V TLSDESC as
TLS symbols, when they should not be. This patch adds tests with the
current incorrect behavior, and subsequent patches will address the
issue.

Reviewers: MaskRay, topperc

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/85816
2024-03-20 13:39:39 -07:00

25 lines
866 B
LLVM

;; The test in this file do not appear in tls-models.ll because
;; they are not auto-generated.
; RUN: llc -mtriple=riscv64 -relocation-model=pic -enable-tlsdesc < %s \
; RUN: | llvm-mc -triple=riscv64 -filetype=obj -o - \
; RUN: | llvm-readelf --symbols - \
; RUN: | FileCheck %s
; RUN: llc -mtriple=riscv32 -relocation-model=pic -enable-tlsdesc < %s \
; RUN: | llvm-mc -triple=riscv32 -filetype=obj -o - \
; RUN: | llvm-readelf --symbols - \
; RUN: | FileCheck %s
; Check that TLS symbols are lowered correctly based on the specified
; model. Make sure they're external to avoid them all being optimised to Local
; Exec for the executable.
@unspecified = external thread_local global i32
define ptr @f1() nounwind {
entry:
ret ptr @unspecified
; CHECK: Symbol table '.symtab' contains 7 entries:
; CHECK: TLS {{.*}} unspecified
}