1 ; RUN: opt -S -wholeprogramdevirt -pass-remarks=wholeprogramdevirt %s 2>&1 | FileCheck %s
3 ; CHECK-NOT: devirtualized call
5 target datalayout = "e-p:64:64"
6 target triple = "x86_64-unknown-linux-gnu"
8 @vt = global [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !0
10 define void @vf(i8* %this) {
14 ; CHECK: define void @call
15 define void @call(i8* %obj) {
16 %vtableptr = bitcast i8* %obj to [1 x i8*]**
17 %vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
18 %vtablei8 = bitcast [1 x i8*]* %vtable to i8*
19 %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
20 call void @llvm.assume(i1 %p)
21 %fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
22 %fptr = load i8*, i8** %fptrptr
23 %fptr_casted = bitcast i8* %fptr to void (i8*)*
25 call void %fptr_casted(i8* %obj)
29 declare i1 @llvm.type.test(i8*, metadata)
30 declare void @llvm.assume(i1)
32 !0 = !{i32 0, !"typeid"}