2016-07-19 21:35:11 +08:00
|
|
|
; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s
|
2017-04-05 03:51:53 +08:00
|
|
|
; RUN: llc < %s -mtriple=aarch64-fuchsia | FileCheck %s
|
|
|
|
; RUN: llc < %s -mtriple=aarch64-fuchsia -code-model=kernel | FileCheck --check-prefix=FUCHSIA-KERNEL %s
|
2019-03-21 19:30:17 +08:00
|
|
|
; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el1 | FileCheck --check-prefix=USEEL1 %s
|
|
|
|
; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el2 | FileCheck --check-prefix=USEEL2 %s
|
|
|
|
; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+tpidr-el3 | FileCheck --check-prefix=USEEL3 %s
|
2015-07-28 21:03:31 +08:00
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
2016-04-20 04:51:05 +08:00
|
|
|
declare i8* @llvm.thread.pointer() #1
|
2015-07-28 21:03:31 +08:00
|
|
|
|
|
|
|
define i8* @thread_pointer() {
|
|
|
|
; CHECK: thread_pointer:
|
|
|
|
; CHECK: mrs {{x[0-9]+}}, TPIDR_EL0
|
2017-04-05 03:51:53 +08:00
|
|
|
; FUCHSIA-KERNEL: thread_pointer:
|
|
|
|
; FUCHSIA-KERNEL: mrs {{x[0-9]+}}, TPIDR_EL1
|
2019-03-21 19:30:17 +08:00
|
|
|
; USEEL1: thread_pointer:
|
|
|
|
; USEEL1: mrs {{x[0-9]+}}, TPIDR_EL1
|
|
|
|
; USEEL2: thread_pointer:
|
|
|
|
; USEEL2: mrs {{x[0-9]+}}, TPIDR_EL2
|
|
|
|
; USEEL3: thread_pointer:
|
|
|
|
; USEEL3: mrs {{x[0-9]+}}, TPIDR_EL3
|
2016-04-20 04:51:05 +08:00
|
|
|
%1 = tail call i8* @llvm.thread.pointer()
|
2015-07-28 21:03:31 +08:00
|
|
|
ret i8* %1
|
|
|
|
}
|