1 ; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s
2 ; RUN: llc < %s -mtriple=aarch64-fuchsia | FileCheck %s
3 ; RUN: llc < %s -mtriple=aarch64-fuchsia -code-model=kernel | FileCheck --check-prefix=FUCHSIA-KERNEL %s
4 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el1 | FileCheck --check-prefix=USEEL1 %s
5 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el2 | FileCheck --check-prefix=USEEL2 %s
6 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el3 | FileCheck --check-prefix=USEEL3 %s
8 ; Function Attrs: nounwind readnone
9 declare i8* @llvm.thread.pointer() #1
11 define i8* @thread_pointer() {
12 ; CHECK: thread_pointer:
13 ; CHECK: mrs {{x[0-9]+}}, TPIDR_EL0
14 ; FUCHSIA-KERNEL: thread_pointer:
15 ; FUCHSIA-KERNEL: mrs {{x[0-9]+}}, TPIDR_EL1
16 ; USEEL1: thread_pointer:
17 ; USEEL1: mrs {{x[0-9]+}}, TPIDR_EL1
18 ; USEEL2: thread_pointer:
19 ; USEEL2: mrs {{x[0-9]+}}, TPIDR_EL2
20 ; USEEL3: thread_pointer:
21 ; USEEL3: mrs {{x[0-9]+}}, TPIDR_EL3
22 %1 = tail call i8* @llvm.thread.pointer()