[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / virtual-compare.cpp
blobef75513ec0fe95a21fdd57934d8782afa80c3162
1 // RUN: %clang_cc1 -std=c++2a -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
3 #include "Inputs/std-compare.h"
5 // CHECK: @_ZTV1A =
6 struct A;
7 struct X {
8 // CHECK-SAME: @_ZN1X1xEv
9 virtual void x();
10 friend auto operator<=>(X, X) = default;
12 struct Y {
13 virtual ~Y();
14 virtual A &operator=(const A &);
15 friend auto operator<=>(Y, Y) = default;
17 struct A : X, Y {
18 // CHECK-SAME: @_ZN1A1fEv
19 virtual void f();
20 // CHECK-SAME: @_ZNKR1AssERKS_
21 virtual std::strong_ordering operator<=>(const A &) const & = default;
22 // CHECK-SAME: @_ZN1A1gEv
23 virtual void g();
24 // CHECK-SAME: @_ZNKO1AssERKS_
25 virtual std::strong_ordering operator<=>(const A &) const && = default;
26 // CHECK-SAME: @_ZN1A1hEv
27 virtual void h();
29 // CHECK-SAME: @_ZN1AaSERKS_
30 // implicit virtual A &operator=(const A&) = default;
32 // CHECK-SAME: @_ZN1AD1Ev
33 // CHECK-SAME: @_ZN1AD0Ev
34 // implicit virtual ~A();
36 // CHECK-SAME: @_ZNKR1AeqERKS_
37 // implicit virtual A &operator==(const A&) const & = default;
39 // CHECK-SAME: @_ZNKO1AeqERKS_
40 // implicit virtual A &operator==(const A&) const && = default;
43 // For Y:
44 // CHECK-SAME: @_ZTI1A
46 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AD1Ev
47 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AD0Ev
48 // virtual ~Y();
50 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AaSERKS_
51 // virtual A &operator=(const A &);
53 void A::f() {}