63 lines · plain
1;; Test if temporary labels are generated for each indirect callsite.2;; Test if the .llvm.callgraph section contains the MD5 hash of callees' type (type id)3;; is correctly paired with its corresponding temporary label generated for indirect4;; call sites annotated with !callee_type metadata.5;; Test if the .llvm.callgraph section contains unique direct callees.6 7; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -o - < %s | FileCheck %s8 9declare !type !0 void @direct_foo()10declare !type !1 i32 @direct_bar(i8)11declare !type !2 ptr @direct_baz(ptr)12 13; CHECK: ball:14define ptr @ball() {15entry:16 call void @direct_foo()17 %fp_foo_val = load ptr, ptr null, align 8 18 call void (...) %fp_foo_val(), !callee_type !0 19 call void @direct_foo()20 %fp_bar_val = load ptr, ptr null, align 8 21 %call_fp_bar = call i32 %fp_bar_val(i8 0), !callee_type !2 22 %call_fp_bar_direct = call i32 @direct_bar(i8 1)23 %fp_baz_val = load ptr, ptr null, align 824 %call_fp_baz = call ptr %fp_baz_val(ptr null), !callee_type !425 call void @direct_foo()26 %call_fp_baz_direct = call ptr @direct_baz(ptr null)27 call void @direct_foo()28 ret ptr %call_fp_baz29}30 31!0 = !{!1}32!1 = !{i64 0, !"_ZTSFvE.generalized"}33!2 = !{!3}34!3 = !{i64 0, !"_ZTSFicE.generalized"}35!4 = !{!5}36!5 = !{i64 0, !"_ZTSFPvS_E.generalized"}37 38; CHECK: .section .llvm.callgraph,"o",%llvm_call_graph,.text39;; Version40; CHECK-NEXT: .byte 041;; Flags42; CHECK-NEXT: .byte 743;; Function Entry PC44; CHECK-NEXT: .long ball45;; Function type ID -- set to 0 as no type metadata attached to function.46; CHECK-NEXT: .long 047; CHECK-NEXT: .long 048;; Number of unique direct callees.49; CHECK-NEXT: .byte 350;; Direct callees.51; CHECK-NEXT: .long direct_foo52; CHECK-NEXT: .long direct_bar53; CHECK-NEXT: .long direct_baz54;; Number of unique indirect target type IDs.55; CHECK-NEXT: .byte 356;; Indirect type IDs.57; CHECK-NEXT: .long 83828842058; CHECK-NEXT: .long 105355237359; CHECK-NEXT: .long 150552738060; CHECK-NEXT: .long 81463180961; CHECK-NEXT: .long 34241701862; CHECK-NEXT: .long 201310821663