2 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
7 // RUN: -fmodule-file=a=%t/a.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm \
9 // RUN: -fsyntax-only -verify
11 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
12 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm \
13 // RUN: -fmodule-file=a=%t/a.pcm
14 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm \
15 // RUN: -fsyntax-only -verify
25 class strong_ordering {
28 static const strong_ordering less, equal, greater;
29 constexpr bool operator==(int n) const noexcept { return this->n == n;}
30 constexpr bool operator!=(int n) const noexcept { return this->n != n;}
32 constexpr strong_ordering strong_ordering::less = {-1};
33 constexpr strong_ordering strong_ordering::equal = {0};
34 constexpr strong_ordering strong_ordering::greater = {1};
36 class partial_ordering {
39 static const partial_ordering less, equal, greater, equivalent, unordered;
40 constexpr bool operator==(long n) const noexcept { return this->n == n;}
41 constexpr bool operator!=(long n) const noexcept { return this->n != n;}
43 constexpr partial_ordering partial_ordering::less = {-1};
44 constexpr partial_ordering partial_ordering::equal = {0};
45 constexpr partial_ordering partial_ordering::greater = {1};
46 constexpr partial_ordering partial_ordering::equivalent = {0};
47 constexpr partial_ordering partial_ordering::unordered = {-127};
52 #include "ordering.mock.h"
60 friend constexpr bool operator==(monostate, monostate) = default;
63 export struct wrapper {
64 friend constexpr bool operator==(wrapper const &LHS, wrapper const &RHS) {
65 return LHS.m_value == RHS.m_value;
72 auto operator<=>(monostate2 const &) const & = default;
75 export struct wrapper2 {
76 friend bool operator==(wrapper2 const &LHS, wrapper2 const &RHS) = default;
84 // expected-no-diagnostics
87 static_assert(n::wrapper() == n::wrapper());
88 static_assert(n::wrapper2() == n::wrapper2());