Skip to content

[LoongArch] Move fix-tle-le-sym-type test to test/MC. NFC #133839

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
Apr 2, 2025

Conversation

zhaoqi5
Copy link
Contributor

@zhaoqi5 zhaoqi5 commented Apr 1, 2025

No description provided.

@llvmbot llvmbot added mc Machine (object) code backend:loongarch labels Apr 1, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 1, 2025

@llvm/pr-subscribers-mc

@llvm/pr-subscribers-backend-loongarch

Author: ZhaoQi (zhaoqi5)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/133839.diff

2 Files Affected:

  • (removed) llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll (-24)
  • (added) llvm/test/MC/LoongArch/Relocations/relocation-specifier.s (+26)
diff --git a/llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll b/llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
deleted file mode 100644
index d39454a51a445..0000000000000
--- a/llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; 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 TLS   GLOBAL DEFAULT  UND tls_sym
-
-; LA64:      Symbol table '.symtab' contains [[#]] entries:
-; LA64-NEXT:    Num:    Value          Size Type  Bind   Vis      Ndx Name
-; LA64:              0000000000000000     0 TLS   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)
diff --git a/llvm/test/MC/LoongArch/Relocations/relocation-specifier.s b/llvm/test/MC/LoongArch/Relocations/relocation-specifier.s
new file mode 100644
index 0000000000000..d0898aaab92fe
--- /dev/null
+++ b/llvm/test/MC/LoongArch/Relocations/relocation-specifier.s
@@ -0,0 +1,26 @@
+# RUN: llvm-mc --filetype=obj --triple=loongarch32 %s -o %t-la32
+# RUN: llvm-readelf -rs %t-la32 | FileCheck %s --check-prefixes=CHECK,RELOC32
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 %s -o %t-la64
+# RUN: llvm-readelf -rs %t-la64 | FileCheck %s --check-prefixes=CHECK,RELOC64
+
+## This test is similar to test/MC/CSKY/relocation-specifier.s.
+
+# RELOC32: '.rela.data'
+# RELOC32: R_LARCH_32 00000000 .data + 0
+
+# RELOC64: '.rela.data'
+# RELOC64: R_LARCH_32 0000000000000000 .data + 0
+
+# CHECK: TLS GLOBAL DEFAULT UND gd
+# CHECK: TLS GLOBAL DEFAULT UND ld
+# CHECK: TLS GLOBAL DEFAULT UND ie
+# CHECK: TLS GLOBAL DEFAULT UND le
+
+pcalau12i $t1, %gd_pc_hi20(gd)
+pcalau12i $t1, %ld_pc_hi20(ld)
+pcalau12i $t1, %ie_pc_hi20(ie)
+lu12i.w $t1, %le_hi20_r(le)
+
+.data
+local:
+.long local

@tstellar tstellar added this to the LLVM 20.X Release milestone Apr 1, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Apr 1, 2025
@tstellar tstellar moved this from Needs Triage to Needs Review in LLVM Release Status Apr 1, 2025
@tstellar tstellar moved this from Needs Review to Needs Merge in LLVM Release Status Apr 1, 2025
@tstellar tstellar moved this from Needs Merge to Needs Pull Request in LLVM Release Status Apr 1, 2025
@zhaoqi5 zhaoqi5 merged commit 4696831 into main Apr 2, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from Needs Pull Request to Done in LLVM Release Status Apr 2, 2025
@zhaoqi5 zhaoqi5 deleted the users/zhaoqi5/move-tlsle-sym-test-2-mc branch April 2, 2025 01:11
@zhaoqi5
Copy link
Contributor Author

zhaoqi5 commented Apr 2, 2025

/cherry-pick 4696831

@llvmbot
Copy link
Member

llvmbot commented Apr 2, 2025

/pull-request #134014

Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request Apr 2, 2025
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:loongarch mc Machine (object) code
Projects
Development

Successfully merging this pull request may close these issues.

4 participants