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