
Thread-local globals live, by default, in the default globals address space, which may not be 0, so we need to overload @llvm.thread.pointer to support other address spaces, and use the default globals address space in Clang.
20 lines
515 B
LLVM
20 lines
515 B
LLVM
; Test autoupgrade of arch-specific thread pointer intrinsics
|
|
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
|
|
|
|
declare ptr @llvm.aarch64.thread.pointer()
|
|
declare ptr @llvm.arm.thread.pointer()
|
|
|
|
define ptr @test1() {
|
|
; CHECK-LABEL: define ptr @test1()
|
|
; CHECK: call ptr @llvm.thread.pointer.p0()
|
|
%1 = call ptr @llvm.aarch64.thread.pointer()
|
|
ret ptr %1
|
|
}
|
|
|
|
define ptr @test2() {
|
|
; CHECK-LABEL: define ptr @test2()
|
|
; CHECK: call ptr @llvm.thread.pointer.p0()
|
|
%1 = call ptr @llvm.arm.thread.pointer()
|
|
ret ptr %1
|
|
}
|