brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 8a1c6ca Raw
41 lines · plain
1;; Tests that we store the type identifiers in .llvm.callgraph section of the object file.2 3; REQUIRES: x86-registered-target4; REQUIRES: arm-registered-target5 6; RUN: llc -mtriple=x86_64-unknown-linux --call-graph-section -filetype=obj -o - < %s | \7; RUN: llvm-readelf -x .llvm.callgraph - | FileCheck %s8 9declare !type !0 void @foo()10 11declare !type !1 i32 @bar(i8)12 13declare !type !2 ptr @baz(ptr)14 15define void @main() {16entry:17  %fp_foo_val = load ptr, ptr null, align 818  call void (...) %fp_foo_val(), !callee_type !119  %fp_bar_val = load ptr, ptr null, align 820  %call_fp_bar = call i32 %fp_bar_val(i8 0), !callee_type !321  %fp_baz_val = load ptr, ptr null, align 822  %call_fp_baz = call ptr %fp_baz_val(ptr null), !callee_type !423  ret void24}25 26;; Check that the numeric type id (md5 hash) for the below type ids are emitted27;; to the callgraph section.28!0 = !{i64 0, !"_ZTSFvE.generalized"}29!1 = !{!0}30!2 = !{i64 0, !"_ZTSFicE.generalized"}31!3 = !{!2}32!4 = !{!5}33!5 = !{i64 0, !"_ZTSFPvS_E.generalized"}34 35;; Make sure following type IDs are in call graph section36;; 0x5eecb3e2444f731f, 0x814b8e305486bc59, 0xf897fd777ade681437; CHECK:      Hex dump of section '.llvm.callgraph':38; CHECK-NEXT: 0x00000000 00050000 00000000 00000000 0000000039; CHECK-NEXT: 0x00000010 00000324 44f731f5 eecb3e54 86bc598140; CHECK-NEXT: 0x00000020 4b8e307a de6814f8 97fd7741