[InstCombine] Signed saturation patterns
[llvm-core.git] / test / CodeGen / ARM / thumb_indirect_calls.ll
blobf5ecd04280c984da8c47c616b40d63d04b5c0a92
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 void (i32)* null, align 4
6 ; CHECK-LABEL: foo:
7 define void @foo(i32 %x) {
8 entry:
9   %0 = load void (i32)*, void (i32)** @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(void (i32)* nocapture %g, i32 %x, void (i32)* 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