1 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -O0 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -O0 < %s | FileCheck %s
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.
9 target datalayout = "e-m:e-i64:64-n32:64"
10 target triple = "powerpc64le-unknown-linux-gnu"
12 @number64 = global i64 10, align 8
14 ; CHECK: .abiversion 2
16 define i64 @use_toc(i64 %a) nounwind {
18 ; CHECK-LABEL: @use_toc
19 ; CHECK-NEXT: .L{{.*}}:
20 ; CHECK-NEXT: .Lfunc_gep[[FN:[0-9]+]]:
21 ; CHECK-NEXT: addis 2, 12, .TOC.-.Lfunc_gep[[FN]]@ha
22 ; CHECK-NEXT: addi 2, 2, .TOC.-.Lfunc_gep[[FN]]@l
23 ; CHECK-NEXT: .Lfunc_lep[[FN]]:
24 ; CHECK-NEXT: .localentry use_toc, .Lfunc_lep[[FN]]-.Lfunc_gep[[FN]]
26 %0 = load i64, i64* @number64, align 8
27 %cmp = icmp eq i64 %0, %a
28 %conv1 = zext i1 %cmp to i64
32 declare void @callee()
33 define void @use_toc_implicit() nounwind {
35 ; CHECK-LABEL: @use_toc_implicit
36 ; CHECK-NEXT: .L{{.*}}:
37 ; CHECK-NEXT: .Lfunc_gep[[FN:[0-9]+]]:
38 ; CHECK-NEXT: addis 2, 12, .TOC.-.Lfunc_gep[[FN]]@ha
39 ; CHECK-NEXT: addi 2, 2, .TOC.-.Lfunc_gep[[FN]]@l
40 ; CHECK-NEXT: .Lfunc_lep[[FN]]:
41 ; CHECK-NEXT: .localentry use_toc_implicit, .Lfunc_lep[[FN]]-.Lfunc_gep[[FN]]
47 define i64 @no_toc(i64 %a) nounwind {
49 ; CHECK-LABEL: @no_toc
50 ; CHECK-NEXT: .L{{.*}}: