[libcxx-commits] [libcxx] 86ab938 - [libc++] Use .gen.py tests to generate _LIBCPP_VERSION tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 1 08:18:49 PDT 2023


Author: Louis Dionne
Date: 2023-06-01T08:18:43-07:00
New Revision: 86ab93828a56fb1208b4a63e83f3631f183a30fb

URL: https://github.com/llvm/llvm-project/commit/86ab93828a56fb1208b4a63e83f3631f183a30fb
DIFF: https://github.com/llvm/llvm-project/commit/86ab93828a56fb1208b4a63e83f3631f183a30fb.diff

LOG: [libc++] Use .gen.py tests to generate _LIBCPP_VERSION tests

This removes the need for contributors to do some manual steps
when adding a new public header.

Differential Revision: https://reviews.llvm.org/D151831

Added: 
    libcxx/test/libcxx/libcpp_version.gen.py

Modified: 
    libcxx/docs/Contributing.rst
    libcxx/utils/libcxx/test/header_information.py

Removed: 
    libcxx/test/libcxx/algorithms/version.pass.cpp
    libcxx/test/libcxx/atomics/version.pass.cpp
    libcxx/test/libcxx/containers/associative/map/version.pass.cpp
    libcxx/test/libcxx/containers/associative/set/version.pass.cpp
    libcxx/test/libcxx/containers/container.adaptors/queue/version.pass.cpp
    libcxx/test/libcxx/containers/container.adaptors/stack/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/forwardlist/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/version.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/version.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/version.pass.cpp
    libcxx/test/libcxx/depr/depr.str.strstreams/version.pass.cpp
    libcxx/test/libcxx/diagnostics/std.exceptions/version.pass.cpp
    libcxx/test/libcxx/diagnostics/syserr/version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/version.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/input.streams/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/output.streams/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/std.manip/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.forward/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.objects/version.pass.cpp
    libcxx/test/libcxx/input.output/iostreams.base/version.pass.cpp
    libcxx/test/libcxx/input.output/stream.buffers/version.pass.cpp
    libcxx/test/libcxx/input.output/string.streams/version.pass.cpp
    libcxx/test/libcxx/iterators/version.pass.cpp
    libcxx/test/libcxx/language.support/cmp/version.pass.cpp
    libcxx/test/libcxx/language.support/cstdint/version.pass.cpp
    libcxx/test/libcxx/language.support/support.dynamic/version.pass.cpp
    libcxx/test/libcxx/language.support/support.exception/version.pass.cpp
    libcxx/test/libcxx/language.support/support.initlist/version.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/limits/version.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/version.pass.cpp
    libcxx/test/libcxx/language.support/support.rtti/version.pass.cpp
    libcxx/test/libcxx/language.support/support.types/version.pass.cpp
    libcxx/test/libcxx/localization/c.locales/version.pass.cpp
    libcxx/test/libcxx/localization/locale.stdcvt/version.pass.cpp
    libcxx/test/libcxx/localization/version.pass.cpp
    libcxx/test/libcxx/numerics/cfenv/version.pass.cpp
    libcxx/test/libcxx/numerics/complex.number/version.pass.cpp
    libcxx/test/libcxx/numerics/numarray/version.pass.cpp
    libcxx/test/libcxx/numerics/numeric.ops/version.pass.cpp
    libcxx/test/libcxx/numerics/rand/rand.synopsis/version.pass.cpp
    libcxx/test/libcxx/strings/version.pass.cpp
    libcxx/test/libcxx/thread/futures/version.pass.cpp
    libcxx/test/libcxx/thread/thread.condition/version.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/version.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/version.pass.cpp
    libcxx/test/libcxx/time/version.pass.cpp
    libcxx/test/libcxx/utilities/any/version.pass.cpp
    libcxx/test/libcxx/utilities/expected/version.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/version.pass.cpp
    libcxx/test/libcxx/utilities/memory/version.pass.cpp
    libcxx/test/libcxx/utilities/meta/version.pass.cpp
    libcxx/test/libcxx/utilities/optional/version.pass.cpp
    libcxx/test/libcxx/utilities/ratio/version.pass.cpp
    libcxx/test/libcxx/utilities/template.bitset/version.pass.cpp
    libcxx/test/libcxx/utilities/tuple/version.pass.cpp
    libcxx/test/libcxx/utilities/type.index/version.pass.cpp
    libcxx/test/libcxx/utilities/utility/version.pass.cpp
    libcxx/test/libcxx/utilities/variant/version.pass.cpp
    libcxx/test/std/language.support/support.limits/version.pass.cpp


