[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / clang / test / CodeGenCXX / RelativeVTablesABI / virtual-function-call.cpp
bloba0d40355e340bc6bb766854f748bcaed634aab6e
1 // Check that we call llvm.load.relative() on a vtable function call.
3 // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O3 -o - -emit-llvm | FileCheck %s
5 // CHECK: define{{.*}} void @_Z5A_fooP1A(ptr noundef %a) local_unnamed_addr
6 // CHECK-NEXT: entry:
7 // CHECK-NEXT: %vtable = load ptr, ptr %a
8 // CHECK-NEXT: [[func_ptr:%[0-9]+]] = tail call ptr @llvm.load.relative.i32(ptr %vtable, i32 0)
9 // CHECK-NEXT: tail call void [[func_ptr]](ptr {{[^,]*}} %a)
10 // CHECK-NEXT: ret void
11 // CHECK-NEXT: }
13 class A {
14 public:
15 virtual void foo();
18 void A_foo(A *a) {
19 a->foo();