[AArch64][NFC] NFC for const vector as Instruction operand (#116790)
[llvm-project.git] / llvm / test / Transforms / WholeProgramDevirt / vcp-uses-this.ll
blob793f8772511bbe19daeb6a4043565760388e2bca
1 ; RUN: opt -S -passes=wholeprogramdevirt -whole-program-visibility %s | FileCheck %s
3 target datalayout = "e-p:64:64"
4 target triple = "x86_64-unknown-linux-gnu"
6 @vt1 = constant [1 x ptr] [ptr @vf1], !type !0
7 @vt2 = constant [1 x ptr] [ptr @vf2], !type !0
9 define i32 @vf1(ptr %this) readnone {
10   %this_int = ptrtoint ptr %this to i32
11   ret i32 %this_int
14 define i32 @vf2(ptr %this) readnone {
15   %this_int = ptrtoint ptr %this to i32
16   ret i32 %this_int
19 ; CHECK: define i32 @call
20 define i32 @call(ptr %obj) {
21   %vtable = load ptr, ptr %obj
22   %p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid")
23   call void @llvm.assume(i1 %p)
24   %fptr = load ptr, ptr %vtable
25   ; CHECK: call i32 %
26   %result = call i32 %fptr(ptr %obj)
27   ret i32 %result
30 declare i1 @llvm.type.test(ptr, metadata)
31 declare void @llvm.assume(i1)
33 !0 = !{i32 0, !"typeid"}