[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / virtual-compare.cpp
blobcbb06da3c1492d6b008c5d3e49af147b06354dfd
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: @_ZN1A1hEv
25 virtual void h();
27 // CHECK-SAME: @_ZN1AaSERKS_
28 // implicit virtual A &operator=(const A&) = default;
30 // CHECK-SAME: @_ZN1AD1Ev
31 // CHECK-SAME: @_ZN1AD0Ev
32 // implicit virtual ~A();
34 // CHECK-SAME: @_ZNKR1AeqERKS_
35 // implicit virtual A &operator==(const A&) const & = default;
38 // For Y:
39 // CHECK-SAME: @_ZTI1A
41 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AD1Ev
42 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AD0Ev
43 // virtual ~Y();
45 // CHECK-SAME: @_ZThn{{[0-9]*}}_N1AaSERKS_
46 // virtual A &operator=(const A &);
48 void A::f() {}