| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | |
| ; RUN: llc -mtriple=hexagon < %s | FileCheck %s | |
| ; | |
| ; This test verifies the thread pointer intrinsic implementation for Hexagon. | |
| ; The thread pointer (UGP register) is used to access thread-local storage. | |
| declare ptr @llvm.thread.pointer() nounwind readnone | |
| define ptr @thread_pointer() nounwind { | |
| ; CHECK-LABEL: thread_pointer: | |
| ; CHECK: // %bb.0: | |
| ; CHECK: r0 = ugp | |
| ; CHECK-NEXT: jumpr r31 | |
| %1 = tail call ptr @llvm.thread.pointer() | |
| ret ptr %1 | |
| } |