Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / CodeGen / ARM / thumb_indirect_calls.ll
blobcadebba4c195347488ea2d7ca05712872a4ac249
1 ; RUN: llc -mtriple=thumbv4t-eabi %s -o - | FileCheck --check-prefix=CHECK -check-prefix=CHECK-V4T %s
2 ; RUN: llc -mtriple=thumbv5t-eabi %s -o - | FileCheck --check-prefix=CHECK -check-prefix=CHECK-V5T %s
4 @f = common global ptr null, align 4
6 ; CHECK-LABEL: foo:
7 define void @foo(i32 %x) {
8 entry:
9   %0 = load ptr, ptr @f, align 4
10   tail call void %0(i32 %x)
11   ret void
13 ; CHECK: ldr [[TMP:r[0-3]]], [[F:\.[A-Z0-9_]+]]
14 ; CHECK: ldr [[CALLEE:r[0-3]]], [[[TMP]]]
16 ; CHECK-V4T-NOT: blx
17 ; CHECK-V4T: bl [[INDIRECT_PAD:\.Ltmp[0-9]+]]
18 ; CHECK-V4T: [[F]]:
19 ; CHECK-V4T: [[INDIRECT_PAD]]:
20 ; CHECK-V4T-NEXT: bx [[CALLEE]]
21 ; CHECK-V5T: blx [[CALLEE]]
24 ; CHECK-LABEL: bar:
25 define void @bar(ptr nocapture %g, i32 %x, ptr nocapture %h) {
26 entry:
27   tail call void %g(i32 %x)
28   tail call void %h(i32 %x)
29   ret void
31 ; CHECK-V4T: bl [[INDIRECT_PAD1:\.Ltmp[0-9]+]]
32 ; CHECK-V4T: bl [[INDIRECT_PAD2:\.Ltmp[0-9]+]]
33 ; CHECK-V4T: [[INDIRECT_PAD1]]:
34 ; CHECK-V4T-NEXT: bx
35 ; CHECK-V4T: [[INDIRECT_PAD2]]:
36 ; CHECK-V4T-NEXT: bx
37 ; CHECK-V5T: blx
38 ; CHECK-V5T: blx