• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
2; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s \
3; RUN:   | FileCheck %s --check-prefix=CHECK-S
4; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
5; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names --filetype=obj < %s | \
6; RUN:   llvm-objdump -dr - | FileCheck %s --check-prefix=CHECK-O
7; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \
8; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s \
9; RUN:   | FileCheck %s --check-prefix=CHECK-S
10; RUN: llc -verify-machineinstrs -target-abi=elfv2 -mtriple=powerpc64-- \
11; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names --filetype=obj < %s | \
12; RUN:   llvm-objdump -dr - | FileCheck %s --check-prefix=CHECK-O
13
14
15; CHECK-S-LABEL: caller
16; CHECK-S: b callee@notoc
17
18; CHECK-O-LABEL: caller
19; CHECK-O: b
20; CHECK-O-NEXT: R_PPC64_REL24_NOTOC callee
21define dso_local signext i32 @caller() local_unnamed_addr {
22entry:
23  %call = tail call signext i32 bitcast (i32 (...)* @callee to i32 ()*)()
24  ret i32 %call
25}
26
27declare signext i32 @callee(...) local_unnamed_addr
28
29
30; Some calls can be considered Extrnal Symbols.
31; CHECK-S-LABEL: ExternalSymbol
32; CHECK-S: b memcpy@notoc
33
34; CHECK-O-LABEL: ExternalSymbol
35; CHECK-O: b
36; CHECK-O-NEXT: R_PPC64_REL24_NOTOC memcpy
37define dso_local void @ExternalSymbol(i8* nocapture %out, i8* nocapture readonly %in, i64 %num) local_unnamed_addr {
38entry:
39  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %out, i8* align 1 %in, i64 %num, i1 false)
40  ret void
41}
42
43declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg)
44
45
46; CHECK-S-LABEL: callerNoTail
47; CHECK-S:     bl callee@notoc
48; CHECK-S-NOT: nop
49; CHECK-S:     bl callee@notoc
50; CHECK-S-NOT: nop
51; CHECK-S:     blr
52
53; CHECK-O-LABEL: callerNoTail
54; CHECK-O:      bl
55; CHECK-O-NEXT: R_PPC64_REL24_NOTOC callee
56; CHECK-O-NOT:  nop
57; CHECK-O:      bl
58; CHECK-O-NEXT: R_PPC64_REL24_NOTOC callee
59; CHECK-O-NOT:  nop
60; CHECK-O:      blr
61define dso_local signext i32 @callerNoTail() local_unnamed_addr {
62entry:
63  %call1 = tail call signext i32 bitcast (i32 (...)* @callee to i32 ()*)()
64  %call2 = tail call signext i32 bitcast (i32 (...)* @callee to i32 ()*)()
65  %add = add i32 %call1, %call2
66  ret i32 %add
67}
68
69