################################################################################
diff  --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
index 6d853e938cf1c..159fa924b3b1f 100644
--- a/libcxx/docs/Contributing.rst
+++ b/libcxx/docs/Contributing.rst
@@ -48,7 +48,6 @@ sure you don't forget anything:
 
   - Did you add it to ``include/module.modulemap.in``?
   - Did you add it to ``include/CMakeLists.txt``?
-  - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated.
   - If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``?
 
 - Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?

diff  --git a/libcxx/test/libcxx/algorithms/version.pass.cpp b/libcxx/test/libcxx/algorithms/version.pass.cpp
deleted file mode 100644
index 57d84b3ffce83..0000000000000
--- a/libcxx/test/libcxx/algorithms/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <algorithm>
-
-#include <algorithm>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/atomics/version.pass.cpp b/libcxx/test/libcxx/atomics/version.pass.cpp
deleted file mode 100644
index bb8af8ded1bc0..0000000000000
--- a/libcxx/test/libcxx/atomics/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <atomic>
-
-#include <atomic>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/associative/map/version.pass.cpp b/libcxx/test/libcxx/containers/associative/map/version.pass.cpp
deleted file mode 100644
index ebc45e4d4867f..0000000000000
--- a/libcxx/test/libcxx/containers/associative/map/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <map>
-
-#include <map>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/associative/set/version.pass.cpp b/libcxx/test/libcxx/containers/associative/set/version.pass.cpp
deleted file mode 100644
index f5a76c7743314..0000000000000
--- a/libcxx/test/libcxx/containers/associative/set/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <set>
-
-#include <set>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/container.adaptors/queue/version.pass.cpp b/libcxx/test/libcxx/containers/container.adaptors/queue/version.pass.cpp
deleted file mode 100644
index 685626291fb71..0000000000000
--- a/libcxx/test/libcxx/containers/container.adaptors/queue/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <queue>
-
-#include <queue>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/container.adaptors/stack/version.pass.cpp b/libcxx/test/libcxx/containers/container.adaptors/stack/version.pass.cpp
deleted file mode 100644
index 9ee45bcc9cc36..0000000000000
--- a/libcxx/test/libcxx/containers/container.adaptors/stack/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <stack>
-
-#include <stack>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/version.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/version.pass.cpp
deleted file mode 100644
index 8cd0a6eaacea5..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/array/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <array>
-
-#include <array>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/deque/version.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/version.pass.cpp
deleted file mode 100644
index c55d5b4eb6b51..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/deque/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <deque>
-
-#include <deque>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/forwardlist/version.pass.cpp b/libcxx/test/libcxx/containers/sequences/forwardlist/version.pass.cpp
deleted file mode 100644
index 94023ecff4e58..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/forwardlist/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <forward_list>
-
-#include <forward_list>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/version.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/version.pass.cpp
deleted file mode 100644
index 8137ca740013b..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/list/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-#include <list>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/version.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/version.pass.cpp
deleted file mode 100644
index ef20070cdb76e..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-#include <vector>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/version.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/version.pass.cpp
deleted file mode 100644
index 09196a89f9843..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-#include <unordered_map>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/version.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/version.pass.cpp
deleted file mode 100644
index 7463275f2c277..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-#include <unordered_set>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/depr/depr.str.strstreams/version.pass.cpp b/libcxx/test/libcxx/depr/depr.str.strstreams/version.pass.cpp
deleted file mode 100644
index f57921f859a54..0000000000000
--- a/libcxx/test/libcxx/depr/depr.str.strstreams/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: no-localization
-
-// <strstream>
-
-#include <strstream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/diagnostics/std.exceptions/version.pass.cpp b/libcxx/test/libcxx/diagnostics/std.exceptions/version.pass.cpp
deleted file mode 100644
index 91d91b406e4dd..0000000000000
--- a/libcxx/test/libcxx/diagnostics/std.exceptions/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <stdexcept>
-
-#include <stdexcept>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/diagnostics/syserr/version.pass.cpp b/libcxx/test/libcxx/diagnostics/syserr/version.pass.cpp
deleted file mode 100644
index 29e6095576c7c..0000000000000
--- a/libcxx/test/libcxx/diagnostics/syserr/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <system_error>
-
-#include <system_error>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp
deleted file mode 100644
index 2ceed434ec45f..0000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-#include <experimental/memory_resource>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/version.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/version.pass.cpp
deleted file mode 100644
index d15a9bdebee9d..0000000000000
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <fstream>
-
-#include <fstream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/filesystems/version.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/version.pass.cpp
deleted file mode 100644
index a9db5b0f02e60..0000000000000
--- a/libcxx/test/libcxx/input.output/filesystems/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <filesystem>
-
-#include <filesystem>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/version.pass.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/version.pass.cpp
deleted file mode 100644
index 74ef7b1385ce9..0000000000000
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <istream>
-
-#include <istream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/version.pass.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/version.pass.cpp
deleted file mode 100644
index 120cbe41bf55d..0000000000000
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <ostream>
-
-#include <ostream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/std.manip/version.pass.cpp b/libcxx/test/libcxx/input.output/iostream.format/std.manip/version.pass.cpp
deleted file mode 100644
index fa1df70f1627a..0000000000000
--- a/libcxx/test/libcxx/input.output/iostream.format/std.manip/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <iomanip>
-
-#include <iomanip>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostream.forward/version.pass.cpp b/libcxx/test/libcxx/input.output/iostream.forward/version.pass.cpp
deleted file mode 100644
index b843a18f7dac0..0000000000000
--- a/libcxx/test/libcxx/input.output/iostream.forward/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <iosfwd>
-
-#include <iosfwd>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostream.objects/version.pass.cpp b/libcxx/test/libcxx/input.output/iostream.objects/version.pass.cpp
deleted file mode 100644
index 628970e5b7c82..0000000000000
--- a/libcxx/test/libcxx/input.output/iostream.objects/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <iostream>
-
-#include <iostream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/iostreams.base/version.pass.cpp b/libcxx/test/libcxx/input.output/iostreams.base/version.pass.cpp
deleted file mode 100644
index f64419cffd38e..0000000000000
--- a/libcxx/test/libcxx/input.output/iostreams.base/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <ios>
-
-#include <ios>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/stream.buffers/version.pass.cpp b/libcxx/test/libcxx/input.output/stream.buffers/version.pass.cpp
deleted file mode 100644
index 94019e8464560..0000000000000
--- a/libcxx/test/libcxx/input.output/stream.buffers/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <streambuf>
-
-#include <streambuf>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/input.output/string.streams/version.pass.cpp b/libcxx/test/libcxx/input.output/string.streams/version.pass.cpp
deleted file mode 100644
index a0044b8dce5f0..0000000000000
--- a/libcxx/test/libcxx/input.output/string.streams/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <sstream>
-
-#include <sstream>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/iterators/version.pass.cpp b/libcxx/test/libcxx/iterators/version.pass.cpp
deleted file mode 100644
index 31c99ca6fb009..0000000000000
--- a/libcxx/test/libcxx/iterators/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <iterator>
-
-#include <iterator>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/cmp/version.pass.cpp b/libcxx/test/libcxx/language.support/cmp/version.pass.cpp
deleted file mode 100644
index 859c567065487..0000000000000
--- a/libcxx/test/libcxx/language.support/cmp/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <compare>
-
-#include <compare>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/cstdint/version.pass.cpp b/libcxx/test/libcxx/language.support/cstdint/version.pass.cpp
deleted file mode 100644
index da1d4a11c0708..0000000000000
--- a/libcxx/test/libcxx/language.support/cstdint/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <cstdint>
-
-#include <cstdint>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/version.pass.cpp b/libcxx/test/libcxx/language.support/support.dynamic/version.pass.cpp
deleted file mode 100644
index 40a7f8c26a0db..0000000000000
--- a/libcxx/test/libcxx/language.support/support.dynamic/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <new>
-
-#include <new>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.exception/version.pass.cpp b/libcxx/test/libcxx/language.support/support.exception/version.pass.cpp
deleted file mode 100644
index e46ab3c65fb45..0000000000000
--- a/libcxx/test/libcxx/language.support/support.exception/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <exception>
-
-#include <exception>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.initlist/version.pass.cpp b/libcxx/test/libcxx/language.support/support.initlist/version.pass.cpp
deleted file mode 100644
index 4691706fe0bb7..0000000000000
--- a/libcxx/test/libcxx/language.support/support.initlist/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <initializer_list>
-
-#include <initializer_list>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.limits/limits/version.pass.cpp b/libcxx/test/libcxx/language.support/support.limits/limits/version.pass.cpp
deleted file mode 100644
index 76076bfe094bf..0000000000000
--- a/libcxx/test/libcxx/language.support/support.limits/limits/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <limits>
-
-#include <limits>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.limits/version.pass.cpp b/libcxx/test/libcxx/language.support/support.limits/version.pass.cpp
deleted file mode 100644
index b4731204c6678..0000000000000
--- a/libcxx/test/libcxx/language.support/support.limits/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <version>
-
-#include <version>
-
-#include "test_macros.h"
-
-#if !defined(_LIBCPP_VERSION)
-#error "_LIBCPP_VERSION must be defined after including <version>"
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.rtti/version.pass.cpp b/libcxx/test/libcxx/language.support/support.rtti/version.pass.cpp
deleted file mode 100644
index 21388012cf1d3..0000000000000
--- a/libcxx/test/libcxx/language.support/support.rtti/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <typeinfo>
-
-#include <typeinfo>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/language.support/support.types/version.pass.cpp b/libcxx/test/libcxx/language.support/support.types/version.pass.cpp
deleted file mode 100644
index c263118beccfe..0000000000000
--- a/libcxx/test/libcxx/language.support/support.types/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <cstddef>
-
-#include <cstddef>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/libcpp_version.gen.py b/libcxx/test/libcxx/libcpp_version.gen.py
new file mode 100644
index 0000000000000..6a43d5dc3e4ae
--- /dev/null
+++ b/libcxx/test/libcxx/libcpp_version.gen.py
@@ -0,0 +1,27 @@
+#===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===----------------------------------------------------------------------===##
+
+# Test that all headers define the _LIBCPP_VERSION macro.
+
+# RUN: %{python} %s %{libcxx}/utils
+
+import sys
+sys.path.append(sys.argv[1])
+from libcxx.test.header_information import lit_header_restrictions, public_headers
+
+for header in public_headers:
+  print(f"""\
+//--- {header}.compile.pass.cpp
+{lit_header_restrictions.get(header, '')}
+
+#include <{header}>
+
+#ifndef _LIBCPP_VERSION
+# error <{header}> does not seem to define _LIBCPP_VERSION
+#endif
+""")

