xref: /llvm-project/llvm/test/CodeGen/LoongArch/thread-pointer.ll (revision 9d4f7f44b64d87d1068859906f43b7ce03a7388b)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s --mtriple=loongarch32 -mattr=+d | FileCheck %s
3; RUN: llc < %s --mtriple=loongarch64 -mattr=+d | FileCheck %s
4
5declare ptr @llvm.thread.pointer()
6
7define ptr @thread_pointer() nounwind {
8; CHECK-LABEL: thread_pointer:
9; CHECK:       # %bb.0:
10; CHECK-NEXT:    move $a0, $tp
11; CHECK-NEXT:    ret
12  %1 = tail call ptr @llvm.thread.pointer()
13  ret ptr %1
14}
15