brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · f56c4bf Raw
41 lines · plain
1target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"2target triple = "x86_64-grtev4-linux-gnu"3 4source_filename = "-"5 6%struct.A = type { ptr }7%struct.B = type { %struct.A }8 9$_ZTV1B = comdat any10 11@_ZTV1B = constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, comdat, !type !0, !type !112 13define i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 comdat($_ZTV1B) {14   ret i32 0;15}16 17define i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 comdat($_ZTV1B) {18   ret i32 0;19}20 21define i32 @test2(ptr %obj, i32 %a) {22entry:23  %vtable2 = load ptr, ptr %obj24  %p2 = call i1 @llvm.type.test(ptr %vtable2, metadata !"_ZTS1B")25  call void @llvm.assume(i1 %p2)26 27  %fptrptr = getelementptr ptr, ptr %vtable2, i32 128  %fptr33 = load ptr, ptr %fptrptr, align 829 30  %call4 = tail call i32 %fptr33(ptr nonnull %obj, i32 %a)31  ret i32 %call432}33 34attributes #0 = { noinline optnone }35 36declare i1 @llvm.type.test(ptr, metadata)37declare void @llvm.assume(i1)38 39!0 = !{i64 16, !"_ZTS1A"}40!1 = !{i64 16, !"_ZTS1B"}41