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* @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: 2DE90048 0E487844 0168FFF7 FEFF4058
38 ; ELFOBJ-BE: SectionData (
39 ;;; BL __aeabi_read_tp is ---------+
41 ; ELFOBJ-BE-NEXT: 0000: E92D4800 480E4478 6801F7FF FFFE5840
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*)