mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 08:06:06 +00:00
[LoongArch] Pre-commit test for fixing tls-le symbol type
The symbol type of tls-le must be `TLS`, it was incorrectly set as `NOTYPE`. A later commit will fix it.
This commit is contained in:
parent
c177dbe484
commit
87adafcd2e
24
llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
Normal file
24
llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
Normal file
@ -0,0 +1,24 @@
|
||||
; RUN: llc --mtriple=loongarch32 --filetype=obj %s -o %t-la32
|
||||
; RUN: llvm-readelf -s %t-la32 | FileCheck %s --check-prefix=LA32
|
||||
|
||||
; RUN: llc --mtriple=loongarch64 --filetype=obj %s -o %t-la64
|
||||
; RUN: llvm-readelf -s %t-la64 | FileCheck %s --check-prefix=LA64
|
||||
|
||||
; LA32: Symbol table '.symtab' contains [[#]] entries:
|
||||
; LA32-NEXT: Num: Value Size Type Bind Vis Ndx Name
|
||||
; LA32: 00000000 0 NOTYPE GLOBAL DEFAULT UND tls_sym
|
||||
|
||||
; LA64: Symbol table '.symtab' contains [[#]] entries:
|
||||
; LA64-NEXT: Num: Value Size Type Bind Vis Ndx Name
|
||||
; LA64: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND tls_sym
|
||||
|
||||
@tls_sym = external thread_local(localexec) global i32
|
||||
|
||||
define dso_local signext i32 @test_tlsle() nounwind {
|
||||
entry:
|
||||
%0 = call ptr @llvm.threadlocal.address.p0(ptr @tls_sym)
|
||||
%1 = load i32, ptr %0
|
||||
ret i32 %1
|
||||
}
|
||||
|
||||
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull)
|
Loading…
x
Reference in New Issue
Block a user