1 ; RUN: opt < %s -passes=pgo-instr-gen -enable-vtable-value-profiling -S 2>&1 | FileCheck %s
3 ; Test that unsupported warning is emitted for non-ELF object files.
4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
5 target triple = "arm64-apple-macosx14.0.0"
7 ; CHECK: warning: {{.*}} VTable value profiling is presently not supported for non-ELF object formats
9 @_ZTV4Base = constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZN4Base4funcEi] }, !type !0, !type !1
10 @_ZTV7Derived = constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZN7Derived4funcEi] }, !type !0, !type !1, !type !2, !type !3
12 @llvm.compiler.used = appending global [2 x ptr] [ptr @_ZTV4Base, ptr @_ZTV7Derived], section "llvm.metadata"
14 define i32 @_Z4funci(i32 %a) {
16 %call = call ptr @_Z10createTypev()
17 %vtable = load ptr, ptr %call
18 %0 = call i1 @llvm.public.type.test(ptr %vtable, metadata !"_ZTS7Derived")
19 call void @llvm.assume(i1 %0)
20 %1 = load ptr, ptr %vtable
21 %call1 = call i32 %1(ptr %call, i32 %a)
25 declare ptr @_Z10createTypev()
26 declare i1 @llvm.public.type.test(ptr, metadata)
27 declare void @llvm.assume(i1)
28 declare i32 @_ZN4Base4funcEi(ptr, i32)
29 declare i32 @_ZN7Derived4funcEi(ptr , i32)
31 !0 = !{i64 16, !"_ZTS4Base"}
32 !1 = !{i64 16, !"_ZTSM4BaseFiiE.virtual"}
33 !2 = !{i64 16, !"_ZTS7Derived"}
34 !3 = !{i64 16, !"_ZTSM7DerivedFiiE.virtual"}