diff  --git a/libcxx/test/libcxx/localization/c.locales/version.pass.cpp b/libcxx/test/libcxx/localization/c.locales/version.pass.cpp
deleted file mode 100644
index e5b6e41700eea..0000000000000
--- a/libcxx/test/libcxx/localization/c.locales/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <clocale>
-
-#include <clocale>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/localization/locale.stdcvt/version.pass.cpp b/libcxx/test/libcxx/localization/locale.stdcvt/version.pass.cpp
deleted file mode 100644
index e97819b37e4d8..0000000000000
--- a/libcxx/test/libcxx/localization/locale.stdcvt/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <codecvt>
-
-#include <codecvt>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/localization/version.pass.cpp b/libcxx/test/libcxx/localization/version.pass.cpp
deleted file mode 100644
index 7750f4c34ad07..0000000000000
--- a/libcxx/test/libcxx/localization/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <locale>
-
-#include <locale>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/numerics/cfenv/version.pass.cpp b/libcxx/test/libcxx/numerics/cfenv/version.pass.cpp
deleted file mode 100644
index 35102beff0738..0000000000000
--- a/libcxx/test/libcxx/numerics/cfenv/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <cfenv>
-
-#include <cfenv>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/numerics/complex.number/version.pass.cpp b/libcxx/test/libcxx/numerics/complex.number/version.pass.cpp
deleted file mode 100644
index d8310a76f40e7..0000000000000
--- a/libcxx/test/libcxx/numerics/complex.number/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <complex>
-
-#include <complex>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/numerics/numarray/version.pass.cpp b/libcxx/test/libcxx/numerics/numarray/version.pass.cpp
deleted file mode 100644
index 34f666e7e2c98..0000000000000
--- a/libcxx/test/libcxx/numerics/numarray/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <valarray>
-
-#include <valarray>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/numerics/numeric.ops/version.pass.cpp b/libcxx/test/libcxx/numerics/numeric.ops/version.pass.cpp
deleted file mode 100644
index ed051fcda8c61..0000000000000
--- a/libcxx/test/libcxx/numerics/numeric.ops/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <numeric>
-
-#include <numeric>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/numerics/rand/rand.synopsis/version.pass.cpp b/libcxx/test/libcxx/numerics/rand/rand.synopsis/version.pass.cpp
deleted file mode 100644
index 60497e704e536..0000000000000
--- a/libcxx/test/libcxx/numerics/rand/rand.synopsis/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <random>
-
-#include <random>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/version.pass.cpp b/libcxx/test/libcxx/strings/version.pass.cpp
deleted file mode 100644
index 9b549a3afec4c..0000000000000
--- a/libcxx/test/libcxx/strings/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-#include <string>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/futures/version.pass.cpp b/libcxx/test/libcxx/thread/futures/version.pass.cpp
deleted file mode 100644
index b32f7579e9a65..0000000000000
--- a/libcxx/test/libcxx/thread/futures/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: no-threads
-
-// <future>
-
-#include <future>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/thread.condition/version.pass.cpp b/libcxx/test/libcxx/thread/thread.condition/version.pass.cpp
deleted file mode 100644
index 114f0b8035f6d..0000000000000
--- a/libcxx/test/libcxx/thread/thread.condition/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: no-threads
-
-// <condition_variable>
-
-#include <condition_variable>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/thread.mutex/version.pass.cpp b/libcxx/test/libcxx/thread/thread.mutex/version.pass.cpp
deleted file mode 100644
index fca02ffef7dd9..0000000000000
--- a/libcxx/test/libcxx/thread/thread.mutex/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: no-threads
-
-// <mutex>
-
-#include <mutex>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/thread.threads/version.pass.cpp b/libcxx/test/libcxx/thread/thread.threads/version.pass.cpp
deleted file mode 100644
index 7c6b2f2c4bab2..0000000000000
--- a/libcxx/test/libcxx/thread/thread.threads/version.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// UNSUPPORTED: no-threads
-
-// <thread>
-
-#include <thread>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/time/version.pass.cpp b/libcxx/test/libcxx/time/version.pass.cpp
deleted file mode 100644
index 5e183169134b3..0000000000000
--- a/libcxx/test/libcxx/time/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-#include <chrono>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/any/version.pass.cpp b/libcxx/test/libcxx/utilities/any/version.pass.cpp
deleted file mode 100644
index 6c5c43e8f9b32..0000000000000
--- a/libcxx/test/libcxx/utilities/any/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <any>
-
-#include <any>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/expected/version.pass.cpp b/libcxx/test/libcxx/utilities/expected/version.pass.cpp
deleted file mode 100644
index d9d45fe1a0eb1..0000000000000
--- a/libcxx/test/libcxx/utilities/expected/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <expected>
-
-#include <expected>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/function.objects/version.pass.cpp b/libcxx/test/libcxx/utilities/function.objects/version.pass.cpp
deleted file mode 100644
index 6418733713df6..0000000000000
--- a/libcxx/test/libcxx/utilities/function.objects/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-#include <functional>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/memory/version.pass.cpp b/libcxx/test/libcxx/utilities/memory/version.pass.cpp
deleted file mode 100644
index cb885560c0291..0000000000000
--- a/libcxx/test/libcxx/utilities/memory/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-#include <memory>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/meta/version.pass.cpp b/libcxx/test/libcxx/utilities/meta/version.pass.cpp
deleted file mode 100644
index 18f7536f56b78..0000000000000
--- a/libcxx/test/libcxx/utilities/meta/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <type_traits>
-
-#include <type_traits>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/version.pass.cpp b/libcxx/test/libcxx/utilities/optional/version.pass.cpp
deleted file mode 100644
index 315e8849aef04..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <optional>
-
-#include <optional>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/ratio/version.pass.cpp b/libcxx/test/libcxx/utilities/ratio/version.pass.cpp
deleted file mode 100644
index 26514b194bfe0..0000000000000
--- a/libcxx/test/libcxx/utilities/ratio/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <ratio>
-
-#include <ratio>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/template.bitset/version.pass.cpp b/libcxx/test/libcxx/utilities/template.bitset/version.pass.cpp
deleted file mode 100644
index e055895a99316..0000000000000
--- a/libcxx/test/libcxx/utilities/template.bitset/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <bitset>
-
-#include <bitset>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/tuple/version.pass.cpp b/libcxx/test/libcxx/utilities/tuple/version.pass.cpp
deleted file mode 100644
index 1a13410eb3050..0000000000000
--- a/libcxx/test/libcxx/utilities/tuple/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <tuple>
-
-#include <tuple>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/type.index/version.pass.cpp b/libcxx/test/libcxx/utilities/type.index/version.pass.cpp
deleted file mode 100644
index aa549fea442c9..0000000000000
--- a/libcxx/test/libcxx/utilities/type.index/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <typeindex>
-
-#include <typeindex>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/utility/version.pass.cpp b/libcxx/test/libcxx/utilities/utility/version.pass.cpp
deleted file mode 100644
index 52d1c43ed0f04..0000000000000
--- a/libcxx/test/libcxx/utilities/utility/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <utility>
-
-#include <utility>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/variant/version.pass.cpp b/libcxx/test/libcxx/utilities/variant/version.pass.cpp
deleted file mode 100644
index 1dcb75d180d8a..0000000000000
--- a/libcxx/test/libcxx/utilities/variant/version.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <variant>
-
-#include <variant>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/test/std/language.support/support.limits/version.pass.cpp b/libcxx/test/std/language.support/support.limits/version.pass.cpp
deleted file mode 100644
index 258a74a751113..0000000000000
--- a/libcxx/test/std/language.support/support.limits/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <version>
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-
-#include <version>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
-
-  return 0;
-}

