| 1 | // RUN: %clang_cc1 -pedantic-errors -std=c++2a -emit-pch %s -o %t |
| 2 | // RUN: %clang_cc1 -pedantic-errors -std=c++2a -include-pch %t -verify %s |
| 3 | // RUN: %clang_cc1 -pedantic-errors -std=c++2a -include-pch %t -emit-llvm %s -o - |
| 4 | |
| 5 | |
| 6 | #ifndef HEADER |
| 7 | #define HEADER |
| 8 | |
| 9 | #include "Inputs/std-compare.h" |
| 10 | constexpr auto foo() { |
| 11 | return (42 <=> 101); |
| 12 | } |
| 13 | |
| 14 | inline auto bar(int x) { |
| 15 | return (1 <=> x); |
| 16 | } |
| 17 | |
| 18 | #else |
| 19 | |
| 20 | // expected-no-diagnostics |
| 21 | |
| 22 | static_assert(foo() < 0); |
| 23 | |
| 24 | auto bar2(int x) { |
| 25 | return bar(x); |
| 26 | } |
| 27 | |
| 28 | #endif |
| 29 | |