[libc++] Improves clang-format settings.

Add a new test based .clang-format file which inherits from the generic
one. This moves some test specific formatting rules to the test
directory.

The main benefit is that headers are sorted, which makes it more likely
to catch these errors before creating a review instead of spotting the
error in the CI clang-tidy step.

Reviewed By: ldionne, philnik, #libc

Differential Revision: https://reviews.llvm.org/D144755
diff --git a/libcxx/include/__chrono/ostream.h b/libcxx/include/__chrono/ostream.h
index 74d7e85..23feb9d 100644
--- a/libcxx/include/__chrono/ostream.h
+++ b/libcxx/include/__chrono/ostream.h
@@ -106,15 +106,14 @@
 template <class _CharT, class _Traits>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
-  return __os
-      << (__d.ok()
-              ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
-              // Note this error differs from the wording of the Standard. The
-              // Standard wording doesn't work well on AIX or Windows. There
-              // the formatted day seems to be either modulo 100 or completely
-              // omitted. Judging by the wording this is valid.
-              // TODO FMT Write a paper of file an LWG issue.
-              : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"), static_cast<unsigned>(__d)));
+  return __os << (__d.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
+                           // Note this error differs from the wording of the Standard. The
+                           // Standard wording doesn't work well on AIX or Windows. There
+                           // the formatted day seems to be either modulo 100 or completely
+                           // omitted. Judging by the wording this is valid.
+                           // TODO FMT Write a paper of file an LWG issue.
+                           : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"),
+                                         static_cast<unsigned>(__d)));
 }
 
 template <class _CharT, class _Traits>
@@ -238,7 +237,7 @@
 
 } // namespace chrono
 
-#endif //if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif // if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
 
 _LIBCPP_END_NAMESPACE_STD