59 lines · plain
1/// Test the callgraph section to make sure the indirect callsites2/// (annotated by generated temporary labels .Ltmp*) are associated3/// with the corresponding callee type identifiers.4 5// RUN: llvm-mc -triple=x86_64 -filetype=obj -o - < %s | llvm-readelf -x .llvm.callgraph - | FileCheck %s6 7 .text8 .globl ball # -- Begin function ball9 .p2align 410 .type ball,@function11ball: # @ball12.Lfunc_begin0: 13# %bb.0: # %entry14 pushq %rbx 15 subq $32, %rsp 16 movl $0, 4(%rsp)17 movq foo@GOTPCREL(%rip), %rcx18 movq %rcx, 24(%rsp)19 xorl %eax, %eax20 callq *%rcx21.Ltmp0:22 movq bar@GOTPCREL(%rip), %rax23 movq %rax, 16(%rsp)24 movsbl 3(%rsp), %edi25 callq *%rax26.Ltmp1:27 movq baz@GOTPCREL(%rip), %rax28 movq %rax, 8(%rsp)29 leaq 3(%rsp), %rbx30 movq %rbx, %rdi31 callq *%rax32.Ltmp2:33 callq foo@PLT34 movsbl 3(%rsp), %edi35 callq bar@PLT36 movq %rbx, %rdi37 callq baz@PLT38 addq $32, %rsp 39 popq %rbx 40 retq41 .section .llvm.callgraph,"o",@progbits,.text42 .quad 043 .quad .Lfunc_begin044 .quad 145 .quad 346 /// MD5 hash of the callee type ID for foo.47 // CHECK: 2444f731 f5eecb3e48 .quad 0x3ecbeef531f7442449 .quad .Ltmp050 /// MD5 hash of the callee type ID for bar.51 // CHECK: 5486bc59 814b8e3052 .quad 0x308e4b8159bc865453 .quad .Ltmp154 /// MD5 hash of the callee type ID for baz.55 // CHECK: 7ade6814 f897fd7756 .quad 0x77fd97f81468de7a57 .quad .Ltmp258 .text59