[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / virtual-function-calls.cpp
blob61b2fbad7a3aa7dc29a8f921c5b9d5e72ac98beb
1 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - -fstrict-vtable-pointers -O1 | FileCheck --check-prefix=CHECK-INVARIANT %s
4 // PR5021
5 namespace PR5021 {
7 struct A {
8 virtual void f(char);
9 };
11 void f(A *a) {
12 // CHECK: call {{.*}}void %
13 a->f('c');
16 struct B : virtual A {
17 virtual void f();
20 void f(B * b) {
21 b->f();
26 namespace Test1 {
27 struct A {
28 virtual ~A();
31 struct B : A {
32 virtual ~B();
33 virtual void f();
36 void f(B *b) {
37 b->f();
41 namespace VirtualNoreturn {
42 struct A {
43 [[noreturn]] virtual void f();
46 // CHECK-LABEL: @_ZN15VirtualNoreturn1f
47 // CHECK-INVARIANT-LABEL: define {{(dso_local )?}}void @_ZN15VirtualNoreturn1f
48 void f(A *p) {
49 p->f();
50 // CHECK: call {{.*}}void %{{[^#]*$}}
51 // CHECK-NOT: unreachable
52 // CHECK-INVARIANT: load {{.*}} !invariant.load ![[EMPTY_NODE:[0-9]+]]
56 // CHECK-INVARIANT: ![[EMPTY_NODE]] = !{}