diff  --git a/libcxx/utils/libcxx/test/header_information.py b/libcxx/utils/libcxx/test/header_information.py
index 1f4bb34248566..4f0dd3341e184 100644
--- a/libcxx/utils/libcxx/test/header_information.py
+++ b/libcxx/utils/libcxx/test/header_information.py
@@ -59,6 +59,56 @@
     "experimental/vector": "__cplusplus >= 201103L",
 }
 
+lit_header_restrictions = {
+    "barrier": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
+    "clocale": "// UNSUPPORTED: no-localization",
+    "codecvt": "// UNSUPPORTED: no-localization",
+    "coroutine": "// UNSUPPORTED: c++03, c++11, c++14, c++17",
+    "cwchar": "// UNSUPPORTED: no-wide-characters",
+    "cwctype": "// UNSUPPORTED: no-wide-characters",
+    "experimental/algorithm": "// UNSUPPORTED: c++03",
+    "experimental/deque": "// UNSUPPORTED: c++03",
+    "experimental/forward_list": "// UNSUPPORTED: c++03",
+    "experimental/functional": "// UNSUPPORTED: c++03",
+    "experimental/iterator": "// UNSUPPORTED: c++03",
+    "experimental/list": "// UNSUPPORTED: c++03",
+    "experimental/map": "// UNSUPPORTED: c++03",
+    "experimental/memory_resource": "// UNSUPPORTED: c++03",
+    "experimental/propagate_const": "// UNSUPPORTED: c++03",
+    "experimental/regex": "// UNSUPPORTED: no-localization, c++03",
+    "experimental/set": "// UNSUPPORTED: c++03",
+    "experimental/simd": "// UNSUPPORTED: c++03",
+    "experimental/span": "// UNSUPPORTED: c++03",
+    "experimental/string": "// UNSUPPORTED: c++03",
+    "experimental/type_traits": "// UNSUPPORTED: c++03",
+    "experimental/unordered_map": "// UNSUPPORTED: c++03",
+    "experimental/unordered_set": "// UNSUPPORTED: c++03",
+    "experimental/utility": "// UNSUPPORTED: c++03",
+    "experimental/vector": "// UNSUPPORTED: c++03",
+    "filesystem": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14",
+    "fstream": "// UNSUPPORTED: no-localization, no-fstream",
+    "future": "// UNSUPPORTED: no-threads, c++03",
+    "iomanip": "// UNSUPPORTED: no-localization",
+    "ios": "// UNSUPPORTED: no-localization",
+    "iostream": "// UNSUPPORTED: no-localization",
+    "istream": "// UNSUPPORTED: no-localization",
+    "latch": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
+    "locale.h": "// UNSUPPORTED: no-localization",
+    "locale": "// UNSUPPORTED: no-localization",
+    "mutex": "// UNSUPPORTED: no-threads, c++03",
+    "ostream": "// UNSUPPORTED: no-localization",
+    "regex": "// UNSUPPORTED: no-localization",
+    "semaphore": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
+    "shared_mutex": "// UNSUPPORTED: no-threads, c++03, c++11",
+    "sstream": "// UNSUPPORTED: no-localization",
+    "stdatomic.h": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17, c++20",
+    "streambuf": "// UNSUPPORTED: no-localization",
+    "strstream": "// UNSUPPORTED: no-localization",
+    "thread": "// UNSUPPORTED: no-threads, c++03",
+    "wchar.h": "// UNSUPPORTED: no-wide-characters",
+    "wctype.h": "// UNSUPPORTED: no-wide-characters",
+}
+
 private_headers_still_public_in_modules = [
     "__assert",
     "__config",


        


More information about the libcxx-commits mailing list