llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll: s/REQUIRE/REQUIRES/
[oota-llvm.git] / test / CodeGen / PowerPC / ppc64le-localentry.ll
1 ; RUN: llc -march=ppc64le -mcpu=pwr8 < %s | FileCheck %s
2 ; RUN: llc -march=ppc64le -mcpu=pwr8 -O0 < %s | FileCheck %s
3 ; RUN: llc -march=ppc64le < %s | FileCheck %s
4 ; RUN: llc -march=ppc64le -O0 < %s | FileCheck %s
5
6 ; The second run of the test case is to ensure the behaviour is the same
7 ; without specifying -mcpu=pwr8 as that is now the baseline for ppc64le.
8
9 target datalayout = "e-m:e-i64:64-n32:64"
10 target triple = "powerpc64le-unknown-linux-gnu"
11
12 @number64 = global i64 10, align 8
13
14 ; CHECK: .abiversion 2
15
16 define i64 @use_toc(i64 %a) nounwind {
17 entry:
18 ; CHECK-LABEL: @use_toc
19 ; CHECK-NEXT: .L{{.*}}:
20 ; CHECK-NEXT: .Ltmp[[TMP1:[0-9]+]]:
21 ; CHECK-NEXT: addis 2, 12, .TOC.-.Ltmp[[TMP1]]@ha
22 ; CHECK-NEXT: addi 2, 2, .TOC.-.Ltmp[[TMP1]]@l
23 ; CHECK-NEXT: .Ltmp[[TMP2:[0-9]+]]:
24 ; CHECK-NEXT: .localentry use_toc, .Ltmp[[TMP2]]-.Ltmp[[TMP1]]
25 ; CHECK-NEXT: %entry
26   %0 = load i64, i64* @number64, align 8
27   %cmp = icmp eq i64 %0, %a
28   %conv1 = zext i1 %cmp to i64
29   ret i64 %conv1
30 }
31
32 declare void @callee()
33 define void @use_toc_implicit() nounwind {
34 entry:
35 ; CHECK-LABEL: @use_toc_implicit
36 ; CHECK-NEXT: .L{{.*}}:
37 ; CHECK-NEXT: .Ltmp[[TMP1:[0-9]+]]:
38 ; CHECK-NEXT: addis 2, 12, .TOC.-.Ltmp[[TMP1]]@ha
39 ; CHECK-NEXT: addi 2, 2, .TOC.-.Ltmp[[TMP1]]@l
40 ; CHECK-NEXT: .Ltmp[[TMP2:[0-9]+]]:
41 ; CHECK-NEXT: .localentry use_toc_implicit, .Ltmp[[TMP2]]-.Ltmp[[TMP1]]
42 ; CHECK-NEXT: %entry
43   call void @callee()
44   ret void
45 }
46
47 define i64 @no_toc(i64 %a) nounwind {
48 entry:
49 ; CHECK-LABEL: @no_toc
50 ; CHECK-NEXT: .L{{.*}}:
51 ; CHECK-NEXT: %entry
52   ret i64 %a
53 }
54