1 ; RUN: llc < %s -march=ppc64 | FileCheck %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 define void @foo() nounwind readnone noinline {
9 define weak void @foo_weak() nounwind {
13 ; Calls to local function does not require the TOC restore 'nop'
14 define void @test_direct() nounwind readnone {
16 tail call void @foo() nounwind
22 ; Calls to weak function requires a TOC restore 'nop' because they
23 ; may be overridden in a different module.
24 define void @test_weak() nounwind readnone {
26 tail call void @foo_weak() nounwind
32 ; Indirect calls requires a full stub creation
33 define void @test_indirect(void ()* nocapture %fp) nounwind {
34 ; CHECK: test_indirect:
35 tail call void %fp() nounwind
36 ; CHECK: ld [[FP:[0-9]+]], 0(3)
39 ; CHECK-NEXT: mtctr [[FP]]
41 ; CHECK-NEXT: ld 2, 40(1)
45 ; Absolute vales should be have the TOC restore 'nop'
46 define void @test_abs() nounwind {
48 tail call void inttoptr (i64 1024 to void ()*)() nounwind
54 declare double @sin(double) nounwind
56 ; External functions call should also have a 'nop'
57 define double @test_external(double %x) nounwind {
58 ; CHECK: test_external:
59 %call = tail call double @sin(double %x) nounwind