[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / RelativeVTablesABI / virtual-function-call.cpp
blobabb11d7915ec6124a1b9f8e9e7281bb65002ee14
1 // Check that we call llvm.load.relative() on a vtable function call.
3 // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O3 -S -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();