1 ; RUN: llc %s -mtriple=thumbv7-linux-gnueabi -o - | \
2 ; RUN: FileCheck -check-prefix=ELFASM %s
3 ; RUN: llc %s -mtriple=thumbebv7-linux-gnueabi -o - | \
4 ; RUN: FileCheck -check-prefix=ELFASM %s
5 ; RUN: llc %s -mtriple=thumbv7-linux-gnueabi -filetype=obj -o - | \
6 ; RUN: llvm-readobj -S --sd | FileCheck -check-prefix=ELFOBJ -check-prefix=ELFOBJ-LE %s
7 ; RUN: llc %s -mtriple=thumbebv7-linux-gnueabi -filetype=obj -o - | \
8 ; RUN: llvm-readobj -S --sd | FileCheck -check-prefix=ELFOBJ -check-prefix=ELFOBJ-BE %s
10 ;; Make sure that bl __aeabi_read_tp is materialized and fixed up correctly
13 @i = external thread_local global i32
14 @a = external global i8
15 @b = external global [10 x i8]
17 define arm_aapcs_vfpcc i32 @main() nounwind {
19 %0 = load i32, i32* @i, align 4
20 switch i32 %0, label %bb2 [
26 %1 = tail call arm_aapcs_vfpcc i32 @foo(i8* @a) nounwind
28 ; ELFASM: bl __aeabi_read_tp
34 ; ELFOBJ-LE: SectionData (
35 ;;; BL __aeabi_read_tp is ---+
37 ; ELFOBJ-LE-NEXT: 0000: 80B50E48 78440168 FFF7FEFF 40580D28
38 ; ELFOBJ-BE: SectionData (
39 ;;; BL __aeabi_read_tp is ---+
41 ; ELFOBJ-BE-NEXT: 0000: B580480E 44786801 F7FFFFFE 5840280D
45 %2 = tail call arm_aapcs_vfpcc i32 @bar(i32* bitcast ([10 x i8]* @b to i32*)) nounwind
52 declare arm_aapcs_vfpcc i32 @foo(i8*)
54 declare arm_aapcs_vfpcc i32 @bar(i32*)