brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 35e570b Raw
35 lines · plain
1;; Tests that we store the type identifiers in .llvm.callgraph section of the object file for tailcalls.2 3; RUN: llc -mtriple=arm-unknown-linux --call-graph-section -filetype=obj -o - < %s | \4; RUN: llvm-readelf -x .llvm.callgraph - | FileCheck %s5 6define i32 @check_tailcall(ptr %func, i8 %x) !type !0 {7entry:8  %call = tail call i32 %func(i8 signext %x), !callee_type !19  ret i32 %call10}11 12define i32 @main(i32 %argc) !type !3 {13entry:14  %andop = and i32 %argc, 115  %cmp = icmp eq i32 %andop, 016  %foo.bar = select i1 %cmp, ptr @foo, ptr @bar17  %call.i = tail call i32 %foo.bar(i8 signext 97), !callee_type !118  ret i32 %call.i19}20 21declare !type !2 i32 @foo(i8 signext)22 23declare !type !2 i32 @bar(i8 signext)24 25!0 = !{i64 0, !"_ZTSFiPvcE.generalized"}26!1 = !{!2}27!2 = !{i64 0, !"_ZTSFicE.generalized"}28!3 = !{i64 0, !"_ZTSFiiE.generalized"}29 30; CHECK:      Hex dump of section '.llvm.callgraph':31; CHECK-NEXT: 0x00000000 00050000 00008e19 0b7f3326 e300015432; CHECK-NEXT: 0x00000010 86bc5981 4b8e3000 05000000 00a150b833;; Verify that the type id 0x308e4b8159bc8654 is in section.34; CHECK-NEXT: 0x00000020 3e0cfe3c b2015486 bc59814b 8e3035