Skip to content

release/20.x: [LoongArch] Pre-commit test for fixing tls-le symbol type #132361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
Original file line number Diff line number Diff line change
@@ -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