Add tests for three-way self- and array comparison.

llvm-svn: 321973
diff --git a/clang/test/SemaCXX/compare-cxx2a.cpp b/clang/test/SemaCXX/compare-cxx2a.cpp
index 61d3502..d88e3ba 100644
--- a/clang/test/SemaCXX/compare-cxx2a.cpp
+++ b/clang/test/SemaCXX/compare-cxx2a.cpp
@@ -3,6 +3,14 @@
 
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -std=c++2a %s
 
+void self_compare() {
+  int a;
+  int b[3], c[3];
+  (void)(a <=> a); // expected-warning {{self-comparison always evaluates to 'std::strong_ordering::equal'}}
+  (void)(b <=> b); // expected-warning {{self-comparison always evaluates to 'std::strong_ordering::equal'}}
+  (void)(b <=> c); // expected-warning {{array comparison always evaluates to a constant}}
+}
+
 void test0(long a, unsigned long b) {
   enum EnumA {A};
   enum EnumB {B};