brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 167cc6f Raw
38 lines · plain
1;; Tests that we store the type identifiers in .llvm.callgraph section of the object file.2 3; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -filetype=obj -o - < %s | \4; RUN: llvm-readelf -x .llvm.callgraph - | FileCheck %s5 6declare !type !0 void @foo()7 8declare !type !1 i32 @bar(i8)9 10declare !type !2 ptr @baz(ptr)11 12define void @main() {13entry:14  %fp_foo_val = load ptr, ptr null, align 815  call void (...) %fp_foo_val(), !callee_type !116  %fp_bar_val = load ptr, ptr null, align 817  %call_fp_bar = call i32 %fp_bar_val(i8 0), !callee_type !318  %fp_baz_val = load ptr, ptr null, align 819  %call_fp_baz = call ptr %fp_baz_val(ptr null), !callee_type !420  ret void21}22 23;; Check that the numeric type id (md5 hash) for the below type ids are emitted24;; to the callgraph section.25!0 = !{i64 0, !"_ZTSFvE.generalized"}26!1 = !{!0}27!2 = !{i64 0, !"_ZTSFicE.generalized"}28!3 = !{!2}29!4 = !{!5}30!5 = !{i64 0, !"_ZTSFPvS_E.generalized"}31 32;; Make sure following type IDs are in call graph section33;; 0x5eecb3e2444f731f, 0x814b8e305486bc59, 0xf897fd777ade681434; CHECK: Hex dump of section '.llvm.callgraph':35; CHECK-NEXT: 0x00000000 00050000 00000000 00000000 0000032436; CHECK-NEXT: 0x00000010 44f731f5 eecb3e54 86bc5981 4b8e307a37; CHECK-NEXT: 0x00000020 de6814f8 97fd7738