aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/RISCV/thread-pointer.ll
blob: 4465b7ecc910c9ad5d5d3ed38f9487e41106f0f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=riscv64 | FileCheck %s
; RUN: llc < %s -mtriple=riscv32 | FileCheck %s

declare ptr @llvm.thread.pointer()

define ptr @thread_pointer() nounwind {
; CHECK-LABEL: thread_pointer:
; CHECK:       # %bb.0:
; CHECK-NEXT:    mv a0, tp
; CHECK-NEXT:    ret
  %1 = tail call ptr @llvm.thread.pointer()
  ret ptr %1
}