[llvm-branch-commits] [clang] [compiler-rt] [flang] [libc] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [mlir] [libc++][CI] Pin the XCode version. (PR #135412)

Mark de Wever via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Apr 12 06:08:14 PDT 2025


Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Morris Hafner
 <mmha at users.noreply.github.com>,Alexey Bataev <a.bataev at outlook.com>,Jonas
 Devlieghere <jonas at devlieghere.com>,Jan Korous <jkorous at apple.com>,LLVM GN
 Syncbot <llvmgnsyncbot at gmail.com>,Andy Kaylor <akaylor at nvidia.com>,Alexey
 Bataev <a.bataev at outlook.com>,Kevin Gleason <gleasonk at google.com>,Mark de
 Wever <koraq at xs4all.nl>,Alexey Bataev <a.bataev at outlook.com>,Daniel
 Thornburgh <dthorn at google.com>,Mark de Wever <koraq at xs4all.nl>,Farzon Lotfi
 <farzonlotfi at microsoft.com>,erichkeane <ekeane at nvidia.com>,Roland McGrath
 <mcgrathr at google.com>,Alexey Bataev <a.bataev at outlook.com>,Felipe de Azevedo
 Piovezan <fpiovezan at apple.com>,Jonas Devlieghere <jonas at devlieghere.com>,
Andrzej =?utf-8?q?WarzyƄski?= <andrzej.warzynski at arm.com>,David Green
 <david.green at arm.com>,Ikhlas Ajbar <iajbar at quicinc.com>,Shilei Tian
 <i at tianshilei.me>,Peter Klausler <pklausler at nvidia.com>,Florian Hahn
 <flo at fhahn.com>,Tai Ly <tai.ly at arm.com>,Victor Vianna
 <victor.vianna10 at gmail.com>,Brad Smith <brad at comstyle.com>,Jan Korous
 <jkorous at apple.com>,vdonaldson <37090318+vdonaldson at users.noreply.github.com>
 =?utf-8?q?,?=Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Matheus Izvekov
 <mizvekov at gmail.com>,Maksim Levental <maksim.levental at gmail.com>,Amr Hesham
 <amr96 at programmer.net>,Alexandre Ganea <alex_toresh at yahoo.fr>,Alexandre
 Ganea <alex_toresh at yahoo.fr>,Alexandre Ganea <alex_toresh at yahoo.fr>,Alexandre
 Ganea <alex_toresh at yahoo.fr>,Alexandre Ganea <alex_toresh at yahoo.fr>,Alexandre
 Ganea <alex_toresh at yahoo.fr>,Jeffrey Byrnes <jeffrey.byrnes at amd.com>,Shafik
 Yaghmour <shafik.yaghmour at intel.com>,Nico Weber <thakis at chromium.org>,Craig
 Topper <craig.topper at sifive.com>,Matheus Izvekov <mizvekov at gmail.com>,Pranav
 Kant <prka at google.com>,Pranav Kant <prka at google.com>,Maksim Levental
 <maksim.levental at gmail.com>,Sagar Kulkarni <sagar.kulkarni1911 at gmail.com>,Philip
 Reames <preames at rivosinc.com>,Jan Svoboda <jan_svoboda at apple.com>,Amir
 Ayupov <aaupov at fb.com>,Craig Topper <craig.topper at sifive.com>,Brad Smith
 <brad at comstyle.com>,donald chen <chenxunyu1993 at gmail.com>,Fangrui Song
 <i at maskray.me>,Aiden Grossman <aidengrossman at google.com>,Yingwei Zheng
 <dtcxzyw2333 at gmail.com>,Yingwei Zheng <dtcxzyw2333 at gmail.com>,Andreas Jonson
 <andjo403 at hotmail.com>,Jacek Caban <jacek at codeweavers.com>,Mark de Wever
 <koraq at xs4all.nl>,Mark de Wever <koraq at xs4all.nl>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/135412 at github.com>


https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/135412

>From 3ad2cd5e70d0fb1d7831a735a4ec8c8b18578d75 Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston at google.com>
Date: Fri, 11 Apr 2025 15:09:41 +0000
Subject: [PATCH 01/76] [asan] Fix-forward #133175 by restricting newly-added
 tests to Linux

This was failing on Mac
(https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/4107/ and
https://issues.chromium.org/issues/409995888). Since this is an
experimental feature, rather than play whack-a-mole with selectively
disabling failing platforms (previously done for Android), this patch
restricts it to Linux.
---
 .../TestCases/use-after-poison-history-size-partial-granule.cpp  | 1 +
 .../test/asan/TestCases/use-after-poison-history-size.cpp        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/compiler-rt/test/asan/TestCases/use-after-poison-history-size-partial-granule.cpp b/compiler-rt/test/asan/TestCases/use-after-poison-history-size-partial-granule.cpp
index ad22571ce5cf4..e5fecbb9573fe 100644
--- a/compiler-rt/test/asan/TestCases/use-after-poison-history-size-partial-granule.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-poison-history-size-partial-granule.cpp
@@ -6,6 +6,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=poison_history_size=1000 not %run %t    2>&1 | FileCheck %s
 
 // TODO
+// REQUIRES: linux
 // UNSUPPORTED: android
 
 #include <stdio.h>
diff --git a/compiler-rt/test/asan/TestCases/use-after-poison-history-size.cpp b/compiler-rt/test/asan/TestCases/use-after-poison-history-size.cpp
index 6e3dfa4b31968..d97e6fa06e0a3 100644
--- a/compiler-rt/test/asan/TestCases/use-after-poison-history-size.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-poison-history-size.cpp
@@ -17,6 +17,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t && env ASAN_OPTIONS=poison_history_size=1    not %run %t       2>&1 | FileCheck %s --check-prefixes=CHECK-ACDE,CHECK-BDE,CHECK-E
 
 // TODO
+// REQUIRES: linux
 // UNSUPPORTED: android
 
 #include <stdio.h>

>From 76b85d3a27d9de4667cdf6de158111830724f34d Mon Sep 17 00:00:00 2001
From: Bangtian Liu <liubangtian at gmail.com>
Date: Fri, 11 Apr 2025 11:16:58 -0400
Subject: [PATCH 02/76] [MLIR][CAPI] add C API typedef to fix downstream C API
 usage (#135380)

This PR is after #135253 and #134935 to fix the error reported by
https://github.com/llvm/llvm-project/pull/135253#issuecomment-2796077024.
This PR Adds typedef declarations for `MlirLinalgContractionDimensions`
and `MlirLinalgConvolutionDimensions` in the C API to ensure
compatibility with pure C code.

I confirm that this fix resolves the reported error based on my testing.

Signed-off-by: Bangtian Liu <liubangtian at gmail.com>
---
 mlir/include/mlir-c/Dialect/Linalg.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mlir/include/mlir-c/Dialect/Linalg.h b/mlir/include/mlir-c/Dialect/Linalg.h
index 838c280903e2e..4f2ee0d434222 100644
--- a/mlir/include/mlir-c/Dialect/Linalg.h
+++ b/mlir/include/mlir-c/Dialect/Linalg.h
@@ -24,19 +24,19 @@ mlirLinalgFillBuiltinNamedOpRegion(MlirOperation mlirOp);
 
 MLIR_CAPI_EXPORTED bool mlirLinalgIsAContractionOp(MlirOperation op);
 
-struct MlirLinalgContractionDimensions {
+typedef struct MlirLinalgContractionDimensions {
   MlirAttribute batch;
   MlirAttribute m;
   MlirAttribute n;
   MlirAttribute k;
-};
+} MlirLinalgContractionDimensions;
 
 MLIR_CAPI_EXPORTED MlirLinalgContractionDimensions
 mlirLinalgInferContractionDimensions(MlirOperation op);
 
 MLIR_CAPI_EXPORTED bool mlirLinalgIsAConvolutionOp(MlirOperation op);
 
-struct MlirLinalgConvolutionDimensions {
+typedef struct MlirLinalgConvolutionDimensions {
   MlirAttribute batch;
   MlirAttribute outputImage;
   MlirAttribute outputChannel;
@@ -45,7 +45,7 @@ struct MlirLinalgConvolutionDimensions {
   MlirAttribute depth;
   MlirAttribute strides;
   MlirAttribute dilations;
-};
+} MlirLinalgConvolutionDimensions;
 
 MLIR_CAPI_EXPORTED MlirLinalgConvolutionDimensions
 mlirLinalgInferConvolutionDimensions(MlirOperation op);

>From 5a41fc28f3b3f32a70fd5d81c2e33d10b3225806 Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Fri, 11 Apr 2025 08:20:12 -0700
Subject: [PATCH 03/76] [clang][modules] Name the module map files on PCM file
 conflict (#134475)

With implicitly-built modules, seeing something like:
```
fatal error: module 'X' is defined in both '<cache>/HASH1/X-HASH2.pcm' and '<cache>/HASH1/X-HASH3.pcm'
```
is super confusing and not actionable, because the module cache tends to
be hidden from the developer.

This PR adds a note to that diagnostic that names the module map files
the PCM files were compiled from, hopefully giving a good enough hint
for further investigation:
```
note: compiled from '<build>/X.framework/Modules/module.modulemap' and '<SDK>/X.framework/Modules/module.modulemap'
```

(I had to replace the mechanism used to convert `DiagnosticError` into
something `DiagnosticsEngine` can understand, because it seemingly did
not support notes.)
---
 .../Basic/DiagnosticSerializationKinds.td     |  3 +-
 clang/lib/Serialization/ASTReader.cpp         | 66 ++++++++++---------
 .../modules-relocated-mm-macro.c              |  9 +--
 3 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/clang/include/clang/Basic/DiagnosticSerializationKinds.td
index 3914d3930bec7..5fc5937b80d35 100644
--- a/clang/include/clang/Basic/DiagnosticSerializationKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSerializationKinds.td
@@ -75,8 +75,7 @@ def err_module_file_not_module : Error<
 def err_module_file_missing_top_level_submodule : Error<
   "module file '%0' is missing its top-level submodule">, DefaultFatal;
 def note_module_file_conflict : Note<
-  "this is generally caused by modules with the same name found in multiple "
-  "paths">;
+  "compiled from '%0' and '%1'">;
 
 def remark_module_import : Remark<
   "importing module '%0'%select{| into '%3'}2 from '%1'">,
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 38c49844848f5..02c31dff620ec 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -44,7 +44,6 @@
 #include "clang/Basic/ASTSourceDescriptor.h"
 #include "clang/Basic/CommentOptions.h"
 #include "clang/Basic/Diagnostic.h"
-#include "clang/Basic/DiagnosticError.h"
 #include "clang/Basic/DiagnosticIDs.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/DiagnosticSema.h"
@@ -1552,30 +1551,27 @@ void ASTReader::Error(unsigned DiagID, StringRef Arg1, StringRef Arg2,
   Diag(DiagID) << Arg1 << Arg2 << Arg3;
 }
 
+namespace {
+struct AlreadyReportedDiagnosticError
+    : llvm::ErrorInfo<AlreadyReportedDiagnosticError> {
+  static char ID;
+
+  void log(raw_ostream &OS) const override {
+    llvm_unreachable("reporting an already-reported diagnostic error");
+  }
+
+  std::error_code convertToErrorCode() const override {
+    return llvm::inconvertibleErrorCode();
+  }
+};
+
+char AlreadyReportedDiagnosticError::ID = 0;
+} // namespace
+
 void ASTReader::Error(llvm::Error &&Err) const {
-  llvm::Error RemainingErr =
-      handleErrors(std::move(Err), [this](const DiagnosticError &E) {
-        auto Diag = E.getDiagnostic().second;
-
-        // Ideally we'd just emit it, but have to handle a possible in-flight
-        // diagnostic. Note that the location is currently ignored as well.
-        auto NumArgs = Diag.getStorage()->NumDiagArgs;
-        assert(NumArgs <= 3 && "Can only have up to 3 arguments");
-        StringRef Arg1, Arg2, Arg3;
-        switch (NumArgs) {
-        case 3:
-          Arg3 = Diag.getStringArg(2);
-          [[fallthrough]];
-        case 2:
-          Arg2 = Diag.getStringArg(1);
-          [[fallthrough]];
-        case 1:
-          Arg1 = Diag.getStringArg(0);
-        }
-        Error(Diag.getDiagID(), Arg1, Arg2, Arg3);
-      });
-  if (RemainingErr)
-    Error(toString(std::move(RemainingErr)));
+  handleAllErrors(
+      std::move(Err), [](AlreadyReportedDiagnosticError &) {},
+      [&](llvm::ErrorInfoBase &E) { return Error(E.message()); });
 }
 
 //===----------------------------------------------------------------------===//
@@ -3349,8 +3345,6 @@ ASTReader::ReadControlBlock(ModuleFile &F,
       if (isDiagnosedResult(Result, Capabilities) || recompilingFinalized)
         Diag(diag::note_module_file_imported_by)
             << F.FileName << !F.ModuleName.empty() << F.ModuleName;
-      if (recompilingFinalized)
-        Diag(diag::note_module_file_conflict);
 
       switch (Result) {
       case Failure: return Failure;
@@ -4440,6 +4434,7 @@ ASTReader::ReadModuleMapFileBlock(RecordData &Record, ModuleFile &F,
           // This module was defined by an imported (explicit) module.
           Diag(diag::err_module_file_conflict) << F.ModuleName << F.FileName
                                                << ASTFE->getName();
+          // TODO: Add a note with the module map paths if they differ.
         } else {
           // This module was built with a different module map.
           Diag(diag::err_imported_module_not_found)
@@ -6105,14 +6100,21 @@ llvm::Error ASTReader::ReadSubmoduleBlock(ModuleFile &F,
         if (OptionalFileEntryRef CurFile = CurrentModule->getASTFile()) {
           // Don't emit module relocation error if we have -fno-validate-pch
           if (!bool(PP.getPreprocessorOpts().DisablePCHOrModuleValidation &
-                    DisableValidationForModuleKind::Module) &&
-              CurFile != F.File) {
-            auto ConflictError =
-                PartialDiagnostic(diag::err_module_file_conflict,
-                                  ContextObj->DiagAllocator)
+                    DisableValidationForModuleKind::Module)) {
+            assert(CurFile != F.File && "ModuleManager did not de-duplicate");
+
+            Diag(diag::err_module_file_conflict)
                 << CurrentModule->getTopLevelModuleName() << CurFile->getName()
                 << F.File.getName();
-            return DiagnosticError::create(CurrentImportLoc, ConflictError);
+
+            auto CurModMapFile =
+                ModMap.getContainingModuleMapFile(CurrentModule);
+            auto ModMapFile = FileMgr.getOptionalFileRef(F.ModuleMapPath);
+            if (CurModMapFile && ModMapFile && CurModMapFile != ModMapFile)
+              Diag(diag::note_module_file_conflict)
+                  << CurModMapFile->getName() << ModMapFile->getName();
+
+            return llvm::make_error<AlreadyReportedDiagnosticError>();
           }
         }
 
diff --git a/clang/test/ClangScanDeps/modules-relocated-mm-macro.c b/clang/test/ClangScanDeps/modules-relocated-mm-macro.c
index 17f479d9e0046..87fbad0c72131 100644
--- a/clang/test/ClangScanDeps/modules-relocated-mm-macro.c
+++ b/clang/test/ClangScanDeps/modules-relocated-mm-macro.c
@@ -13,13 +13,14 @@
 
 // RUN: cp -r %t/frameworks2/A.framework %t/frameworks1
 
-// RUN: not clang-scan-deps -format experimental-full -o %t/deps2.json -- \
+// RUN: not clang-scan-deps -format experimental-full -o %t/deps2.json 2>%t/errs -- \
 // RUN:   %clang -fmodules -fmodules-cache-path=%t/cache \
 // RUN:   -F %t/frameworks1 -F %t/frameworks2 \
-// RUN:   -c %t/tu2.m -o %t/tu2.o \
-// RUN:     2>&1 | FileCheck %s
+// RUN:   -c %t/tu2.m -o %t/tu2.o
+// RUN: FileCheck --input-file=%t/errs %s
 
-// CHECK: fatal error: module 'A' is defined in both '{{.*}}.pcm' and '{{.*}}.pcm'
+// CHECK:      fatal error: module 'A' is defined in both '{{.*}}.pcm' and '{{.*}}.pcm'
+// CHECK-NEXT: note: compiled from '{{.*}}frameworks1{{.*}}' and '{{.*}}frameworks2{{.*}}'
 
 //--- frameworks2/A.framework/Modules/module.modulemap
 framework module A { header "A.h" }

>From 976c37ec950a93ed60068389ad05454f76da1e55 Mon Sep 17 00:00:00 2001
From: amansharma612 <amansharma6122002 at gmail.com>
Date: Fri, 11 Apr 2025 21:05:01 +0530
Subject: [PATCH 04/76] [AMDGPU] Set hasSideEffects=0 for SALU psuedos
 (#134487)

Fixes #128685

---------

Co-authored-by: Aman Sharma <210100011 at iitb.ac.in>
---
 llvm/lib/Target/AMDGPU/SIInstructions.td  | 30 ++++++++++++-----------
 llvm/lib/Target/AMDGPU/SOPInstructions.td | 16 ++++++------
 llvm/test/CodeGen/AMDGPU/mul.ll           | 10 ++++----
 3 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index 9e3011b05de65..ed45cf8851146 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -231,7 +231,7 @@ def EXIT_STRICT_WQM : SPseudoInstSI <(outs SReg_1:$sdst), (ins SReg_1:$src0)> {
   let mayStore = 0;
 }
 
-let usesCustomInserter = 1 in {
+let usesCustomInserter = 1, hasSideEffects = 0 in {
 let WaveSizePredicate = isWave32 in
 def S_INVERSE_BALLOT_U32 : SPseudoInstSI<
   (outs SReg_32:$sdst), (ins SSrc_b32:$mask),
@@ -243,7 +243,7 @@ def S_INVERSE_BALLOT_U64 : SPseudoInstSI<
   (outs SReg_64:$sdst), (ins SSrc_b64:$mask),
   [(set i1:$sdst, (int_amdgcn_inverse_ballot i64:$mask))]
 >;
-} // End usesCustomInserter = 1
+} // End usesCustomInserter = 1, hasSideEffects = 0
 
 let WaveSizePredicate = isWave32 in
   def : GCNPat <
@@ -338,21 +338,23 @@ def S_SUB_U64_PSEUDO : SPseudoInstSI <
   [(set SReg_64:$sdst, (UniformBinFrag<sub> i64:$src0, i64:$src1))]
 >;
 
-def S_ADD_CO_PSEUDO : SPseudoInstSI <
-  (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1, SSrc_i1:$scc_in)
->;
+let hasSideEffects = 0 in {
+  def S_ADD_CO_PSEUDO : SPseudoInstSI <
+    (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1, SSrc_i1:$scc_in)
+  >;
 
-def S_SUB_CO_PSEUDO : SPseudoInstSI <
-  (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1, SSrc_i1:$scc_in)
->;
+  def S_SUB_CO_PSEUDO : SPseudoInstSI <
+    (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1, SSrc_i1:$scc_in)
+  >;
 
-def S_UADDO_PSEUDO : SPseudoInstSI <
-  (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1)
->;
+  def S_UADDO_PSEUDO : SPseudoInstSI <
+    (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1)
+  >;
 
-def S_USUBO_PSEUDO : SPseudoInstSI <
-  (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1)
->;
+  def S_USUBO_PSEUDO : SPseudoInstSI <
+    (outs SReg_32:$sdst, SSrc_i1:$scc_out), (ins SSrc_b32:$src0, SSrc_b32:$src1)
+  >;
+}
 
 let OtherPredicates = [HasShaderCyclesHiLoRegisters] in
 def GET_SHADERCYCLESHILO : SPseudoInstSI<
diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index 73f4655f735a2..3d3f1ba3f5170 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -663,14 +663,16 @@ let SubtargetPredicate = isGFX12Plus in {
   }
 
   // The higher 32-bits of the inputs contain the sign extension bits.
-  def S_MUL_I64_I32_PSEUDO : SPseudoInstSI <
-    (outs SReg_64:$sdst), (ins SSrc_b64:$src0, SSrc_b64:$src1)
-  >;
+  let hasSideEffects = 0 in {
+    def S_MUL_I64_I32_PSEUDO : SPseudoInstSI <
+      (outs SReg_64:$sdst), (ins SSrc_b64:$src0, SSrc_b64:$src1)
+    >;
 
-  // The higher 32-bits of the inputs are zero.
-  def S_MUL_U64_U32_PSEUDO : SPseudoInstSI <
-    (outs SReg_64:$sdst), (ins SSrc_b64:$src0, SSrc_b64:$src1)
-  >;
+    // The higher 32-bits of the inputs are zero.
+    def S_MUL_U64_U32_PSEUDO : SPseudoInstSI <
+      (outs SReg_64:$sdst), (ins SSrc_b64:$src0, SSrc_b64:$src1)
+    >;
+  }
 
 } // End SubtargetPredicate = isGFX12Plus
 
diff --git a/llvm/test/CodeGen/AMDGPU/mul.ll b/llvm/test/CodeGen/AMDGPU/mul.ll
index 7dd45181a8356..896f48a9215b9 100644
--- a/llvm/test/CodeGen/AMDGPU/mul.ll
+++ b/llvm/test/CodeGen/AMDGPU/mul.ll
@@ -2850,17 +2850,17 @@ define amdgpu_kernel void @s_mul_i128(ptr addrspace(1) %out, [8 x i32], i128 %a,
 ; GFX12-NEXT:    s_mov_b32 s5, s3
 ; GFX12-NEXT:    s_mov_b32 s17, s3
 ; GFX12-NEXT:    s_mov_b32 s19, s3
-; GFX12-NEXT:    s_mov_b32 s24, s3
+; GFX12-NEXT:    s_mov_b32 s20, s3
 ; GFX12-NEXT:    s_wait_kmcnt 0x0
 ; GFX12-NEXT:    s_mov_b32 s2, s8
 ; GFX12-NEXT:    s_mov_b32 s6, s12
 ; GFX12-NEXT:    s_mov_b32 s4, s13
 ; GFX12-NEXT:    s_mul_u64 s[22:23], s[6:7], s[2:3]
-; GFX12-NEXT:    s_mul_u64 s[20:21], s[4:5], s[2:3]
+; GFX12-NEXT:    s_mul_u64 s[24:25], s[4:5], s[2:3]
 ; GFX12-NEXT:    s_mov_b32 s2, s23
 ; GFX12-NEXT:    s_mov_b32 s16, s9
 ; GFX12-NEXT:    s_mul_u64 s[10:11], s[10:11], s[12:13]
-; GFX12-NEXT:    s_add_nc_u64 s[12:13], s[20:21], s[2:3]
+; GFX12-NEXT:    s_add_nc_u64 s[12:13], s[24:25], s[2:3]
 ; GFX12-NEXT:    s_mul_u64 s[6:7], s[6:7], s[16:17]
 ; GFX12-NEXT:    s_mov_b32 s2, s13
 ; GFX12-NEXT:    s_mov_b32 s13, s3
@@ -2871,9 +2871,9 @@ define amdgpu_kernel void @s_mul_i128(ptr addrspace(1) %out, [8 x i32], i128 %a,
 ; GFX12-NEXT:    s_mov_b32 s23, s3
 ; GFX12-NEXT:    s_add_nc_u64 s[2:3], s[2:3], s[18:19]
 ; GFX12-NEXT:    s_add_nc_u64 s[8:9], s[10:11], s[8:9]
-; GFX12-NEXT:    s_mov_b32 s25, s6
+; GFX12-NEXT:    s_mov_b32 s21, s6
 ; GFX12-NEXT:    s_add_nc_u64 s[2:3], s[4:5], s[2:3]
-; GFX12-NEXT:    s_or_b64 s[6:7], s[22:23], s[24:25]
+; GFX12-NEXT:    s_or_b64 s[6:7], s[22:23], s[20:21]
 ; GFX12-NEXT:    s_add_nc_u64 s[2:3], s[2:3], s[8:9]
 ; GFX12-NEXT:    v_dual_mov_b32 v0, s6 :: v_dual_mov_b32 v1, s7
 ; GFX12-NEXT:    v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3

>From a4b7688d27da1a0189fff6549853fdfe22b33c48 Mon Sep 17 00:00:00 2001
From: David Green <david.green at arm.com>
Date: Fri, 11 Apr 2025 16:37:42 +0100
Subject: [PATCH 05/76] [AArch64] Regenerate fsh.ll test. NFC

---
 llvm/test/CodeGen/AArch64/fsh.ll | 128 ++++++++++---------------------
 1 file changed, 40 insertions(+), 88 deletions(-)

diff --git a/llvm/test/CodeGen/AArch64/fsh.ll b/llvm/test/CodeGen/AArch64/fsh.ll
index c084813760b80..2cee2f2b2686c 100644
--- a/llvm/test/CodeGen/AArch64/fsh.ll
+++ b/llvm/test/CodeGen/AArch64/fsh.ll
@@ -3905,102 +3905,66 @@ entry:
 }
 
 define <8 x i8> @fshl_v8i8_c(<8 x i8> %a, <8 x i8> %b) {
-; CHECK-SD-LABEL: fshl_v8i8_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.8b, v0.8b, #3
-; CHECK-SD-NEXT:    usra v0.8b, v1.8b, #5
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshl_v8i8_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.8b, v0.8b, #3
-; CHECK-GI-NEXT:    usra v0.8b, v1.8b, #5
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshl_v8i8_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.8b, v0.8b, #3
+; CHECK-NEXT:    usra v0.8b, v1.8b, #5
+; CHECK-NEXT:    ret
 entry:
   %d = call <8 x i8> @llvm.fshl(<8 x i8> %a, <8 x i8> %b, <8 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
   ret <8 x i8> %d
 }
 
 define <8 x i8> @fshr_v8i8_c(<8 x i8> %a, <8 x i8> %b) {
-; CHECK-SD-LABEL: fshr_v8i8_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.8b, v0.8b, #5
-; CHECK-SD-NEXT:    usra v0.8b, v1.8b, #3
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshr_v8i8_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.8b, v0.8b, #5
-; CHECK-GI-NEXT:    usra v0.8b, v1.8b, #3
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshr_v8i8_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.8b, v0.8b, #5
+; CHECK-NEXT:    usra v0.8b, v1.8b, #3
+; CHECK-NEXT:    ret
 entry:
   %d = call <8 x i8> @llvm.fshr(<8 x i8> %a, <8 x i8> %b, <8 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
   ret <8 x i8> %d
 }
 
 define <16 x i8> @fshl_v16i8_c(<16 x i8> %a, <16 x i8> %b) {
-; CHECK-SD-LABEL: fshl_v16i8_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.16b, v0.16b, #3
-; CHECK-SD-NEXT:    usra v0.16b, v1.16b, #5
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshl_v16i8_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.16b, v0.16b, #3
-; CHECK-GI-NEXT:    usra v0.16b, v1.16b, #5
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshl_v16i8_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.16b, v0.16b, #3
+; CHECK-NEXT:    usra v0.16b, v1.16b, #5
+; CHECK-NEXT:    ret
 entry:
   %d = call <16 x i8> @llvm.fshl(<16 x i8> %a, <16 x i8> %b, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
   ret <16 x i8> %d
 }
 
 define <16 x i8> @fshr_v16i8_c(<16 x i8> %a, <16 x i8> %b) {
-; CHECK-SD-LABEL: fshr_v16i8_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.16b, v0.16b, #5
-; CHECK-SD-NEXT:    usra v0.16b, v1.16b, #3
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshr_v16i8_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.16b, v0.16b, #5
-; CHECK-GI-NEXT:    usra v0.16b, v1.16b, #3
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshr_v16i8_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.16b, v0.16b, #5
+; CHECK-NEXT:    usra v0.16b, v1.16b, #3
+; CHECK-NEXT:    ret
 entry:
   %d = call <16 x i8> @llvm.fshr(<16 x i8> %a, <16 x i8> %b, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
   ret <16 x i8> %d
 }
 
 define <4 x i16> @fshl_v4i16_c(<4 x i16> %a, <4 x i16> %b) {
-; CHECK-SD-LABEL: fshl_v4i16_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.4h, v0.4h, #3
-; CHECK-SD-NEXT:    usra v0.4h, v1.4h, #13
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshl_v4i16_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.4h, v0.4h, #3
-; CHECK-GI-NEXT:    usra v0.4h, v1.4h, #13
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshl_v4i16_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.4h, v0.4h, #3
+; CHECK-NEXT:    usra v0.4h, v1.4h, #13
+; CHECK-NEXT:    ret
 entry:
   %d = call <4 x i16> @llvm.fshl(<4 x i16> %a, <4 x i16> %b, <4 x i16> <i16 3, i16 3, i16 3, i16 3>)
   ret <4 x i16> %d
 }
 
 define <4 x i16> @fshr_v4i16_c(<4 x i16> %a, <4 x i16> %b) {
-; CHECK-SD-LABEL: fshr_v4i16_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.4h, v0.4h, #13
-; CHECK-SD-NEXT:    usra v0.4h, v1.4h, #3
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshr_v4i16_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.4h, v0.4h, #13
-; CHECK-GI-NEXT:    usra v0.4h, v1.4h, #3
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshr_v4i16_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.4h, v0.4h, #13
+; CHECK-NEXT:    usra v0.4h, v1.4h, #3
+; CHECK-NEXT:    ret
 entry:
   %d = call <4 x i16> @llvm.fshr(<4 x i16> %a, <4 x i16> %b, <4 x i16> <i16 3, i16 3, i16 3, i16 3>)
   ret <4 x i16> %d
@@ -4087,34 +4051,22 @@ entry:
 }
 
 define <8 x i16> @fshl_v8i16_c(<8 x i16> %a, <8 x i16> %b) {
-; CHECK-SD-LABEL: fshl_v8i16_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.8h, v0.8h, #3
-; CHECK-SD-NEXT:    usra v0.8h, v1.8h, #13
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshl_v8i16_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.8h, v0.8h, #3
-; CHECK-GI-NEXT:    usra v0.8h, v1.8h, #13
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshl_v8i16_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.8h, v0.8h, #3
+; CHECK-NEXT:    usra v0.8h, v1.8h, #13
+; CHECK-NEXT:    ret
 entry:
   %d = call <8 x i16> @llvm.fshl(<8 x i16> %a, <8 x i16> %b, <8 x i16> <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>)
   ret <8 x i16> %d
 }
 
 define <8 x i16> @fshr_v8i16_c(<8 x i16> %a, <8 x i16> %b) {
-; CHECK-SD-LABEL: fshr_v8i16_c:
-; CHECK-SD:       // %bb.0: // %entry
-; CHECK-SD-NEXT:    shl v0.8h, v0.8h, #13
-; CHECK-SD-NEXT:    usra v0.8h, v1.8h, #3
-; CHECK-SD-NEXT:    ret
-;
-; CHECK-GI-LABEL: fshr_v8i16_c:
-; CHECK-GI:       // %bb.0: // %entry
-; CHECK-GI-NEXT:    shl v0.8h, v0.8h, #13
-; CHECK-GI-NEXT:    usra v0.8h, v1.8h, #3
-; CHECK-GI-NEXT:    ret
+; CHECK-LABEL: fshr_v8i16_c:
+; CHECK:       // %bb.0: // %entry
+; CHECK-NEXT:    shl v0.8h, v0.8h, #13
+; CHECK-NEXT:    usra v0.8h, v1.8h, #3
+; CHECK-NEXT:    ret
 entry:
   %d = call <8 x i16> @llvm.fshr(<8 x i16> %a, <8 x i16> %b, <8 x i16> <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>)
   ret <8 x i16> %d

>From ffac1404f8e0f606cac12a21777dfe700b455e87 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Fri, 11 Apr 2025 08:38:37 -0700
Subject: [PATCH 06/76] [Clang] [Sema] Document invariant in
 Sema::AddOverloadCandidate (#135256)

Static analysis flagged 1 - ArgIdx in Sema::AddOverloadCandidate for its
potential to overflow.

Turns out this is intentional since when PO ==
OverloadCandidateParamOrder::Reversed Args.size() is always two, so this
will never overflow.

We document using an assert.

Fixes: https://github.com/llvm/llvm-project/issues/135086
---
 clang/lib/Sema/SemaOverload.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index f46ef2c7f5bd6..9c2df0b21d278 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -7189,6 +7189,7 @@ void Sema::AddOverloadCandidate(
     }
   }
 
+  assert(PO != OverloadCandidateParamOrder::Reversed || Args.size() == 2);
   // Determine the implicit conversion sequences for each of the
   // arguments.
   for (unsigned ArgIdx = 0; ArgIdx < Args.size(); ++ArgIdx) {

>From 438f984b4b3c6774f07eced877dce7cdbeef6a3b Mon Sep 17 00:00:00 2001
From: Farzon Lotfi <farzonlotfi at microsoft.com>
Date: Fri, 11 Apr 2025 11:42:21 -0400
Subject: [PATCH 07/76] [DirectX] XFAIL test failing because of debuginfo
 changes (#135279)

For more context see
https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578

This change:
https://github.com/llvm/llvm-project/commit/6a45fce90937f1c8671e609c4218818ce4491329
broke this test:
https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/dxil-dis/debug-info.ll
in our pipeline:
https://github.com/llvm/llvm-project/actions/workflows/hlsl-matrix.yaml

LLVM is transitioning off of the llvm.dbg.value debug intrinsic in favor
of the `#dbg_declare(..) format. see
https://github.com/llvm/llvm-project/pull/133917/files

dxil-dis does not understand the new format and so work needs to be
planned out to support this transition in
https://github.com/microsoft/DirectXShaderCompiler

For now the fix is to XFAIL this test to unblock the pipeline.
---
 llvm/test/tools/dxil-dis/debug-info.ll | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/test/tools/dxil-dis/debug-info.ll b/llvm/test/tools/dxil-dis/debug-info.ll
index c042b60ce2396..b35258f3797f9 100644
--- a/llvm/test/tools/dxil-dis/debug-info.ll
+++ b/llvm/test/tools/dxil-dis/debug-info.ll
@@ -1,4 +1,7 @@
 ; RUN: llc --filetype=obj %s -o  - -experimental-debuginfo-iterators=false | dxil-dis -o - | FileCheck %s
+; Note: LLVM has soft disabled experimental-debuginfo-iterators in commit 6a45fce
+; XFAIL: *
+
 target triple = "dxil-unknown-shadermodel6.7-library"
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
 

>From 70627af91f577f5195a11ee44c6af39503e1ce52 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Fri, 11 Apr 2025 08:53:49 -0700
Subject: [PATCH 08/76] [lldb] Synchronize access to m_statusline in the
 Debugger (#134759)

Eliminate the potential for a race between the main thread, the default
event handler thread and the signal handling thread, when accessing the
m_statusline member.
---
 lldb/include/lldb/Core/Debugger.h |  2 ++
 lldb/source/Core/Debugger.cpp     | 46 +++++++++++++++++++++++--------
 2 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 448e8d6a8fc6a..f36202edbbde0 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -752,6 +752,8 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
   IOHandlerStack m_io_handler_stack;
   std::recursive_mutex m_io_handler_synchronous_mutex;
 
+  /// Mutex protecting the m_statusline member.
+  std::mutex m_statusline_mutex;
   std::optional<Statusline> m_statusline;
 
   llvm::StringMap<std::weak_ptr<LogHandler>> m_stream_handlers;
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index e65d71ddf6960..ce6fb6ed5ec54 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -251,6 +251,7 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
                g_debugger_properties[ePropertyShowStatusline].name) {
       // Statusline setting changed. If we have a statusline instance, update it
       // now. Otherwise it will get created in the default event handler.
+      std::lock_guard<std::mutex> guard(m_statusline_mutex);
       if (StatuslineSupported())
         m_statusline.emplace(*this);
       else
@@ -391,8 +392,12 @@ bool Debugger::SetTerminalWidth(uint64_t term_width) {
 
   if (auto handler_sp = m_io_handler_stack.Top())
     handler_sp->TerminalSizeChanged();
-  if (m_statusline)
-    m_statusline->TerminalSizeChanged();
+
+  {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (m_statusline)
+      m_statusline->TerminalSizeChanged();
+  }
 
   return success;
 }
@@ -409,8 +414,12 @@ bool Debugger::SetTerminalHeight(uint64_t term_height) {
 
   if (auto handler_sp = m_io_handler_stack.Top())
     handler_sp->TerminalSizeChanged();
-  if (m_statusline)
-    m_statusline->TerminalSizeChanged();
+
+  {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (m_statusline)
+      m_statusline->TerminalSizeChanged();
+  }
 
   return success;
 }
@@ -1148,8 +1157,11 @@ void Debugger::SetErrorFile(FileSP file_sp) {
 }
 
 void Debugger::SaveInputTerminalState() {
-  if (m_statusline)
-    m_statusline->Disable();
+  {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (m_statusline)
+      m_statusline->Disable();
+  }
   int fd = GetInputFile().GetDescriptor();
   if (fd != File::kInvalidDescriptor)
     m_terminal_state.Save(fd, true);
@@ -1157,11 +1169,15 @@ void Debugger::SaveInputTerminalState() {
 
 void Debugger::RestoreInputTerminalState() {
   m_terminal_state.Restore();
-  if (m_statusline)
-    m_statusline->Enable();
+  {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (m_statusline)
+      m_statusline->Enable();
+  }
 }
 
 void Debugger::RedrawStatusline(bool update) {
+  std::lock_guard<std::mutex> guard(m_statusline_mutex);
   if (m_statusline)
     m_statusline->Redraw(update);
 }
@@ -2039,8 +2055,11 @@ lldb::thread_result_t Debugger::DefaultEventHandler() {
   // are now listening to all required events so no events get missed
   m_sync_broadcaster.BroadcastEvent(eBroadcastBitEventThreadIsListening);
 
-  if (!m_statusline && StatuslineSupported())
-    m_statusline.emplace(*this);
+  if (StatuslineSupported()) {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (!m_statusline)
+      m_statusline.emplace(*this);
+  }
 
   bool done = false;
   while (!done) {
@@ -2101,8 +2120,11 @@ lldb::thread_result_t Debugger::DefaultEventHandler() {
     }
   }
 
-  if (m_statusline)
-    m_statusline.reset();
+  {
+    std::lock_guard<std::mutex> guard(m_statusline_mutex);
+    if (m_statusline)
+      m_statusline.reset();
+  }
 
   return {};
 }

>From 8d2f0911ce8dddb37d064b3065b3be71e3233c2c Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Fri, 11 Apr 2025 09:39:22 -0700
Subject: [PATCH 09/76] [clang] Extract `CompilerInstance` creation out of
 `compileModuleImpl()` (#134887)

This PR extracts the creation of `CompilerInstance` for compiling an
implicitly-discovered module out of `compileModuleImpl()` into its own
separate function and passes it into `compileModuleImpl()` from the
outside. This makes the instance creation logic reusable (useful for my
experiments) and also simplifies the API, removing the `PreBuildStep`
and `PostBuildStep` hooks from `compileModuleImpl()`.
---
 clang/lib/Frontend/CompilerInstance.cpp | 193 +++++++++++++-----------
 1 file changed, 104 insertions(+), 89 deletions(-)

diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 9cab17ae70eeb..55265af90f917 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1150,29 +1150,16 @@ static Language getLanguageFromOptions(const LangOptions &LangOpts) {
   return LangOpts.CPlusPlus ? Language::CXX : Language::C;
 }
 
-/// Compile a module file for the given module, using the options
-/// provided by the importing compiler instance. Returns true if the module
-/// was built without errors.
-static bool
-compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
-                  StringRef ModuleName, FrontendInputFile Input,
-                  StringRef OriginalModuleMapFile, StringRef ModuleFileName,
-                  llvm::function_ref<void(CompilerInstance &)> PreBuildStep =
-                      [](CompilerInstance &) {},
-                  llvm::function_ref<void(CompilerInstance &)> PostBuildStep =
-                      [](CompilerInstance &) {}) {
-  llvm::TimeTraceScope TimeScope("Module Compile", ModuleName);
-
-  // Never compile a module that's already finalized - this would cause the
-  // existing module to be freed, causing crashes if it is later referenced
-  if (ImportingInstance.getModuleCache().getInMemoryModuleCache().isPCMFinal(
-          ModuleFileName)) {
-    ImportingInstance.getDiagnostics().Report(
-        ImportLoc, diag::err_module_rebuild_finalized)
-        << ModuleName;
-    return false;
-  }
-
+/// Creates a \c CompilerInstance for compiling a module.
+///
+/// This expects a properly initialized \c FrontendInputFile.
+static std::unique_ptr<CompilerInstance>
+createCompilerInstanceForModuleCompileImpl(CompilerInstance &ImportingInstance,
+                                           SourceLocation ImportLoc,
+                                           StringRef ModuleName,
+                                           FrontendInputFile Input,
+                                           StringRef OriginalModuleMapFile,
+                                           StringRef ModuleFileName) {
   // Construct a compiler invocation for creating this module.
   auto Invocation =
       std::make_shared<CompilerInvocation>(ImportingInstance.getInvocation());
@@ -1226,8 +1213,11 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
   // module.  Since we're sharing an in-memory module cache,
   // CompilerInstance::CompilerInstance is responsible for finalizing the
   // buffers to prevent use-after-frees.
-  CompilerInstance Instance(ImportingInstance.getPCHContainerOperations(),
-                            &ImportingInstance.getModuleCache());
+  auto InstancePtr = std::make_unique<CompilerInstance>(
+      ImportingInstance.getPCHContainerOperations(),
+      &ImportingInstance.getModuleCache());
+  auto &Instance = *InstancePtr;
+
   auto &Inv = *Invocation;
   Instance.setInvocation(std::move(Invocation));
 
@@ -1267,12 +1257,32 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
   Instance.setModuleDepCollector(ImportingInstance.getModuleDepCollector());
   Inv.getDependencyOutputOpts() = DependencyOutputOptions();
 
+  return InstancePtr;
+}
+
+/// Compile a module file for the given module, using the options
+/// provided by the importing compiler instance. Returns true if the module
+/// was built without errors.
+static bool compileModule(CompilerInstance &ImportingInstance,
+                          SourceLocation ImportLoc, StringRef ModuleName,
+                          StringRef ModuleFileName,
+                          CompilerInstance &Instance) {
+  llvm::TimeTraceScope TimeScope("Module Compile", ModuleName);
+
+  // Never compile a module that's already finalized - this would cause the
+  // existing module to be freed, causing crashes if it is later referenced
+  if (ImportingInstance.getModuleCache().getInMemoryModuleCache().isPCMFinal(
+          ModuleFileName)) {
+    ImportingInstance.getDiagnostics().Report(
+        ImportLoc, diag::err_module_rebuild_finalized)
+        << ModuleName;
+    return false;
+  }
+
   ImportingInstance.getDiagnostics().Report(ImportLoc,
                                             diag::remark_module_build)
     << ModuleName << ModuleFileName;
 
-  PreBuildStep(Instance);
-
   // Execute the action to actually build the module in-place. Use a separate
   // thread so that we get a stack large enough.
   bool Crashed = !llvm::CrashRecoveryContext().RunSafelyOnThread(
@@ -1282,14 +1292,12 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
       },
       DesiredStackSize);
 
-  PostBuildStep(Instance);
-
   ImportingInstance.getDiagnostics().Report(ImportLoc,
                                             diag::remark_module_build_done)
     << ModuleName;
 
   // Propagate the statistics to the parent FileManager.
-  if (!FrontendOpts.ModulesShareFileManager)
+  if (!ImportingInstance.getFrontendOpts().ModulesShareFileManager)
     ImportingInstance.getFileManager().AddStats(Instance.getFileManager());
 
   if (Crashed) {
@@ -1302,6 +1310,12 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc,
     Instance.clearOutputFiles(/*EraseFiles=*/true);
   }
 
+  // We've rebuilt a module. If we're allowed to generate or update the global
+  // module index, record that fact in the importing compiler instance.
+  if (ImportingInstance.getFrontendOpts().GenerateGlobalModuleIndex) {
+    ImportingInstance.setBuildGlobalModuleIndex(true);
+  }
+
   // If \p AllowPCMWithCompilerErrors is set return 'success' even if errors
   // occurred.
   return !Instance.getDiagnostics().hasErrorOccurred() ||
@@ -1321,20 +1335,24 @@ static OptionalFileEntryRef getPublicModuleMap(FileEntryRef File,
   return FileMgr.getOptionalFileRef(PublicFilename);
 }
 
-/// Compile a module file for the given module in a separate compiler instance,
-/// using the options provided by the importing compiler instance. Returns true
-/// if the module was built without errors.
-static bool compileModule(CompilerInstance &ImportingInstance,
-                          SourceLocation ImportLoc, Module *Module,
-                          StringRef ModuleFileName) {
+/// Creates a \c CompilerInstance for compiling a module.
+///
+/// This takes care of creating appropriate \c FrontendInputFile for
+/// public/private frameworks, inferred modules and such.
+static std::unique_ptr<CompilerInstance>
+createCompilerInstanceForModuleCompile(CompilerInstance &ImportingInstance,
+                                       SourceLocation ImportLoc, Module *Module,
+                                       StringRef ModuleFileName) {
+  StringRef ModuleName = Module->getTopLevelModuleName();
+
   InputKind IK(getLanguageFromOptions(ImportingInstance.getLangOpts()),
                InputKind::ModuleMap);
 
   // Get or create the module map that we'll use to build this module.
-  ModuleMap &ModMap
-    = ImportingInstance.getPreprocessor().getHeaderSearchInfo().getModuleMap();
+  ModuleMap &ModMap =
+      ImportingInstance.getPreprocessor().getHeaderSearchInfo().getModuleMap();
   SourceManager &SourceMgr = ImportingInstance.getSourceManager();
-  bool Result;
+
   if (FileID ModuleMapFID = ModMap.getContainingModuleMapFileID(Module);
       ModuleMapFID.isValid()) {
     // We want to use the top-level module map. If we don't, the compiling
@@ -1368,44 +1386,36 @@ static bool compileModule(CompilerInstance &ImportingInstance,
     bool IsSystem = isSystem(SLoc.getFile().getFileCharacteristic());
 
     // Use the module map where this module resides.
-    Result = compileModuleImpl(
-        ImportingInstance, ImportLoc, Module->getTopLevelModuleName(),
+    return createCompilerInstanceForModuleCompileImpl(
+        ImportingInstance, ImportLoc, ModuleName,
         FrontendInputFile(ModuleMapFilePath, IK, IsSystem),
         ModMap.getModuleMapFileForUniquing(Module)->getName(), ModuleFileName);
-  } else {
-    // FIXME: We only need to fake up an input file here as a way of
-    // transporting the module's directory to the module map parser. We should
-    // be able to do that more directly, and parse from a memory buffer without
-    // inventing this file.
-    SmallString<128> FakeModuleMapFile(Module->Directory->getName());
-    llvm::sys::path::append(FakeModuleMapFile, "__inferred_module.map");
-
-    std::string InferredModuleMapContent;
-    llvm::raw_string_ostream OS(InferredModuleMapContent);
-    Module->print(OS);
-
-    Result = compileModuleImpl(
-        ImportingInstance, ImportLoc, Module->getTopLevelModuleName(),
-        FrontendInputFile(FakeModuleMapFile, IK, +Module->IsSystem),
-        ModMap.getModuleMapFileForUniquing(Module)->getName(),
-        ModuleFileName,
-        [&](CompilerInstance &Instance) {
-      std::unique_ptr<llvm::MemoryBuffer> ModuleMapBuffer =
-          llvm::MemoryBuffer::getMemBuffer(InferredModuleMapContent);
-      FileEntryRef ModuleMapFile = Instance.getFileManager().getVirtualFileRef(
-          FakeModuleMapFile, InferredModuleMapContent.size(), 0);
-      Instance.getSourceManager().overrideFileContents(
-          ModuleMapFile, std::move(ModuleMapBuffer));
-    });
   }
 
-  // We've rebuilt a module. If we're allowed to generate or update the global
-  // module index, record that fact in the importing compiler instance.
-  if (ImportingInstance.getFrontendOpts().GenerateGlobalModuleIndex) {
-    ImportingInstance.setBuildGlobalModuleIndex(true);
-  }
+  // FIXME: We only need to fake up an input file here as a way of
+  // transporting the module's directory to the module map parser. We should
+  // be able to do that more directly, and parse from a memory buffer without
+  // inventing this file.
+  SmallString<128> FakeModuleMapFile(Module->Directory->getName());
+  llvm::sys::path::append(FakeModuleMapFile, "__inferred_module.map");
+
+  std::string InferredModuleMapContent;
+  llvm::raw_string_ostream OS(InferredModuleMapContent);
+  Module->print(OS);
+
+  auto Instance = createCompilerInstanceForModuleCompileImpl(
+      ImportingInstance, ImportLoc, ModuleName,
+      FrontendInputFile(FakeModuleMapFile, IK, +Module->IsSystem),
+      ModMap.getModuleMapFileForUniquing(Module)->getName(), ModuleFileName);
+
+  std::unique_ptr<llvm::MemoryBuffer> ModuleMapBuffer =
+      llvm::MemoryBuffer::getMemBufferCopy(InferredModuleMapContent);
+  FileEntryRef ModuleMapFile = Instance->getFileManager().getVirtualFileRef(
+      FakeModuleMapFile, InferredModuleMapContent.size(), 0);
+  Instance->getSourceManager().overrideFileContents(ModuleMapFile,
+                                                    std::move(ModuleMapBuffer));
 
-  return Result;
+  return Instance;
 }
 
 /// Read the AST right after compiling the module.
@@ -1455,8 +1465,12 @@ static bool compileModuleAndReadASTImpl(CompilerInstance &ImportingInstance,
                                         SourceLocation ModuleNameLoc,
                                         Module *Module,
                                         StringRef ModuleFileName) {
-  if (!compileModule(ImportingInstance, ModuleNameLoc, Module,
-                     ModuleFileName)) {
+  auto Instance = createCompilerInstanceForModuleCompile(
+      ImportingInstance, ModuleNameLoc, Module, ModuleFileName);
+
+  if (!compileModule(ImportingInstance, ModuleNameLoc,
+                     Module->getTopLevelModuleName(), ModuleFileName,
+                     *Instance)) {
     ImportingInstance.getDiagnostics().Report(ModuleNameLoc,
                                               diag::err_module_not_built)
         << Module->Name << SourceRange(ImportLoc, ModuleNameLoc);
@@ -2232,25 +2246,26 @@ void CompilerInstance::createModuleFromSource(SourceLocation ImportLoc,
 
   std::string NullTerminatedSource(Source.str());
 
-  auto PreBuildStep = [&](CompilerInstance &Other) {
-    // Create a virtual file containing our desired source.
-    // FIXME: We shouldn't need to do this.
-    FileEntryRef ModuleMapFile = Other.getFileManager().getVirtualFileRef(
-        ModuleMapFileName, NullTerminatedSource.size(), 0);
-    Other.getSourceManager().overrideFileContents(
-        ModuleMapFile, llvm::MemoryBuffer::getMemBuffer(NullTerminatedSource));
+  auto Other = createCompilerInstanceForModuleCompileImpl(
+      *this, ImportLoc, ModuleName, Input, StringRef(), ModuleFileName);
 
-    Other.BuiltModules = std::move(BuiltModules);
-    Other.DeleteBuiltModules = false;
-  };
+  // Create a virtual file containing our desired source.
+  // FIXME: We shouldn't need to do this.
+  FileEntryRef ModuleMapFile = Other->getFileManager().getVirtualFileRef(
+      ModuleMapFileName, NullTerminatedSource.size(), 0);
+  Other->getSourceManager().overrideFileContents(
+      ModuleMapFile, llvm::MemoryBuffer::getMemBuffer(NullTerminatedSource));
 
-  auto PostBuildStep = [this](CompilerInstance &Other) {
-    BuiltModules = std::move(Other.BuiltModules);
-  };
+  Other->BuiltModules = std::move(BuiltModules);
+  Other->DeleteBuiltModules = false;
 
   // Build the module, inheriting any modules that we've built locally.
-  if (compileModuleImpl(*this, ImportLoc, ModuleName, Input, StringRef(),
-                        ModuleFileName, PreBuildStep, PostBuildStep)) {
+  bool Success =
+      compileModule(*this, ImportLoc, ModuleName, ModuleFileName, *Other);
+
+  BuiltModules = std::move(Other->BuiltModules);
+
+  if (Success) {
     BuiltModules[std::string(ModuleName)] = std::string(ModuleFileName);
     llvm::sys::RemoveFileOnSignal(ModuleFileName);
   }

>From 61f80db9a493e3f33dc01ecd5294856d33ca74d4 Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek at codeweavers.com>
Date: Fri, 11 Apr 2025 18:50:16 +0200
Subject: [PATCH 10/76] [LLD][COFF] Remove no longer needed symtabEC from
 COFFLinkerContext (NFC) (#135094)

With #135093, we may just use `symtab` instead.
---
 lld/COFF/COFFLinkerContext.h |  4 ---
 lld/COFF/DLL.cpp             |  4 +--
 lld/COFF/Driver.cpp          | 22 +++++++----------
 lld/COFF/InputFiles.cpp      |  4 +--
 lld/COFF/Writer.cpp          | 47 +++++++++++++++++-------------------
 5 files changed, 35 insertions(+), 46 deletions(-)

diff --git a/lld/COFF/COFFLinkerContext.h b/lld/COFF/COFFLinkerContext.h
index 613184d05d818..2c5f6415e5d4b 100644
--- a/lld/COFF/COFFLinkerContext.h
+++ b/lld/COFF/COFFLinkerContext.h
@@ -35,10 +35,6 @@ class COFFLinkerContext : public CommonLinkerContext {
   // A native ARM64 symbol table on ARM64X target.
   std::optional<SymbolTable> hybridSymtab;
 
-  // Pointer to the ARM64EC symbol table: either symtab for an ARM64EC target or
-  // hybridSymtab for an ARM64X target.
-  SymbolTable *symtabEC = nullptr;
-
   // Returns the appropriate symbol table for the specified machine type.
   SymbolTable &getSymtab(llvm::COFF::MachineTypes machine) {
     if (hybridSymtab && machine == ARM64)
diff --git a/lld/COFF/DLL.cpp b/lld/COFF/DLL.cpp
index 198b6e1cddd1e..0440507b71756 100644
--- a/lld/COFF/DLL.cpp
+++ b/lld/COFF/DLL.cpp
@@ -848,7 +848,7 @@ void IdataContents::create(COFFLinkerContext &ctx) {
                                         : make<NullChunk>(ctx));
     addresses.push_back(addressesTerminator ? addressesTerminator
                                             : make<NullChunk>(ctx));
-    if (ctx.symtabEC) {
+    if (ctx.symtab.isEC()) {
       auxIat.push_back(make<NullChunk>(ctx));
       auxIatCopy.push_back(make<NullChunk>(ctx));
     }
@@ -998,7 +998,7 @@ void DelayLoadContents::create() {
       // Terminate with null values.
       addresses.push_back(make<NullChunk>(ctx, 8));
       names.push_back(make<NullChunk>(ctx, 8));
-      if (ctx.symtabEC) {
+      if (ctx.symtab.isEC()) {
         auxIat.push_back(make<NullChunk>(ctx, 8));
         auxIatCopy.push_back(make<NullChunk>(ctx, 8));
       }
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index d9e70a5be3261..e3ff647209e72 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -659,12 +659,9 @@ void LinkerDriver::setMachine(MachineTypes machine) {
 
   if (machine != ARM64X) {
     ctx.symtab.machine = machine;
-    if (machine == ARM64EC)
-      ctx.symtabEC = &ctx.symtab;
   } else {
     ctx.symtab.machine = ARM64EC;
     ctx.hybridSymtab.emplace(ctx, ARM64);
-    ctx.symtabEC = &ctx.symtab;
   }
 
   addWinSysRootLibSearchPaths();
@@ -1320,7 +1317,7 @@ void LinkerDriver::maybeCreateECExportThunk(StringRef name, Symbol *&sym) {
     expName = saver().save("EXP+" + *mangledName);
   else
     expName = saver().save("EXP+" + name);
-  sym = ctx.symtabEC->addGCRoot(expName);
+  sym = ctx.symtab.addGCRoot(expName);
   if (auto undef = dyn_cast<Undefined>(sym)) {
     if (!undef->getWeakAlias()) {
       auto thunk = make<ECExportThunkChunk>(def);
@@ -1332,13 +1329,13 @@ void LinkerDriver::maybeCreateECExportThunk(StringRef name, Symbol *&sym) {
 void LinkerDriver::createECExportThunks() {
   // Check if EXP+ symbols have corresponding $hp_target symbols and use them
   // to create export thunks when available.
-  for (Symbol *s : ctx.symtabEC->expSymbols) {
+  for (Symbol *s : ctx.symtab.expSymbols) {
     if (!s->isUsedInRegularObj)
       continue;
     assert(s->getName().starts_with("EXP+"));
     std::string targetName =
         (s->getName().substr(strlen("EXP+")) + "$hp_target").str();
-    Symbol *sym = ctx.symtabEC->find(targetName);
+    Symbol *sym = ctx.symtab.find(targetName);
     if (!sym)
       continue;
     Defined *targetSym;
@@ -1360,10 +1357,9 @@ void LinkerDriver::createECExportThunks() {
     }
   }
 
-  if (ctx.symtabEC->entry)
-    maybeCreateECExportThunk(ctx.symtabEC->entry->getName(),
-                             ctx.symtabEC->entry);
-  for (Export &e : ctx.symtabEC->exports) {
+  if (ctx.symtab.entry)
+    maybeCreateECExportThunk(ctx.symtab.entry->getName(), ctx.symtab.entry);
+  for (Export &e : ctx.symtab.exports) {
     if (!e.data)
       maybeCreateECExportThunk(e.extName.empty() ? e.name : e.extName, e.sym);
   }
@@ -1372,7 +1368,7 @@ void LinkerDriver::createECExportThunks() {
 void LinkerDriver::pullArm64ECIcallHelper() {
   if (!ctx.config.arm64ECIcallHelper)
     ctx.config.arm64ECIcallHelper =
-        ctx.symtabEC->addGCRoot("__icall_helper_arm64ec");
+        ctx.symtab.addGCRoot("__icall_helper_arm64ec");
 }
 
 // In MinGW, if no symbols are chosen to be exported, then all symbols are
@@ -2753,8 +2749,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
   if (auto *arg = args.getLastArg(OPT_print_symbol_order))
     config->printSymbolOrder = arg->getValue();
 
-  if (ctx.symtabEC)
-    ctx.symtabEC->initializeECThunks();
+  if (ctx.symtab.isEC())
+    ctx.symtab.initializeECThunks();
   ctx.forEachSymtab([](SymbolTable &symtab) { symtab.initializeLoadConfig(); });
 
   // Identify unreferenced COMDAT sections.
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 7916e3fd4ea1f..7fb42bb681939 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -129,12 +129,12 @@ void ArchiveFile::parse() {
   file = CHECK(Archive::create(mb), this);
 
   // Try to read symbols from ECSYMBOLS section on ARM64EC.
-  if (ctx.symtabEC) {
+  if (ctx.symtab.isEC()) {
     iterator_range<Archive::symbol_iterator> symbols =
         CHECK(file->ec_symbols(), this);
     if (!symbols.empty()) {
       for (const Archive::Symbol &sym : symbols)
-        ctx.symtabEC->addLazyArchive(this, sym);
+        ctx.symtab.addLazyArchive(this, sym);
 
       // Read both EC and native symbols on ARM64X.
       if (!ctx.hybridSymtab)
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 31c686761d74f..a5582cc8074d1 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -581,7 +581,7 @@ bool Writer::createThunks(OutputSection *os, int margin) {
 
 // Create a code map for CHPE metadata.
 void Writer::createECCodeMap() {
-  if (!ctx.symtabEC)
+  if (!ctx.symtab.isEC())
     return;
 
   // Clear the map in case we were're recomputing the map after adding
@@ -617,8 +617,7 @@ void Writer::createECCodeMap() {
 
   closeRange();
 
-  Symbol *tableCountSym =
-      ctx.symtabEC->findUnderscore("__hybrid_code_map_count");
+  Symbol *tableCountSym = ctx.symtab.findUnderscore("__hybrid_code_map_count");
   cast<DefinedAbsolute>(tableCountSym)->setVA(codeMap.size());
 }
 
@@ -2234,11 +2233,10 @@ void Writer::maybeAddRVATable(SymbolRVASet tableSymbols, StringRef tableSym,
 
 // Create CHPE metadata chunks.
 void Writer::createECChunks() {
-  SymbolTable *symtab = ctx.symtabEC;
-  if (!symtab)
+  if (!ctx.symtab.isEC())
     return;
 
-  for (Symbol *s : symtab->expSymbols) {
+  for (Symbol *s : ctx.symtab.expSymbols) {
     auto sym = dyn_cast<Defined>(s);
     if (!sym || !sym->getChunk())
       continue;
@@ -2257,9 +2255,9 @@ void Writer::createECChunks() {
       // we should use the #foo$hp_target symbol as the redirection target.
       // First, try to look up the $hp_target symbol. If it can't be found,
       // assume it's a regular function and look for #foo instead.
-      Symbol *targetSym = symtab->find((targetName + "$hp_target").str());
+      Symbol *targetSym = ctx.symtab.find((targetName + "$hp_target").str());
       if (!targetSym)
-        targetSym = symtab->find(targetName);
+        targetSym = ctx.symtab.find(targetName);
       Defined *t = dyn_cast_or_null<Defined>(targetSym);
       if (t && isArm64EC(t->getChunk()->getMachine()))
         exportThunks.push_back({chunk, t});
@@ -2268,20 +2266,20 @@ void Writer::createECChunks() {
 
   auto codeMapChunk = make<ECCodeMapChunk>(codeMap);
   rdataSec->addChunk(codeMapChunk);
-  Symbol *codeMapSym = symtab->findUnderscore("__hybrid_code_map");
+  Symbol *codeMapSym = ctx.symtab.findUnderscore("__hybrid_code_map");
   replaceSymbol<DefinedSynthetic>(codeMapSym, codeMapSym->getName(),
                                   codeMapChunk);
 
   CHPECodeRangesChunk *ranges = make<CHPECodeRangesChunk>(exportThunks);
   rdataSec->addChunk(ranges);
   Symbol *rangesSym =
-      symtab->findUnderscore("__x64_code_ranges_to_entry_points");
+      ctx.symtab.findUnderscore("__x64_code_ranges_to_entry_points");
   replaceSymbol<DefinedSynthetic>(rangesSym, rangesSym->getName(), ranges);
 
   CHPERedirectionChunk *entryPoints = make<CHPERedirectionChunk>(exportThunks);
   a64xrmSec->addChunk(entryPoints);
   Symbol *entryPointsSym =
-      symtab->findUnderscore("__arm64x_redirection_metadata");
+      ctx.symtab.findUnderscore("__arm64x_redirection_metadata");
   replaceSymbol<DefinedSynthetic>(entryPointsSym, entryPointsSym->getName(),
                                   entryPoints);
 }
@@ -2385,8 +2383,7 @@ void Writer::setSectionPermissions() {
 
 // Set symbols used by ARM64EC metadata.
 void Writer::setECSymbols() {
-  SymbolTable *symtab = ctx.symtabEC;
-  if (!symtab)
+  if (!ctx.symtab.isEC())
     return;
 
   llvm::stable_sort(exportThunks, [](const std::pair<Chunk *, Defined *> &a,
@@ -2395,45 +2392,45 @@ void Writer::setECSymbols() {
   });
 
   ChunkRange &chpePdata = ctx.hybridSymtab ? hybridPdata : pdata;
-  Symbol *rfeTableSym = symtab->findUnderscore("__arm64x_extra_rfe_table");
+  Symbol *rfeTableSym = ctx.symtab.findUnderscore("__arm64x_extra_rfe_table");
   replaceSymbol<DefinedSynthetic>(rfeTableSym, "__arm64x_extra_rfe_table",
                                   chpePdata.first);
 
   if (chpePdata.first) {
     Symbol *rfeSizeSym =
-        symtab->findUnderscore("__arm64x_extra_rfe_table_size");
+        ctx.symtab.findUnderscore("__arm64x_extra_rfe_table_size");
     cast<DefinedAbsolute>(rfeSizeSym)
         ->setVA(chpePdata.last->getRVA() + chpePdata.last->getSize() -
                 chpePdata.first->getRVA());
   }
 
   Symbol *rangesCountSym =
-      symtab->findUnderscore("__x64_code_ranges_to_entry_points_count");
+      ctx.symtab.findUnderscore("__x64_code_ranges_to_entry_points_count");
   cast<DefinedAbsolute>(rangesCountSym)->setVA(exportThunks.size());
 
   Symbol *entryPointCountSym =
-      symtab->findUnderscore("__arm64x_redirection_metadata_count");
+      ctx.symtab.findUnderscore("__arm64x_redirection_metadata_count");
   cast<DefinedAbsolute>(entryPointCountSym)->setVA(exportThunks.size());
 
-  Symbol *iatSym = symtab->findUnderscore("__hybrid_auxiliary_iat");
+  Symbol *iatSym = ctx.symtab.findUnderscore("__hybrid_auxiliary_iat");
   replaceSymbol<DefinedSynthetic>(iatSym, "__hybrid_auxiliary_iat",
                                   idata.auxIat.empty() ? nullptr
                                                        : idata.auxIat.front());
 
-  Symbol *iatCopySym = symtab->findUnderscore("__hybrid_auxiliary_iat_copy");
+  Symbol *iatCopySym = ctx.symtab.findUnderscore("__hybrid_auxiliary_iat_copy");
   replaceSymbol<DefinedSynthetic>(
       iatCopySym, "__hybrid_auxiliary_iat_copy",
       idata.auxIatCopy.empty() ? nullptr : idata.auxIatCopy.front());
 
   Symbol *delayIatSym =
-      symtab->findUnderscore("__hybrid_auxiliary_delayload_iat");
+      ctx.symtab.findUnderscore("__hybrid_auxiliary_delayload_iat");
   replaceSymbol<DefinedSynthetic>(
       delayIatSym, "__hybrid_auxiliary_delayload_iat",
       delayIdata.getAuxIat().empty() ? nullptr
                                      : delayIdata.getAuxIat().front());
 
   Symbol *delayIatCopySym =
-      symtab->findUnderscore("__hybrid_auxiliary_delayload_iat_copy");
+      ctx.symtab.findUnderscore("__hybrid_auxiliary_delayload_iat_copy");
   replaceSymbol<DefinedSynthetic>(
       delayIatCopySym, "__hybrid_auxiliary_delayload_iat_copy",
       delayIdata.getAuxIatCopy().empty() ? nullptr
@@ -2448,16 +2445,16 @@ void Writer::setECSymbols() {
       if (auto thunkChunk =
               dyn_cast<ECExportThunkChunk>(altEntrySym->getChunk()))
         altEntrySym = thunkChunk->target;
-      symtab->findUnderscore("__arm64x_native_entrypoint")
+      ctx.symtab.findUnderscore("__arm64x_native_entrypoint")
           ->replaceKeepingName(altEntrySym, sizeof(SymbolUnion));
     }
 
-    if (symtab->edataStart)
+    if (ctx.symtab.edataStart)
       ctx.dynamicRelocs->set(
           dataDirOffset64 + EXPORT_TABLE * sizeof(data_directory) +
               offsetof(data_directory, Size),
-          symtab->edataEnd->getRVA() - symtab->edataStart->getRVA() +
-              symtab->edataEnd->getSize());
+          ctx.symtab.edataEnd->getRVA() - ctx.symtab.edataStart->getRVA() +
+              ctx.symtab.edataEnd->getSize());
     if (hybridPdata.first) {
       ctx.dynamicRelocs->set(
           dataDirOffset64 + EXCEPTION_TABLE * sizeof(data_directory) +

>From 68b7cba2b04a036dfb2e216cfafe70a83fbc7530 Mon Sep 17 00:00:00 2001
From: Henry Jiang <h243jian at uwaterloo.ca>
Date: Fri, 11 Apr 2025 12:55:45 -0400
Subject: [PATCH 11/76] [LoopIdiom] Update strlen idiom body loop condition to
 be clean up by LoopDeletion (#134906)

Fixes the case where subsequent passes were unable to find and delete
the invariant loop left over by the strlen idiom conversion. Since
`loop-deletion` only operate on computable loops, we can update the loop
condition to something more easily picked up by `loop-deletion`

As pointed out in https://github.com/llvm/llvm-project/issues/134736
---
 .../Transforms/Scalar/LoopIdiomRecognize.cpp  | 15 +++++++
 .../Transforms/LoopIdiom/strlen-cleanup.ll    | 43 +++++++++++++++++++
 llvm/test/Transforms/LoopIdiom/strlen.ll      | 12 +++---
 llvm/test/Transforms/LoopIdiom/wcslen16.ll    |  2 +-
 llvm/test/Transforms/LoopIdiom/wcslen32.ll    |  2 +-
 5 files changed, 66 insertions(+), 8 deletions(-)
 create mode 100644 llvm/test/Transforms/LoopIdiom/strlen-cleanup.ll

diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 4940dd8c47dde..eacc67cd5a475 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1745,7 +1745,11 @@ bool LoopIdiomRecognize::recognizeAndInsertStrLen() {
     return false;
 
   BasicBlock *Preheader = CurLoop->getLoopPreheader();
+  BasicBlock *LoopBody = *CurLoop->block_begin();
   BasicBlock *LoopExitBB = CurLoop->getExitBlock();
+  BranchInst *LoopTerm = dyn_cast<BranchInst>(LoopBody->getTerminator());
+  assert(Preheader && LoopBody && LoopExitBB && LoopTerm &&
+         "Should be verified to be valid by StrlenVerifier");
 
   if (Verifier.OpWidth == 8) {
     if (DisableLIRP::Strlen)
@@ -1804,6 +1808,17 @@ bool LoopIdiomRecognize::recognizeAndInsertStrLen() {
   // up by later passes
   for (PHINode *PN : Cleanup)
     RecursivelyDeleteDeadPHINode(PN);
+
+  // LoopDeletion only delete invariant loops with known trip-count. We can
+  // update the condition so it will reliablely delete the invariant loop
+  assert(LoopTerm->getNumSuccessors() == 2 &&
+         (LoopTerm->getSuccessor(0) == LoopBody ||
+          LoopTerm->getSuccessor(1) == LoopBody) &&
+         "loop body must have a successor that is it self");
+  ConstantInt *NewLoopCond = LoopTerm->getSuccessor(0) == LoopBody
+                                 ? Builder.getFalse()
+                                 : Builder.getTrue();
+  LoopTerm->setCondition(NewLoopCond);
   SE->forgetLoop(CurLoop);
 
   ++NumStrLen;
diff --git a/llvm/test/Transforms/LoopIdiom/strlen-cleanup.ll b/llvm/test/Transforms/LoopIdiom/strlen-cleanup.ll
new file mode 100644
index 0000000000000..60b5ac6ce1d78
--- /dev/null
+++ b/llvm/test/Transforms/LoopIdiom/strlen-cleanup.ll
@@ -0,0 +1,43 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s -S -passes=loop-idiom,loop-deletion | FileCheck %s
+
+define [2 x i64] @convert_null_terminated_to_bounded_ptr(ptr noundef %p) {
+; CHECK-LABEL: define [2 x i64] @convert_null_terminated_to_bounded_ptr(
+; CHECK-SAME: ptr noundef [[P:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[WCSLEN:%.*]] = call i64 @wcslen(ptr [[P]])
+; CHECK-NEXT:    br label %[[TERMINATED_BY_LOOP_END:.*]]
+; CHECK:       [[TERMINATED_BY_LOOP_END]]:
+; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr inbounds i32, ptr [[P]], i64 [[WCSLEN]]
+; CHECK-NEXT:    [[TERMINATED_BY_UPPER:%.*]] = getelementptr i8, ptr [[TMP0]], i64 4
+; CHECK-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[P]] to i64
+; CHECK-NEXT:    [[DOTFCA_0_INSERT:%.*]] = insertvalue [2 x i64] poison, i64 [[TMP1]], 0
+; CHECK-NEXT:    [[TMP2:%.*]] = ptrtoint ptr [[TERMINATED_BY_UPPER]] to i64
+; CHECK-NEXT:    [[DOTFCA_1_INSERT:%.*]] = insertvalue [2 x i64] [[DOTFCA_0_INSERT]], i64 [[TMP2]], 1
+; CHECK-NEXT:    ret [2 x i64] [[DOTFCA_1_INSERT]]
+;
+entry:
+  br label %terminated_by.loop_cond
+
+terminated_by.loop_cond:                          ; preds = %terminated_by.loop_cond, %entry
+  %terminated_by.len.0 = phi i64 [ 0, %entry ], [ %terminated_by.new_len, %terminated_by.loop_cond ]
+  %0 = getelementptr inbounds i32, ptr %p, i64 %terminated_by.len.0
+  %terminated_by.elem = load i32, ptr %0, align 4
+  %terminted_by.check_terminator = icmp eq i32 %terminated_by.elem, 0
+  %terminated_by.new_len = add i64 %terminated_by.len.0, 1
+  br i1 %terminted_by.check_terminator, label %terminated_by.loop_end, label %terminated_by.loop_cond
+
+terminated_by.loop_end:                           ; preds = %terminated_by.loop_cond
+  %1 = getelementptr inbounds i32, ptr %p, i64 %terminated_by.len.0
+  %terminated_by.upper = getelementptr i8, ptr %1, i64 4
+  %2 = ptrtoint ptr %p to i64
+  %.fca.0.insert = insertvalue [2 x i64] poison, i64 %2, 0
+  %3 = ptrtoint ptr %terminated_by.upper to i64
+  %.fca.1.insert = insertvalue [2 x i64] %.fca.0.insert, i64 %3, 1
+  ret [2 x i64] %.fca.1.insert
+}
+
+!llvm.module.flags = !{!0}
+
+!0 = !{i32 1, !"wchar_size", i32 4}
+
diff --git a/llvm/test/Transforms/LoopIdiom/strlen.ll b/llvm/test/Transforms/LoopIdiom/strlen.ll
index c1141177c659f..3b9d33ebdc74e 100644
--- a/llvm/test/Transforms/LoopIdiom/strlen.ll
+++ b/llvm/test/Transforms/LoopIdiom/strlen.ll
@@ -24,7 +24,7 @@ define i64 @valid_basic_strlen(ptr %str) {
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i8, ptr [[STR_ADDR_0]], align 1
 ; CHECK-NEXT:    [[CMP_NOT:%.*]] = icmp eq i8 [[TMP0]], 0
 ; CHECK-NEXT:    [[INCDEC_PTR]] = getelementptr i8, ptr [[STR_ADDR_0]], i64 1
-; CHECK-NEXT:    br i1 [[CMP_NOT]], label %[[WHILE_END:.*]], label %[[WHILE_COND]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END:.*]], label %[[WHILE_COND]]
 ; CHECK:       [[WHILE_END]]:
 ; CHECK-NEXT:    [[SUB_PTR_LHS_CAST:%.*]] = ptrtoint ptr [[SCEVGEP]] to i64
 ; CHECK-NEXT:    [[SUB_PTR_RHS_CAST:%.*]] = ptrtoint ptr [[STR]] to i64
@@ -74,7 +74,7 @@ define i32 @valid_basic_strlen_rotated(ptr %str) {
 ; CHECK-NEXT:    [[INCDEC_PTR]] = getelementptr inbounds nuw i8, ptr [[STR_ADDR_0]], i64 1
 ; CHECK-NEXT:    [[TMP2:%.*]] = load i8, ptr [[INCDEC_PTR]], align 1
 ; CHECK-NEXT:    [[TOBOOL1_NOT:%.*]] = icmp eq i8 [[TMP2]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL1_NOT]], label %[[DO_END:.*]], label %[[DO_BODY]]
+; CHECK-NEXT:    br i1 true, label %[[DO_END:.*]], label %[[DO_BODY]]
 ; CHECK:       [[DO_END]]:
 ; CHECK-NEXT:    [[SUB_PTR_LHS_CAST:%.*]] = ptrtoint ptr [[SCEVGEP1]] to i64
 ; CHECK-NEXT:    [[SUB_PTR_RHS_CAST:%.*]] = ptrtoint ptr [[STR]] to i64
@@ -163,7 +163,7 @@ define dso_local void @valid_strlen_with_aux_indvar(ptr noundef %str, ptr nounde
 ; CHECK-NEXT:    [[INCDEC_PTR2]] = getelementptr inbounds nuw i8, ptr [[FOO_ADDR_011]], i64 1
 ; CHECK-NEXT:    [[TMP10:%.*]] = load i8, ptr [[INCDEC_PTR]], align 1
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i8 [[TMP10]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END_LOOPEXIT:.*]], label %[[WHILE_BODY]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END_LOOPEXIT:.*]], label %[[WHILE_BODY]]
 ; CHECK:       [[WHILE_END_LOOPEXIT]]:
 ; CHECK-NEXT:    br label %[[WHILE_END]]
 ; CHECK:       [[WHILE_END]]:
@@ -232,7 +232,7 @@ define i32 @valid_strlen_index(ptr %str) {
 ; CHECK-NEXT:    [[TMP0:%.*]] = load i8, ptr [[ARRAYIDX]], align 1
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i8 [[TMP0]], 0
 ; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END:.*]], label %[[WHILE_COND]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END:.*]], label %[[WHILE_COND]]
 ; CHECK:       [[WHILE_END]]:
 ; CHECK-NEXT:    [[TMP1:%.*]] = trunc nuw nsw i64 [[STRLEN]] to i32
 ; CHECK-NEXT:    ret i32 [[TMP1]]
@@ -290,7 +290,7 @@ define dso_local void @valid_strlen_offset(ptr noundef %str) local_unnamed_addr
 ; CHECK-NEXT:    [[TMP4:%.*]] = load i8, ptr [[STR_ADDR_0]], align 1
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i8 [[TMP4]], 0
 ; CHECK-NEXT:    [[INCDEC_PTR14]] = getelementptr inbounds nuw i8, ptr [[STR_ADDR_0]], i64 1
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END:.*]], label %[[WHILE_COND]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END:.*]], label %[[WHILE_COND]]
 ; CHECK:       [[WHILE_END]]:
 ; CHECK-NEXT:    tail call void @use(ptr noundef nonnull [[SCEVGEP]])
 ; CHECK-NEXT:    br label %[[RETURN]]
@@ -377,7 +377,7 @@ define void @valid_nested_idiom(ptr %strs, i32 %n) {
 ; CHECK-NEXT:    [[INC]] = add nuw nsw i32 [[COUNT_08]], 1
 ; CHECK-NEXT:    [[TMP4:%.*]] = load i8, ptr [[INCDEC_PTR]], align 1
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i8 [[TMP4]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END_LOOPEXIT:.*]], label %[[WHILE_BODY]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END_LOOPEXIT:.*]], label %[[WHILE_BODY]]
 ; CHECK:       [[WHILE_END_LOOPEXIT]]:
 ; CHECK-NEXT:    br label %[[WHILE_END]]
 ; CHECK:       [[WHILE_END]]:
diff --git a/llvm/test/Transforms/LoopIdiom/wcslen16.ll b/llvm/test/Transforms/LoopIdiom/wcslen16.ll
index 8be51869f1f2e..cd8a31f4af3dd 100644
--- a/llvm/test/Transforms/LoopIdiom/wcslen16.ll
+++ b/llvm/test/Transforms/LoopIdiom/wcslen16.ll
@@ -26,7 +26,7 @@ define i64 @valid_strlen16(ptr %src) {
 ; CHECK-NEXT:    [[CURR_0]] = getelementptr inbounds i8, ptr [[SRC_PN]], i64 2
 ; CHECK-NEXT:    [[TMP3:%.*]] = load i16, ptr [[CURR_0]], align 2
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i16 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END:.*]], label %[[WHILE_COND]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END:.*]], label %[[WHILE_COND]]
 ; CHECK:       [[WHILE_END]]:
 ; CHECK-NEXT:    [[SUB_PTR_LHS_CAST:%.*]] = ptrtoint ptr [[END]] to i64
 ; CHECK-NEXT:    [[SUB_PTR_RHS_CAST:%.*]] = ptrtoint ptr [[SRC]] to i64
diff --git a/llvm/test/Transforms/LoopIdiom/wcslen32.ll b/llvm/test/Transforms/LoopIdiom/wcslen32.ll
index 2c7ceb4d187e6..f1cddf9424ffd 100644
--- a/llvm/test/Transforms/LoopIdiom/wcslen32.ll
+++ b/llvm/test/Transforms/LoopIdiom/wcslen32.ll
@@ -26,7 +26,7 @@ define i64 @valid_wcslen32(ptr %src) {
 ; CHECK-NEXT:    [[CURR_0]] = getelementptr inbounds i8, ptr [[SRC_PN]], i64 4
 ; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr [[CURR_0]], align 4
 ; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP3]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label %[[WHILE_END:.*]], label %[[WHILE_COND]]
+; CHECK-NEXT:    br i1 true, label %[[WHILE_END:.*]], label %[[WHILE_COND]]
 ; CHECK:       [[WHILE_END]]:
 ; CHECK-NEXT:    [[SUB_PTR_LHS_CAST:%.*]] = ptrtoint ptr [[END]] to i64
 ; CHECK-NEXT:    [[SUB_PTR_RHS_CAST:%.*]] = ptrtoint ptr [[SRC]] to i64

>From d995b2ebdc1a312c8583351c13dac90e8e320a09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Manuel=20Martinez=20Caama=C3=B1o?=
 <jmartinezcaamao at gmail.com>
Date: Fri, 11 Apr 2025 19:11:46 +0200
Subject: [PATCH 12/76] [Clang][AMDGPU] Accept builtins in lambda declarations
 (#135027)

`Sema::getCurFunctionDecl(AllowLambda = false)` returns a nullptr when
the lambda declaration is outside a function (for example, when
assigning a lambda to a static constexpr variable).

This triggered an assertion in
`SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall`.

Using `Sema::getCurFunctionDecl(AllowLambda = true)` returns the
declaration of the enclosing lambda.

Stumbled with this issue when refactoring some code in CK.
---
 clang/lib/Sema/SemaAMDGPU.cpp                 |  2 +-
 ...n-in-lambda-with-unsupported-attribute.hip | 34 ++++++++++++
 .../test/SemaHIP/amdgpu-builtin-in-lambda.hip | 53 +++++++++++++++++++
 3 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip
 create mode 100644 clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip

diff --git a/clang/lib/Sema/SemaAMDGPU.cpp b/clang/lib/Sema/SemaAMDGPU.cpp
index 7fec099374152..a6366aceec2a6 100644
--- a/clang/lib/Sema/SemaAMDGPU.cpp
+++ b/clang/lib/Sema/SemaAMDGPU.cpp
@@ -27,7 +27,7 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
   // position of memory order and scope arguments in the builtin
   unsigned OrderIndex, ScopeIndex;
 
-  const auto *FD = SemaRef.getCurFunctionDecl();
+  const auto *FD = SemaRef.getCurFunctionDecl(/*AllowLambda=*/true);
   assert(FD && "AMDGPU builtins should not be used outside of a function");
   llvm::StringMap<bool> CallerFeatureMap;
   getASTContext().getFunctionFeatureMap(CallerFeatureMap, FD);
diff --git a/clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip b/clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip
new file mode 100644
index 0000000000000..5b9223f2eaa3a
--- /dev/null
+++ b/clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip
@@ -0,0 +1,34 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu tahiti -emit-llvm -fcuda-is-device -verify=no-memrealtime -o - %s
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx950 -emit-llvm -fcuda-is-device -o - %s
+
+#define __device__ __attribute__((device))
+#define __shared__ __attribute__((shared))
+
+struct S {
+    static constexpr auto memrealtime_lambda = []() {
+        __builtin_amdgcn_s_memrealtime(); // no-memrealtime-error{{'__builtin_amdgcn_s_memrealtime' needs target feature s-memrealtime}}
+    };
+};
+
+__attribute__((target("s-memrealtime")))
+__device__ void test_target_dependant_builtin_attr_fail() {
+    S::memrealtime_lambda();
+}
+
+constexpr auto memrealtime_lambda = []() {
+    __builtin_amdgcn_s_memrealtime(); // no-memrealtime-error{{'__builtin_amdgcn_s_memrealtime' needs target feature s-memrealtime}}
+};
+
+__attribute__((target("s-memrealtime")))
+__device__ void global_test_target_dependant_builtin_attr_fail() {
+    memrealtime_lambda();
+}
+
+__attribute__((target("s-memrealtime")))
+__device__ void local_test_target_dependant_builtin_attr_fail() {
+    static constexpr auto f = []() {
+        __builtin_amdgcn_s_memrealtime(); // no-memrealtime-error{{'__builtin_amdgcn_s_memrealtime' needs target feature s-memrealtime}}
+    };
+    f();
+}
diff --git a/clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip b/clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip
new file mode 100644
index 0000000000000..8f0b14b7379d2
--- /dev/null
+++ b/clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx90a -fsyntax-only -fcuda-is-device -verify=gfx90a -o - %s
+// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx950 -fsyntax-only -fcuda-is-device -o - %s
+
+#define __device__ __attribute__((device))
+#define __shared__ __attribute__((shared))
+
+struct S {
+    static constexpr auto make_buffer_rsrc_lambda = [](void *p, short stride, int num, int flags) {
+        return __builtin_amdgcn_make_buffer_rsrc(p, stride, num, flags);
+    };
+
+    static constexpr auto global_load_lds_lambda = [](void* src, __shared__ void *dst) {
+        __builtin_amdgcn_global_load_lds(src, dst, 16, 0, 0); // gfx90a-error{{invalid size value}} gfx90a-note{{size must be 1, 2, or 4}}
+    };
+};
+
+__device__ __amdgpu_buffer_rsrc_t test_simple_builtin(void *p, short stride, int num, int flags) {
+    return S::make_buffer_rsrc_lambda(p, stride, num, flags);
+}
+
+__device__ void test_target_dependant_builtin(void *src, __shared__ void *dst) {
+    S::global_load_lds_lambda(src, dst);
+}
+
+constexpr auto make_buffer_rsrc_lambda = [](void *p, short stride, int num, int flags) {
+    return __builtin_amdgcn_make_buffer_rsrc(p, stride, num, flags);
+};
+
+constexpr auto global_load_lds_lambda = [](void* src, __shared__ void *dst) {
+    __builtin_amdgcn_global_load_lds(src, dst, 16, 0, 0); // gfx90a-error{{invalid size value}} gfx90a-note{{size must be 1, 2, or 4}}
+};
+
+__device__ __amdgpu_buffer_rsrc_t global_test_simple_builtin(void *p, short stride, int num, int flags) {
+    return make_buffer_rsrc_lambda(p, stride, num, flags);
+}
+
+__device__ void global_test_target_dependant_builtin(void *src, __shared__ void *dst) {
+    global_load_lds_lambda(src, dst);
+}
+
+__device__ __amdgpu_buffer_rsrc_t local_test_simple_builtin(void *p, short stride, int num, int flags) {
+    constexpr auto f = [](void *p, short stride, int num, int flags) {
+        return __builtin_amdgcn_make_buffer_rsrc(p, stride, num, flags);
+    };
+    return f(p, stride, num, flags);
+}
+
+__device__ void local_test_target_dependant_builtin(void *src, __shared__ void *dst) {
+    constexpr auto f = [](void* src, __shared__ void *dst) {
+        __builtin_amdgcn_global_load_lds(src, dst, 16, 0, 0); // gfx90a-error{{invalid size value}} gfx90a-note{{size must be 1, 2, or 4}}
+    };
+    f(src, dst);
+}

>From 8fb6bb3e23966c973bb04784e165473f681ec7af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valentin=20Clement=20=28=E3=83=90=E3=83=AC=E3=83=B3?=
 =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=B3=20=E3=82=AF=E3=83=AC=E3=83=A1?=
 =?UTF-8?q?=E3=83=B3=29?= <clementval at gmail.com>
Date: Fri, 11 Apr 2025 10:15:17 -0700
Subject: [PATCH 13/76] [flang][openacc] Allow multiple device_type clauses on
 init and shutdown (#135314)

Relax the restriction for init and shutdown directives for device_type
clause. The clause can be allowed multiple times.
---
 flang/test/Lower/OpenACC/acc-init.f90            |  3 +++
 flang/test/Lower/OpenACC/acc-shutdown.f90        |  3 +++
 .../test/Semantics/OpenACC/acc-init-validity.f90 |  2 +-
 .../Semantics/OpenACC/acc-shutdown-validity.f90  |  2 +-
 llvm/include/llvm/Frontend/OpenACC/ACC.td        | 16 ++++++----------
 5 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/flang/test/Lower/OpenACC/acc-init.f90 b/flang/test/Lower/OpenACC/acc-init.f90
index 2fbb9550548a9..cc1abc4b294c7 100644
--- a/flang/test/Lower/OpenACC/acc-init.f90
+++ b/flang/test/Lower/OpenACC/acc-init.f90
@@ -35,4 +35,7 @@ subroutine acc_init
    !$acc init device_type(nvidia)
 !CHECK: acc.init attributes {device_types = [#acc.device_type<nvidia>]}
 
+  !$acc init device_type(host) device_type(multicore)
+!CHECK: acc.init attributes {device_types = [#acc.device_type<host>, #acc.device_type<multicore>]}
+
 end subroutine acc_init
diff --git a/flang/test/Lower/OpenACC/acc-shutdown.f90 b/flang/test/Lower/OpenACC/acc-shutdown.f90
index 6c080b932f92e..304dd4fae6db5 100644
--- a/flang/test/Lower/OpenACC/acc-shutdown.f90
+++ b/flang/test/Lower/OpenACC/acc-shutdown.f90
@@ -25,4 +25,7 @@ subroutine acc_shutdown
 !CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32
 !CHECK: acc.shutdown device_num([[DEVNUM]] : i32) attributes {device_types = [#acc.device_type<default>, #acc.device_type<nvidia>]} 
 
+  !$acc shutdown device_type(default) device_type(nvidia)
+!CHECK: acc.shutdown attributes {device_types = [#acc.device_type<default>, #acc.device_type<nvidia>]} 
+
 end subroutine acc_shutdown
diff --git a/flang/test/Semantics/OpenACC/acc-init-validity.f90 b/flang/test/Semantics/OpenACC/acc-init-validity.f90
index 3b594a25217c0..083a2415a5d77 100644
--- a/flang/test/Semantics/OpenACC/acc-init-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-init-validity.f90
@@ -93,7 +93,7 @@ program openacc_init_validity
   !ERROR: At most one DEVICE_NUM clause can appear on the INIT directive
   !$acc init device_num(1) device_num(i)
 
-  !ERROR: At most one DEVICE_TYPE clause can appear on the INIT directive
+  ! OK
   !$acc init device_type(nvidia) device_type(default, *)
 
   !ERROR: Must have LOGICAL or INTEGER type
diff --git a/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90 b/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
index 43aed4fc98f42..163130d41bdcc 100644
--- a/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
@@ -90,7 +90,7 @@ program openacc_shutdown_validity
   !ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive
   !$acc shutdown device_num(1) device_num(i)
 
-  !ERROR: At most one DEVICE_TYPE clause can appear on the SHUTDOWN directive
+  ! OK
   !$acc shutdown device_type(*) device_type(host, default)
 
 end program openacc_shutdown_validity
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index f3eefb52fc46d..8729d4505205b 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -432,11 +432,9 @@ def ACC_Cache : Directive<"cache"> {
 
 // 2.14.1
 def ACC_Init : Directive<"init"> {
-  let allowedOnceClauses = [
-    VersionedClause<ACCC_DeviceNum>,
-    VersionedClause<ACCC_DeviceType>,
-    VersionedClause<ACCC_If>
-  ];
+  let allowedOnceClauses = [VersionedClause<ACCC_DeviceNum>,
+                            VersionedClause<ACCC_If>];
+  let allowedClauses = [VersionedClause<ACCC_DeviceType>];
   let association = AS_None;
   let category = CA_Executable;
 }
@@ -480,11 +478,9 @@ def ACC_Set : Directive<"set"> {
 
 // 2.14.2
 def ACC_Shutdown : Directive<"shutdown"> {
-  let allowedOnceClauses = [
-    VersionedClause<ACCC_DeviceNum>,
-    VersionedClause<ACCC_DeviceType>,
-    VersionedClause<ACCC_If>
-  ];
+  let allowedOnceClauses = [VersionedClause<ACCC_DeviceNum>,
+                            VersionedClause<ACCC_If>];
+  let allowedClauses = [VersionedClause<ACCC_DeviceType>];
   let association = AS_None;
   let category = CA_Executable;
 }

>From 566c30e324a0e87269fc72e5a0219d4c3e1d9fbf Mon Sep 17 00:00:00 2001
From: Morris Hafner <mmha at users.noreply.github.com>
Date: Fri, 11 Apr 2025 19:26:29 +0200
Subject: [PATCH 14/76] [CIR] Upstream binary assignments and comma (#135115)

This patch adds `VisitBinAssign` and `VisitBinComma` to the ClangIR
`ScalarExprEmitter` to enable assignments and the comma operator.

---------

Co-authored-by: Morris Hafner <mhafner at nvidia.com>
---
 clang/include/clang/CIR/MissingFeatures.h  |  1 +
 clang/lib/CIR/CodeGen/CIRGenDecl.cpp       |  8 +++
 clang/lib/CIR/CodeGen/CIRGenExpr.cpp       |  7 +++
 clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp | 60 ++++++++++++++++++++++
 clang/lib/CIR/CodeGen/CIRGenFunction.h     |  7 +++
 clang/test/CIR/CodeGen/binassign.c         | 56 ++++++++++++++++++++
 clang/test/CIR/CodeGen/comma.c             | 59 +++++++++++++++++++++
 clang/test/CIR/IR/binassign.cir            | 45 ++++++++++++++++
 8 files changed, 243 insertions(+)
 create mode 100644 clang/test/CIR/CodeGen/binassign.c
 create mode 100644 clang/test/CIR/CodeGen/comma.c
 create mode 100644 clang/test/CIR/IR/binassign.cir

diff --git a/clang/include/clang/CIR/MissingFeatures.h b/clang/include/clang/CIR/MissingFeatures.h
index c39590421b647..d6a28d4324b32 100644
--- a/clang/include/clang/CIR/MissingFeatures.h
+++ b/clang/include/clang/CIR/MissingFeatures.h
@@ -143,6 +143,7 @@ struct MissingFeatures {
   static bool openMP() { return false; }
   static bool emitCheckedInBoundsGEP() { return false; }
   static bool preservedAccessIndexRegion() { return false; }
+  static bool bitfields() { return false; }
 
   // Missing types
   static bool dataMemberType() { return false; }
diff --git a/clang/lib/CIR/CodeGen/CIRGenDecl.cpp b/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
index b8e72f299acb6..58797c5dd253a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
@@ -277,3 +277,11 @@ void CIRGenFunction::emitDecl(const Decl &d) {
     cgm.errorNYI(d.getSourceRange(), "emitDecl: unhandled decl type");
   }
 }
+
+void CIRGenFunction::emitNullabilityCheck(LValue lhs, mlir::Value rhs,
+                                          SourceLocation loc) {
+  if (!sanOpts.has(SanitizerKind::NullabilityAssign))
+    return;
+
+  assert(!cir::MissingFeatures::sanitizers());
+}
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index b38ed4d0a14e8..f0732a8ea60af 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -257,6 +257,13 @@ void CIRGenFunction::emitStoreOfScalar(mlir::Value value, Address addr,
   assert(!cir::MissingFeatures::opTBAA());
 }
 
+mlir::Value CIRGenFunction::emitStoreThroughBitfieldLValue(RValue src,
+                                                           LValue dst) {
+  assert(!cir::MissingFeatures::bitfields());
+  cgm.errorNYI("bitfields");
+  return {};
+}
+
 mlir::Value CIRGenFunction::emitToMemory(mlir::Value value, QualType ty) {
   // Bool has a different representation in memory than in registers,
   // but in ClangIR, it is simply represented as a cir.bool value.
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
index c2b4110a772a0..38104f8533c7d 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
@@ -21,6 +21,7 @@
 #include "mlir/IR/Value.h"
 
 #include <cassert>
+#include <utility>
 
 using namespace clang;
 using namespace clang::CIRGen;
@@ -818,6 +819,65 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
   VISITCOMP(EQ)
   VISITCOMP(NE)
 #undef VISITCOMP
+
+  mlir::Value VisitBinAssign(const BinaryOperator *e) {
+    const bool ignore = std::exchange(ignoreResultAssign, false);
+
+    mlir::Value rhs;
+    LValue lhs;
+
+    switch (e->getLHS()->getType().getObjCLifetime()) {
+    case Qualifiers::OCL_Strong:
+    case Qualifiers::OCL_Autoreleasing:
+    case Qualifiers::OCL_ExplicitNone:
+    case Qualifiers::OCL_Weak:
+      assert(!cir::MissingFeatures::objCLifetime());
+      break;
+    case Qualifiers::OCL_None:
+      // __block variables need to have the rhs evaluated first, plus this
+      // should improve codegen just a little.
+      rhs = Visit(e->getRHS());
+      assert(!cir::MissingFeatures::sanitizers());
+      // TODO(cir): This needs to be emitCheckedLValue() once we support
+      // sanitizers
+      lhs = cgf.emitLValue(e->getLHS());
+
+      // Store the value into the LHS. Bit-fields are handled specially because
+      // the result is altered by the store, i.e., [C99 6.5.16p1]
+      // 'An assignment expression has the value of the left operand after the
+      // assignment...'.
+      if (lhs.isBitField()) {
+        rhs = cgf.emitStoreThroughBitfieldLValue(RValue::get(rhs), lhs);
+      } else {
+        cgf.emitNullabilityCheck(lhs, rhs, e->getExprLoc());
+        CIRGenFunction::SourceLocRAIIObject loc{
+            cgf, cgf.getLoc(e->getSourceRange())};
+        cgf.emitStoreThroughLValue(RValue::get(rhs), lhs);
+      }
+    }
+
+    // If the result is clearly ignored, return now.
+    if (ignore)
+      return nullptr;
+
+    // The result of an assignment in C is the assigned r-value.
+    if (!cgf.getLangOpts().CPlusPlus)
+      return rhs;
+
+    // If the lvalue is non-volatile, return the computed value of the
+    // assignment.
+    if (!lhs.isVolatile())
+      return rhs;
+
+    // Otherwise, reload the value.
+    return emitLoadOfLValue(lhs, e->getExprLoc());
+  }
+
+  mlir::Value VisitBinComma(const BinaryOperator *e) {
+    cgf.emitIgnoredExpr(e->getLHS());
+    // NOTE: We don't need to EnsureInsertPoint() like LLVM codegen.
+    return Visit(e->getRHS());
+  }
 };
 
 LValue ScalarExprEmitter::emitCompoundAssignLValue(
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h
index 17aa68492f983..8082592598c19 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.h
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h
@@ -579,6 +579,8 @@ class CIRGenFunction : public CIRGenTypeCache {
   /// is 'Ty'.
   void emitStoreThroughLValue(RValue src, LValue dst, bool isInit = false);
 
+  mlir::Value emitStoreThroughBitfieldLValue(RValue src, LValue dstresult);
+
   /// Given a value and its clang type, returns the value casted to its memory
   /// representation.
   /// Note: CIR defers most of the special casting to the final lowering passes
@@ -593,6 +595,11 @@ class CIRGenFunction : public CIRGenTypeCache {
 
   mlir::LogicalResult emitWhileStmt(const clang::WhileStmt &s);
 
+  /// Given an assignment `*lhs = rhs`, emit a test that checks if \p rhs is
+  /// nonnull, if 1\p LHS is marked _Nonnull.
+  void emitNullabilityCheck(LValue lhs, mlir::Value rhs,
+                            clang::SourceLocation loc);
+
   /// ----------------------
   /// CIR build helpers
   /// -----------------
diff --git a/clang/test/CIR/CodeGen/binassign.c b/clang/test/CIR/CodeGen/binassign.c
new file mode 100644
index 0000000000000..5a7f0b7fd3f79
--- /dev/null
+++ b/clang/test/CIR/CodeGen/binassign.c
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
+
+void binary_assign(void) {
+    bool b;
+    char c;
+    float f;
+    int i;
+
+    b = true;
+    c = 65;
+    f = 3.14f;
+    i = 42;
+}
+
+// CIR-LABEL: cir.func @binary_assign() {
+// CIR:         %[[B:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b"]
+// CIR:         %[[C:.*]] = cir.alloca !s8i, !cir.ptr<!s8i>, ["c"]
+// CIR:         %[[F:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f"]
+// CIR:         %[[I:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i"]
+// CIR:         %[[TRUE:.*]] = cir.const #true
+// CIR:         cir.store %[[TRUE]], %[[B]] : !cir.bool, !cir.ptr<!cir.bool>
+// CIR:         %[[CHAR_INI_INIT:.*]] = cir.const #cir.int<65> : !s32i
+// CIR:         %[[CHAR_VAL:.*]] = cir.cast(integral, %[[CHAR_INI_INIT]] : !s32i), !s8i
+// CIR:         cir.store %[[CHAR_VAL]], %[[C]] : !s8i, !cir.ptr<!s8i>
+// CIR:         %[[FLOAT_VAL:.*]] = cir.const #cir.fp<3.140000e+00> : !cir.float
+// CIR:         cir.store %[[FLOAT_VAL]], %[[F]] : !cir.float, !cir.ptr<!cir.float>
+// CIR:         %[[INT_VAL:.*]] = cir.const #cir.int<42> : !s32i
+// CIR:         cir.store %[[INT_VAL]], %[[I]] : !s32i, !cir.ptr<!s32i>
+// CIR:         cir.return
+
+// LLVM-LABEL: define {{.*}}void @binary_assign() {
+// LLVM:         %[[B_PTR:.*]] = alloca i8
+// LLVM:         %[[C_PTR:.*]] = alloca i8
+// LLVM:         %[[F_PTR:.*]] = alloca float
+// LLVM:         %[[I_PTR:.*]] = alloca i32
+// LLVM:         store i8 1, ptr %[[B_PTR]]
+// LLVM:         store i8 65, ptr %[[C_PTR]]
+// LLVM:         store float 0x40091EB860000000, ptr %[[F_PTR]]
+// LLVM:         store i32 42, ptr %[[I_PTR]]
+// LLVM:         ret void
+
+// OGCG-LABEL: define {{.*}}void @binary_assign()
+// OGCG:         %[[B_PTR:.*]] = alloca i8
+// OGCG:         %[[C_PTR:.*]] = alloca i8
+// OGCG:         %[[F_PTR:.*]] = alloca float
+// OGCG:         %[[I_PTR:.*]] = alloca i32
+// OGCG:         store i8 1, ptr %[[B_PTR]]
+// OGCG:         store i8 65, ptr %[[C_PTR]]
+// OGCG:         store float 0x40091EB860000000, ptr %[[F_PTR]]
+// OGCG:         store i32 42, ptr %[[I_PTR]]
+// OGCG:         ret void
diff --git a/clang/test/CIR/CodeGen/comma.c b/clang/test/CIR/CodeGen/comma.c
new file mode 100644
index 0000000000000..7ce53eaf1a238
--- /dev/null
+++ b/clang/test/CIR/CodeGen/comma.c
@@ -0,0 +1,59 @@
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM
+// RUN: %clang_cc1 -std=c23 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
+
+void comma(void) {
+    bool b;
+    char c;
+    float f;
+    int i;
+
+    b = true, c = 65, f = 3.14f, i = 42;
+
+    i = 100, 200;
+}
+
+// CIR-LABEL: cir.func @comma() {
+// CIR:         %[[B:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b"]
+// CIR:         %[[C:.*]] = cir.alloca !s8i, !cir.ptr<!s8i>, ["c"]
+// CIR:         %[[F:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f"]
+// CIR:         %[[I:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i"]
+// CIR:         %[[TRUE:.*]] = cir.const #true
+// CIR:         cir.store %[[TRUE]], %[[B]] : !cir.bool, !cir.ptr<!cir.bool>
+// CIR:         %[[CHAR_INI_INIT:.*]] = cir.const #cir.int<65> : !s32i
+// CIR:         %[[CHAR_VAL:.*]] = cir.cast(integral, %[[CHAR_INI_INIT]] : !s32i), !s8i
+// CIR:         cir.store %[[CHAR_VAL]], %[[C]] : !s8i, !cir.ptr<!s8i>
+// CIR:         %[[FLOAT_VAL:.*]] = cir.const #cir.fp<3.140000e+00> : !cir.float
+// CIR:         cir.store %[[FLOAT_VAL]], %[[F]] : !cir.float, !cir.ptr<!cir.float>
+// CIR:         %[[INT_VAL:.*]] = cir.const #cir.int<42> : !s32i
+// CIR:         cir.store %[[INT_VAL]], %[[I]] : !s32i, !cir.ptr<!s32i>
+// CIR:         %[[HUNDRED:.*]] = cir.const #cir.int<100> : !s32i
+// CIR:         cir.store %[[HUNDRED]], %[[I]] : !s32i, !cir.ptr<!s32i>
+// CIR:         cir.return
+
+// LLVM-LABEL: define {{.*}}void @comma() {
+// LLVM:         %[[B_PTR:.*]] = alloca i8
+// LLVM:         %[[C_PTR:.*]] = alloca i8
+// LLVM:         %[[F_PTR:.*]] = alloca float
+// LLVM:         %[[I_PTR:.*]] = alloca i32
+// LLVM:         store i8 1, ptr %[[B_PTR]]
+// LLVM:         store i8 65, ptr %[[C_PTR]]
+// LLVM:         store float 0x40091EB860000000, ptr %[[F_PTR]]
+// LLVM:         store i32 42, ptr %[[I_PTR]]
+// LLVM:         store i32 100, ptr %[[I_PTR]]
+// LLVM:         ret void
+
+// OGCG-LABEL: define {{.*}}void @comma()
+// OGCG:         %[[B_PTR:.*]] = alloca i8
+// OGCG:         %[[C_PTR:.*]] = alloca i8
+// OGCG:         %[[F_PTR:.*]] = alloca float
+// OGCG:         %[[I_PTR:.*]] = alloca i32
+// OGCG:         store i8 1, ptr %[[B_PTR]]
+// OGCG:         store i8 65, ptr %[[C_PTR]]
+// OGCG:         store float 0x40091EB860000000, ptr %[[F_PTR]]
+// OGCG:         store i32 42, ptr %[[I_PTR]]
+// OGCG:         store i32 100, ptr %[[I_PTR]]
+// OGCG:         ret void
diff --git a/clang/test/CIR/IR/binassign.cir b/clang/test/CIR/IR/binassign.cir
new file mode 100644
index 0000000000000..24ed95d3c29c7
--- /dev/null
+++ b/clang/test/CIR/IR/binassign.cir
@@ -0,0 +1,45 @@
+// RUN: cir-opt %s | cir-opt | FileCheck %s
+
+!s32i = !cir.int<s, 32>
+!s8i = !cir.int<s, 8>
+#true = #cir.bool<true> : !cir.bool
+module {
+  cir.func @binary_assign() {
+    %0 = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b"] {alignment = 1 : i64}
+    %1 = cir.alloca !s8i, !cir.ptr<!s8i>, ["c"] {alignment = 1 : i64}
+    %2 = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f"] {alignment = 4 : i64}
+    %3 = cir.alloca !s32i, !cir.ptr<!s32i>, ["i"] {alignment = 4 : i64}
+    %4 = cir.const #true
+    cir.store %4, %0 : !cir.bool, !cir.ptr<!cir.bool>
+    %5 = cir.const #cir.int<65> : !s32i
+    %6 = cir.cast(integral, %5 : !s32i), !s8i
+    cir.store %6, %1 : !s8i, !cir.ptr<!s8i>
+    %7 = cir.const #cir.fp<3.140000e+00> : !cir.float
+    cir.store %7, %2 : !cir.float, !cir.ptr<!cir.float>
+    %8 = cir.const #cir.int<42> : !s32i
+    cir.store %8, %3 : !s32i, !cir.ptr<!s32i>
+    cir.return
+  }
+}
+
+// CHECK: !s32i = !cir.int<s, 32>
+// CHECK: !s8i = !cir.int<s, 8>
+// CHECK: #true = #cir.bool<true> : !cir.bool
+// CHECK: module {
+// CHECK:   cir.func @binary_assign() {
+// CHECK:     %0 = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b"] {alignment = 1 : i64}
+// CHECK:     %1 = cir.alloca !s8i, !cir.ptr<!s8i>, ["c"] {alignment = 1 : i64}
+// CHECK:     %2 = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f"] {alignment = 4 : i64}
+// CHECK:     %3 = cir.alloca !s32i, !cir.ptr<!s32i>, ["i"] {alignment = 4 : i64}
+// CHECK:     %4 = cir.const #true
+// CHECK:     cir.store %4, %0 : !cir.bool, !cir.ptr<!cir.bool>
+// CHECK:     %5 = cir.const #cir.int<65> : !s32i
+// CHECK:     %6 = cir.cast(integral, %5 : !s32i), !s8i
+// CHECK:     cir.store %6, %1 : !s8i, !cir.ptr<!s8i>
+// CHECK:     %7 = cir.const #cir.fp<3.140000e+00> : !cir.float
+// CHECK:     cir.store %7, %2 : !cir.float, !cir.ptr<!cir.float>
+// CHECK:     %8 = cir.const #cir.int<42> : !s32i
+// CHECK:     cir.store %8, %3 : !s32i, !cir.ptr<!s32i>
+// CHECK:     cir.return
+// CHECK:   }
+// CHECK: }

>From bd0b2bdacc95332a62d5eeb9582302cc12567be3 Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Fri, 11 Apr 2025 10:27:04 -0700
Subject: [PATCH 15/76] [SLP][NFC]Use VF instead of VL.size and modernize some
 transformations, NFC.

---
 .../Transforms/Vectorize/SLPVectorizer.cpp    | 33 ++++++++++---------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 57b85f354e484..c854821417c96 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -15347,13 +15347,14 @@ BoUpSLP::isGatherShuffledEntry(
 
 InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
                                        Type *ScalarTy) const {
-  auto *VecTy = getWidenedType(ScalarTy, VL.size());
+  const unsigned VF = VL.size();
+  auto *VecTy = getWidenedType(ScalarTy, VF);
   bool DuplicateNonConst = false;
   // Find the cost of inserting/extracting values from the vector.
   // Check if the same elements are inserted several times and count them as
   // shuffle candidates.
-  APInt ShuffledElements = APInt::getZero(VL.size());
-  APInt DemandedElements = APInt::getZero(VL.size());
+  APInt ShuffledElements = APInt::getZero(VF);
+  APInt DemandedElements = APInt::getZero(VF);
   DenseMap<Value *, unsigned> UniqueElements;
   constexpr TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
   InstructionCost Cost;
@@ -15363,11 +15364,10 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
       Cost += TTI->getCastInstrCost(Instruction::Trunc, ScalarTy, V->getType(),
                                     TTI::CastContextHint::None, CostKind);
   };
-  SmallVector<int> ShuffleMask(VL.size(), PoisonMaskElem);
-  SmallVector<int> ConstantShuffleMask(VL.size(), PoisonMaskElem);
+  SmallVector<int> ShuffleMask(VF, PoisonMaskElem);
+  SmallVector<int> ConstantShuffleMask(VF, PoisonMaskElem);
   std::iota(ConstantShuffleMask.begin(), ConstantShuffleMask.end(), 0);
-  for (unsigned I = 0, E = VL.size(); I < E; ++I) {
-    Value *V = VL[I];
+  for (auto [I, V] : enumerate(VL)) {
     // No need to shuffle duplicates for constants.
     if ((ForPoisonSrc && isConstant(V)) || isa<UndefValue>(V)) {
       ShuffledElements.setBit(I);
@@ -15376,7 +15376,7 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
     }
 
     if (isConstant(V)) {
-      ConstantShuffleMask[I] = I + E;
+      ConstantShuffleMask[I] = I + VF;
       ShuffleMask[I] = I;
       continue;
     }
@@ -15398,12 +15398,15 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
   if (!ForPoisonSrc && IsAnyNonUndefConst) {
     Cost += ::getShuffleCost(*TTI, TargetTransformInfo::SK_PermuteTwoSrc, VecTy,
                              ConstantShuffleMask);
-    for (auto [Idx, I] : enumerate(ShuffleMask)) {
-      if (I == PoisonMaskElem)
-        I = Idx;
-      else
-        I += VL.size();
-    }
+    // Update the shuffle mask for shuffling with incoming source (all elements
+    // are used!) or with constant subvector.
+    for_each(enumerate(ShuffleMask), [&](auto P) {
+      if ((!ForPoisonSrc && P.value() == PoisonMaskElem) ||
+          ConstantShuffleMask[P.index()] != PoisonMaskElem)
+        P.value() = P.index();
+      else if (P.value() != PoisonMaskElem)
+        P.value() += VF;
+    });
   }
 
   // 2. Insert unique non-constants.
@@ -15415,7 +15418,7 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
   // 3. Shuffle duplicates.
   if (DuplicateNonConst)
     Cost += ::getShuffleCost(*TTI, TargetTransformInfo::SK_PermuteSingleSrc,
-                             VecTy, ShuffleMask);
+                             VecTy, ShuffleMask, CostKind);
   return Cost;
 }
 

>From 68ab45f0533f3bbfc1c96bddd53de7e769180219 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Fri, 11 Apr 2025 10:42:47 -0700
Subject: [PATCH 16/76] Revert "[lldb] ProcessGdbRemote header gardning"

This reverts commit 2fd860c1f559c0b0be66cc000e38270a04d0a1a3 as this is
causing a EXC_BAD_ACCESS on Darwin:

https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/23807/
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/11255/
---
 .../Process/gdb-remote/GDBRemoteClientBase.h     |  7 +------
 .../gdb-remote/GDBRemoteCommunication.cpp        | 16 +++++++++++-----
 .../Process/gdb-remote/GDBRemoteCommunication.h  | 13 +++++++++++++
 .../gdb-remote/GDBRemoteClientBaseTest.cpp       | 12 ++++--------
 4 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
index af2abdf4da5cf..b47fee76a2ab5 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
@@ -10,13 +10,8 @@
 #define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECLIENTBASE_H
 
 #include "GDBRemoteCommunication.h"
-#include "lldb/Utility/Broadcaster.h"
-#include "llvm/ADT/STLFunctionalExtras.h"
-#include "llvm/ADT/StringRef.h"
-#include <chrono>
+
 #include <condition_variable>
-#include <cstdint>
-#include <mutex>
 
 namespace lldb_private {
 namespace process_gdb_remote {
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 12ae5ce467723..77eadfc8c9f6c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -7,7 +7,14 @@
 //===----------------------------------------------------------------------===//
 
 #include "GDBRemoteCommunication.h"
-#include "ProcessGDBRemoteLog.h"
+
+#include <climits>
+#include <cstring>
+#include <future>
+#include <sys/stat.h>
+
+#include "lldb/Host/Config.h"
+#include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
@@ -23,14 +30,13 @@
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/StreamString.h"
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_ZLIB
 #include "llvm/Support/ScopedPrinter.h"
-#include <climits>
-#include <cstring>
-#include <future>
-#include <sys/stat.h>
+
+#include "ProcessGDBRemoteLog.h"
 
 #if defined(__APPLE__)
 #define DEBUGSERVER_BASENAME "debugserver"
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index f51b94360d0be..107c0896c4e61 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -11,16 +11,27 @@
 
 #include "GDBRemoteCommunicationHistory.h"
 
+#include <condition_variable>
 #include <future>
 #include <mutex>
+#include <queue>
 #include <string>
+#include <vector>
+
 #include "lldb/Core/Communication.h"
+#include "lldb/Host/Config.h"
 #include "lldb/Host/HostThread.h"
 #include "lldb/Host/Socket.h"
 #include "lldb/Utility/Args.h"
+#include "lldb/Utility/Listener.h"
+#include "lldb/Utility/Predicate.h"
 #include "lldb/Utility/StringExtractorGDBRemote.h"
+#include "lldb/lldb-public.h"
 
 namespace lldb_private {
+namespace repro {
+class PacketRecorder;
+}
 namespace process_gdb_remote {
 
 enum GDBStoppointType {
@@ -151,6 +162,8 @@ class GDBRemoteCommunication : public Communication {
 
   void DumpHistory(Stream &strm);
 
+  void SetPacketRecorder(repro::PacketRecorder *recorder);
+
   static llvm::Error ConnectLocally(GDBRemoteCommunication &client,
                                     GDBRemoteCommunication &server);
 
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
index ed77e86ac3701..99d1e12359e72 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -5,20 +5,16 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
+#include <future>
 
-#include "Plugins/Process/gdb-remote/GDBRemoteClientBase.h"
 #include "GDBRemoteTestUtils.h"
+
 #include "Plugins/Process/Utility/LinuxSignals.h"
+#include "Plugins/Process/gdb-remote/GDBRemoteClientBase.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h"
 #include "lldb/Utility/GDBRemote.h"
-#include "lldb/Utility/Listener.h"
-#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/Testing/Support/Error.h"
-#include "gtest/gtest.h"
-#include <chrono>
-#include <future>
-#include <string>
-#include <vector>
 
 using namespace lldb_private::process_gdb_remote;
 using namespace lldb_private;

>From de5b099dd1542deee821b1dcfcb1762e683c672c Mon Sep 17 00:00:00 2001
From: Jan Korous <jkorous at apple.com>
Date: Fri, 11 Apr 2025 10:47:52 -0700
Subject: [PATCH 17/76] [-Wunsafe-buffer-usage][NFC] Factor out FixitUtil
 (#135100)

---
 .../clang/Analysis/Support/FixitUtil.h        |  70 ++++++
 clang/lib/Analysis/CMakeLists.txt             |   1 +
 clang/lib/Analysis/FixitUtil.cpp              | 236 ++++++++++++++++++
 clang/lib/Analysis/UnsafeBufferUsage.cpp      | 140 +----------
 4 files changed, 308 insertions(+), 139 deletions(-)
 create mode 100644 clang/include/clang/Analysis/Support/FixitUtil.h
 create mode 100644 clang/lib/Analysis/FixitUtil.cpp

diff --git a/clang/include/clang/Analysis/Support/FixitUtil.h b/clang/include/clang/Analysis/Support/FixitUtil.h
new file mode 100644
index 0000000000000..085c2255fc28f
--- /dev/null
+++ b/clang/include/clang/Analysis/Support/FixitUtil.h
@@ -0,0 +1,70 @@
+//===- FixitUtil.h ----------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_ANALYSIS_SUPPORT_FIXITUTIL_H
+#define LLVM_CLANG_ANALYSIS_SUPPORT_FIXITUTIL_H
+
+#include "clang/AST/Decl.h"
+#include "clang/AST/Expr.h"
+#include "clang/Basic/SourceLocation.h"
+#include "clang/Lex/Lexer.h"
+#include <optional>
+#include <string>
+
+namespace clang {
+
+// Returns the text of the pointee type of `T` from a `VarDecl` of a pointer
+// type. The text is obtained through from `TypeLoc`s.  Since `TypeLoc` does not
+// have source ranges of qualifiers ( The `QualTypeLoc` looks hacky too me
+// :( ), `Qualifiers` of the pointee type is returned separately through the
+// output parameter `QualifiersToAppend`.
+std::optional<std::string>
+getPointeeTypeText(const DeclaratorDecl *VD, const SourceManager &SM,
+                   const LangOptions &LangOpts,
+                   std::optional<Qualifiers> *QualifiersToAppend);
+
+// returns text of pointee to pointee (T*&)
+std::optional<std::string>
+getPointee2TypeText(const DeclaratorDecl *VD, const SourceManager &SM,
+                    const LangOptions &LangOpts,
+                    std::optional<Qualifiers> *QualifiersToAppend);
+
+SourceLocation getBeginLocOfNestedIdentifier(const DeclaratorDecl *D);
+
+// Returns the literal text in `SourceRange SR`, if `SR` is a valid range.
+std::optional<StringRef> getRangeText(SourceRange SR, const SourceManager &SM,
+                                      const LangOptions &LangOpts);
+
+// Returns the literal text of the identifier of the given variable declaration.
+std::optional<StringRef> getVarDeclIdentifierText(const DeclaratorDecl *VD,
+                                                  const SourceManager &SM,
+                                                  const LangOptions &LangOpts);
+
+// Return text representation of an `Expr`.
+std::optional<StringRef> getExprText(const Expr *E, const SourceManager &SM,
+                                     const LangOptions &LangOpts);
+
+// Return the source location just past the last character of the AST `Node`.
+template <typename NodeTy>
+std::optional<SourceLocation> getPastLoc(const NodeTy *Node,
+                                         const SourceManager &SM,
+                                         const LangOptions &LangOpts) {
+  SourceLocation Loc =
+      Lexer::getLocForEndOfToken(Node->getEndLoc(), 0, SM, LangOpts);
+  if (Loc.isValid())
+    return Loc;
+  return std::nullopt;
+}
+
+// Returns the begin location of the identifier of the given variable
+// declaration.
+SourceLocation getVarDeclIdentifierLoc(const DeclaratorDecl *VD);
+
+} // end namespace clang
+
+#endif /* LLVM_CLANG_ANALYSIS_SUPPORT_FIXITUTIL_H */
diff --git a/clang/lib/Analysis/CMakeLists.txt b/clang/lib/Analysis/CMakeLists.txt
index 7914c12d429ef..8cd3990db4c3e 100644
--- a/clang/lib/Analysis/CMakeLists.txt
+++ b/clang/lib/Analysis/CMakeLists.txt
@@ -18,6 +18,7 @@ add_clang_library(clangAnalysis
   CodeInjector.cpp
   Dominators.cpp
   ExprMutationAnalyzer.cpp
+  FixitUtil.cpp
   IntervalPartition.cpp
   IssueHash.cpp
   LiveVariables.cpp
diff --git a/clang/lib/Analysis/FixitUtil.cpp b/clang/lib/Analysis/FixitUtil.cpp
new file mode 100644
index 0000000000000..4ac3f3acd8c62
--- /dev/null
+++ b/clang/lib/Analysis/FixitUtil.cpp
@@ -0,0 +1,236 @@
+//===- FixitUtil.cpp ------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/Support/FixitUtil.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
+
+using namespace llvm;
+using namespace clang;
+using namespace ast_matchers;
+
+// Returns the text of the pointee type of `T` from a `VarDecl` of a pointer
+// type. The text is obtained through from `TypeLoc`s.  Since `TypeLoc` does not
+// have source ranges of qualifiers ( The `QualTypeLoc` looks hacky too me
+// :( ), `Qualifiers` of the pointee type is returned separately through the
+// output parameter `QualifiersToAppend`.
+std::optional<std::string>
+clang::getPointeeTypeText(const DeclaratorDecl *VD, const SourceManager &SM,
+                          const LangOptions &LangOpts,
+                          std::optional<Qualifiers> *QualifiersToAppend) {
+  QualType Ty = VD->getType();
+  QualType PteTy;
+
+  assert(Ty->isPointerType() && !Ty->isFunctionPointerType() &&
+         "Expecting a VarDecl of type of pointer to object type");
+  PteTy = Ty->getPointeeType();
+
+  TypeLoc TyLoc = VD->getTypeSourceInfo()->getTypeLoc().getUnqualifiedLoc();
+  TypeLoc PteTyLoc;
+
+  // We only deal with the cases that we know `TypeLoc::getNextTypeLoc` returns
+  // the `TypeLoc` of the pointee type:
+  switch (TyLoc.getTypeLocClass()) {
+  case TypeLoc::ConstantArray:
+  case TypeLoc::IncompleteArray:
+  case TypeLoc::VariableArray:
+  case TypeLoc::DependentSizedArray:
+  case TypeLoc::Decayed:
+    assert(isa<ParmVarDecl>(VD) && "An array type shall not be treated as a "
+                                   "pointer type unless it decays.");
+    PteTyLoc = TyLoc.getNextTypeLoc();
+    break;
+  case TypeLoc::Pointer:
+    PteTyLoc = TyLoc.castAs<PointerTypeLoc>().getPointeeLoc();
+    break;
+  default:
+    return std::nullopt;
+  }
+  if (PteTyLoc.isNull())
+    // Sometimes we cannot get a useful `TypeLoc` for the pointee type, e.g.,
+    // when the pointer type is `auto`.
+    return std::nullopt;
+
+  // TODO check
+  SourceLocation IdentLoc = VD->getLocation();
+
+  if (!(IdentLoc.isValid() && PteTyLoc.getSourceRange().isValid())) {
+    // We are expecting these locations to be valid. But in some cases, they are
+    // not all valid. It is a Clang bug to me and we are not responsible for
+    // fixing it.  So we will just give up for now when it happens.
+    return std::nullopt;
+  }
+
+  // Note that TypeLoc.getEndLoc() returns the begin location of the last token:
+  SourceLocation PteEndOfTokenLoc =
+      Lexer::getLocForEndOfToken(PteTyLoc.getEndLoc(), 0, SM, LangOpts);
+
+  if (!PteEndOfTokenLoc.isValid())
+    // Sometimes we cannot get the end location of the pointee type, e.g., when
+    // there are macros involved.
+    return std::nullopt;
+  if (!SM.isBeforeInTranslationUnit(PteEndOfTokenLoc, IdentLoc) &&
+      PteEndOfTokenLoc != IdentLoc) {
+    // We only deal with the cases where the source text of the pointee type
+    // appears on the left-hand side of the variable identifier completely,
+    // including the following forms:
+    // `T ident`,
+    // `T ident[]`, where `T` is any type.
+    // Examples of excluded cases are `T (*ident)[]` or `T ident[][n]`.
+    return std::nullopt;
+  }
+  if (PteTy.hasQualifiers()) {
+    // TypeLoc does not provide source ranges for qualifiers (it says it's
+    // intentional but seems fishy to me), so we cannot get the full text
+    // `PteTy` via source ranges.
+    *QualifiersToAppend = PteTy.getQualifiers();
+  }
+  return getRangeText({PteTyLoc.getBeginLoc(), PteEndOfTokenLoc}, SM, LangOpts)
+      ->str();
+}
+
+// returns text of pointee to pointee (T*&)
+std::optional<std::string>
+getPointee2TypeText(const DeclaratorDecl *VD, const SourceManager &SM,
+                    const LangOptions &LangOpts,
+                    std::optional<Qualifiers> *QualifiersToAppend) {
+
+  QualType Ty = VD->getType();
+  assert(Ty->isReferenceType() &&
+         "Expecting a VarDecl of reference to pointer type");
+
+  Ty = Ty->getPointeeType();
+  QualType PteTy;
+
+  assert(Ty->isPointerType() && !Ty->isFunctionPointerType() &&
+         "Expecting a VarDecl of type of pointer to object type");
+  PteTy = Ty->getPointeeType();
+
+  TypeLoc TyLoc = VD->getTypeSourceInfo()->getTypeLoc().getUnqualifiedLoc();
+  TypeLoc PtrTyLoc;
+  TypeLoc PteTyLoc;
+
+  // We only deal with the cases that we know `TypeLoc::getNextTypeLoc` returns
+  // the `TypeLoc` of the pointee type:
+  switch (TyLoc.getTypeLocClass()) {
+  case TypeLoc::ConstantArray:
+  case TypeLoc::IncompleteArray:
+  case TypeLoc::VariableArray:
+  case TypeLoc::DependentSizedArray:
+  case TypeLoc::LValueReference:
+    PtrTyLoc = TyLoc.castAs<ReferenceTypeLoc>().getPointeeLoc();
+    if (PtrTyLoc.getTypeLocClass() == TypeLoc::Pointer) {
+      PteTyLoc = PtrTyLoc.castAs<PointerTypeLoc>().getPointeeLoc();
+      break;
+    }
+    return std::nullopt;
+    break;
+  default:
+    return std::nullopt;
+  }
+  if (PteTyLoc.isNull())
+    // Sometimes we cannot get a useful `TypeLoc` for the pointee type, e.g.,
+    // when the pointer type is `auto`.
+    return std::nullopt;
+
+  // TODO make sure this works
+  SourceLocation IdentLoc = VD->getLocation();
+
+  if (!(IdentLoc.isValid() && PteTyLoc.getSourceRange().isValid())) {
+    // We are expecting these locations to be valid. But in some cases, they are
+    // not all valid. It is a Clang bug to me and we are not responsible for
+    // fixing it.  So we will just give up for now when it happens.
+    return std::nullopt;
+  }
+
+  // Note that TypeLoc.getEndLoc() returns the begin location of the last token:
+  SourceLocation PteEndOfTokenLoc =
+      Lexer::getLocForEndOfToken(PteTyLoc.getEndLoc(), 0, SM, LangOpts);
+
+  if (!PteEndOfTokenLoc.isValid())
+    // Sometimes we cannot get the end location of the pointee type, e.g., when
+    // there are macros involved.
+    return std::nullopt;
+  if (!SM.isBeforeInTranslationUnit(PteEndOfTokenLoc, IdentLoc)) {
+    // We only deal with the cases where the source text of the pointee type
+    // appears on the left-hand side of the variable identifier completely,
+    // including the following forms:
+    // `T ident`,
+    // `T ident[]`, where `T` is any type.
+    // Examples of excluded cases are `T (*ident)[]` or `T ident[][n]`.
+    return std::nullopt;
+  }
+  if (PteTy.hasQualifiers()) {
+    // TypeLoc does not provide source ranges for qualifiers (it says it's
+    // intentional but seems fishy to me), so we cannot get the full text
+    // `PteTy` via source ranges.
+    *QualifiersToAppend = PteTy.getQualifiers();
+  }
+  return getRangeText({PteTyLoc.getBeginLoc(), PteEndOfTokenLoc}, SM, LangOpts)
+      ->str();
+}
+
+SourceLocation clang::getBeginLocOfNestedIdentifier(const DeclaratorDecl *D) {
+  if (D->getQualifier()) {
+    return D->getQualifierLoc().getBeginLoc();
+  }
+  return getVarDeclIdentifierLoc(D);
+}
+
+// Returns the literal text in `SourceRange SR`, if `SR` is a valid range.
+std::optional<StringRef> clang::getRangeText(SourceRange SR,
+                                             const SourceManager &SM,
+                                             const LangOptions &LangOpts) {
+  bool Invalid = false;
+  CharSourceRange CSR = CharSourceRange::getCharRange(SR);
+  StringRef Text = Lexer::getSourceText(CSR, SM, LangOpts, &Invalid);
+
+  if (!Invalid)
+    return Text;
+  return std::nullopt;
+}
+
+// Returns the literal text of the identifier of the given variable declaration.
+std::optional<StringRef>
+clang::getVarDeclIdentifierText(const DeclaratorDecl *VD,
+                                const SourceManager &SM,
+                                const LangOptions &LangOpts) {
+  SourceLocation ParmIdentBeginLoc = getBeginLocOfNestedIdentifier(VD);
+  SourceLocation ParmIdentEndLoc =
+      Lexer::getLocForEndOfToken(getVarDeclIdentifierLoc(VD), 0, SM, LangOpts);
+
+  if (VD->getQualifier()) {
+    ParmIdentBeginLoc = VD->getQualifierLoc().getBeginLoc();
+  }
+
+  if (ParmIdentEndLoc.isMacroID() &&
+      !Lexer::isAtEndOfMacroExpansion(ParmIdentEndLoc, SM, LangOpts))
+    return std::nullopt;
+  return getRangeText({ParmIdentBeginLoc, ParmIdentEndLoc}, SM, LangOpts);
+}
+
+// Return text representation of an `Expr`.
+std::optional<StringRef> clang::getExprText(const Expr *E,
+                                            const SourceManager &SM,
+                                            const LangOptions &LangOpts) {
+  std::optional<SourceLocation> LastCharLoc = getPastLoc(E, SM, LangOpts);
+
+  if (LastCharLoc)
+    return Lexer::getSourceText(
+        CharSourceRange::getCharRange(E->getBeginLoc(), *LastCharLoc), SM,
+        LangOpts);
+
+  return std::nullopt;
+}
+
+// Returns the begin location of the identifier of the given variable
+// declaration.
+SourceLocation clang::getVarDeclIdentifierLoc(const DeclaratorDecl *VD) {
+  // According to the implementation of `VarDecl`, `VD->getLocation()` actually
+  // returns the begin location of the identifier of the declaration:
+  return VD->getLocation();
+}
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index fbe753de9ef1f..0dbb683729427 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -21,6 +21,7 @@
 #include "clang/AST/StmtVisitor.h"
 #include "clang/AST/Type.h"
 #include "clang/ASTMatchers/LowLevelHelpers.h"
+#include "clang/Analysis/Support/FixitUtil.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Lex/Lexer.h"
 #include "clang/Lex/Preprocessor.h"
@@ -2719,67 +2720,6 @@ getEndCharLoc(const NodeTy *Node, const SourceManager &SM,
   return std::nullopt;
 }
 
-// Return the source location just past the last character of the AST `Node`.
-template <typename NodeTy>
-static std::optional<SourceLocation> getPastLoc(const NodeTy *Node,
-                                                const SourceManager &SM,
-                                                const LangOptions &LangOpts) {
-  SourceLocation Loc =
-      Lexer::getLocForEndOfToken(Node->getEndLoc(), 0, SM, LangOpts);
-  if (Loc.isValid())
-    return Loc;
-  return std::nullopt;
-}
-
-// Return text representation of an `Expr`.
-static std::optional<StringRef> getExprText(const Expr *E,
-                                            const SourceManager &SM,
-                                            const LangOptions &LangOpts) {
-  std::optional<SourceLocation> LastCharLoc = getPastLoc(E, SM, LangOpts);
-
-  if (LastCharLoc)
-    return Lexer::getSourceText(
-        CharSourceRange::getCharRange(E->getBeginLoc(), *LastCharLoc), SM,
-        LangOpts);
-
-  return std::nullopt;
-}
-
-// Returns the literal text in `SourceRange SR`, if `SR` is a valid range.
-static std::optional<StringRef> getRangeText(SourceRange SR,
-                                             const SourceManager &SM,
-                                             const LangOptions &LangOpts) {
-  bool Invalid = false;
-  CharSourceRange CSR = CharSourceRange::getCharRange(SR);
-  StringRef Text = Lexer::getSourceText(CSR, SM, LangOpts, &Invalid);
-
-  if (!Invalid)
-    return Text;
-  return std::nullopt;
-}
-
-// Returns the begin location of the identifier of the given variable
-// declaration.
-static SourceLocation getVarDeclIdentifierLoc(const VarDecl *VD) {
-  // According to the implementation of `VarDecl`, `VD->getLocation()` actually
-  // returns the begin location of the identifier of the declaration:
-  return VD->getLocation();
-}
-
-// Returns the literal text of the identifier of the given variable declaration.
-static std::optional<StringRef>
-getVarDeclIdentifierText(const VarDecl *VD, const SourceManager &SM,
-                         const LangOptions &LangOpts) {
-  SourceLocation ParmIdentBeginLoc = getVarDeclIdentifierLoc(VD);
-  SourceLocation ParmIdentEndLoc =
-      Lexer::getLocForEndOfToken(ParmIdentBeginLoc, 0, SM, LangOpts);
-
-  if (ParmIdentEndLoc.isMacroID() &&
-      !Lexer::isAtEndOfMacroExpansion(ParmIdentEndLoc, SM, LangOpts))
-    return std::nullopt;
-  return getRangeText({ParmIdentBeginLoc, ParmIdentEndLoc}, SM, LangOpts);
-}
-
 // We cannot fix a variable declaration if it has some other specifiers than the
 // type specifier.  Because the source ranges of those specifiers could overlap
 // with the source range that is being replaced using fix-its.  Especially when
@@ -2817,84 +2757,6 @@ static SourceRange getSourceRangeToTokenEnd(const Decl *D,
   return SourceRange(Begin, End);
 }
 
-// Returns the text of the pointee type of `T` from a `VarDecl` of a pointer
-// type. The text is obtained through from `TypeLoc`s.  Since `TypeLoc` does not
-// have source ranges of qualifiers ( The `QualifiedTypeLoc` looks hacky too me
-// :( ), `Qualifiers` of the pointee type is returned separately through the
-// output parameter `QualifiersToAppend`.
-static std::optional<std::string>
-getPointeeTypeText(const VarDecl *VD, const SourceManager &SM,
-                   const LangOptions &LangOpts,
-                   std::optional<Qualifiers> *QualifiersToAppend) {
-  QualType Ty = VD->getType();
-  QualType PteTy;
-
-  assert(Ty->isPointerType() && !Ty->isFunctionPointerType() &&
-         "Expecting a VarDecl of type of pointer to object type");
-  PteTy = Ty->getPointeeType();
-
-  TypeLoc TyLoc = VD->getTypeSourceInfo()->getTypeLoc().getUnqualifiedLoc();
-  TypeLoc PteTyLoc;
-
-  // We only deal with the cases that we know `TypeLoc::getNextTypeLoc` returns
-  // the `TypeLoc` of the pointee type:
-  switch (TyLoc.getTypeLocClass()) {
-  case TypeLoc::ConstantArray:
-  case TypeLoc::IncompleteArray:
-  case TypeLoc::VariableArray:
-  case TypeLoc::DependentSizedArray:
-  case TypeLoc::Decayed:
-    assert(isa<ParmVarDecl>(VD) && "An array type shall not be treated as a "
-                                   "pointer type unless it decays.");
-    PteTyLoc = TyLoc.getNextTypeLoc();
-    break;
-  case TypeLoc::Pointer:
-    PteTyLoc = TyLoc.castAs<PointerTypeLoc>().getPointeeLoc();
-    break;
-  default:
-    return std::nullopt;
-  }
-  if (PteTyLoc.isNull())
-    // Sometimes we cannot get a useful `TypeLoc` for the pointee type, e.g.,
-    // when the pointer type is `auto`.
-    return std::nullopt;
-
-  SourceLocation IdentLoc = getVarDeclIdentifierLoc(VD);
-
-  if (!(IdentLoc.isValid() && PteTyLoc.getSourceRange().isValid())) {
-    // We are expecting these locations to be valid. But in some cases, they are
-    // not all valid. It is a Clang bug to me and we are not responsible for
-    // fixing it.  So we will just give up for now when it happens.
-    return std::nullopt;
-  }
-
-  // Note that TypeLoc.getEndLoc() returns the begin location of the last token:
-  SourceLocation PteEndOfTokenLoc =
-      Lexer::getLocForEndOfToken(PteTyLoc.getEndLoc(), 0, SM, LangOpts);
-
-  if (!PteEndOfTokenLoc.isValid())
-    // Sometimes we cannot get the end location of the pointee type, e.g., when
-    // there are macros involved.
-    return std::nullopt;
-  if (!SM.isBeforeInTranslationUnit(PteEndOfTokenLoc, IdentLoc)) {
-    // We only deal with the cases where the source text of the pointee type
-    // appears on the left-hand side of the variable identifier completely,
-    // including the following forms:
-    // `T ident`,
-    // `T ident[]`, where `T` is any type.
-    // Examples of excluded cases are `T (*ident)[]` or `T ident[][n]`.
-    return std::nullopt;
-  }
-  if (PteTy.hasQualifiers()) {
-    // TypeLoc does not provide source ranges for qualifiers (it says it's
-    // intentional but seems fishy to me), so we cannot get the full text
-    // `PteTy` via source ranges.
-    *QualifiersToAppend = PteTy.getQualifiers();
-  }
-  return getRangeText({PteTyLoc.getBeginLoc(), PteEndOfTokenLoc}, SM, LangOpts)
-      ->str();
-}
-
 // Returns the text of the name (with qualifiers) of a `FunctionDecl`.
 static std::optional<StringRef> getFunNameText(const FunctionDecl *FD,
                                                const SourceManager &SM,

>From cb974dcd7798317f065fe0668e16d0e1712e5ca0 Mon Sep 17 00:00:00 2001
From: LLVM GN Syncbot <llvmgnsyncbot at gmail.com>
Date: Fri, 11 Apr 2025 17:48:57 +0000
Subject: [PATCH 18/76] [gn build] Port de5b099dd154

---
 llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn
index 554aad7431c19..eb8aef259bfd2 100644
--- a/llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/lib/Analysis/BUILD.gn
@@ -24,6 +24,7 @@ static_library("Analysis") {
     "Consumed.cpp",
     "Dominators.cpp",
     "ExprMutationAnalyzer.cpp",
+    "FixitUtil.cpp",
     "IntervalPartition.cpp",
     "IssueHash.cpp",
     "LiveVariables.cpp",

>From abe3b90b3fa49829a165f2174191c33542597052 Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Fri, 11 Apr 2025 10:57:08 -0700
Subject: [PATCH 19/76] [CIR] Fix warnings, again! (#135284)

The calleeDecl var will be used in the near future, so I left it. At
least for clang, the [[maybe_unused]] attribute takes care of the
warnings related to that variable. The other warning was a simple lack
of return after errorNYI.
---
 clang/lib/CIR/CodeGen/CIRGenFunction.h | 2 +-
 clang/lib/CIR/CodeGen/CIRGenModule.cpp | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h
index 8082592598c19..a96d277d0bc0b 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.h
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h
@@ -164,7 +164,7 @@ class CIRGenFunction : public CIRGenTypeCache {
   /// An abstract representation of regular/ObjC call/message targets.
   class AbstractCallee {
     /// The function declaration of the callee.
-    const clang::Decl *calleeDecl;
+    [[maybe_unused]] const clang::Decl *calleeDecl;
 
   public:
     AbstractCallee() : calleeDecl(nullptr) {}
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 4b5acb36a9319..fd11523ebba61 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -262,6 +262,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
   }
 
   errorNYI(d->getSourceRange(), "reference of undeclared global");
+  return {};
 }
 
 cir::GlobalOp

>From a2d129b792cc49224f98c83d2279b2e19bfa700f Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Fri, 11 Apr 2025 10:53:48 -0700
Subject: [PATCH 20/76] [SLP]Fix a crash when trying to reduce in revec after
 minbitwidth analysis

Need to use the original scalar type, when building the reduction, and
use the scalar type, when performing casting, to avoid compiler crash.
---
 .../Transforms/Vectorize/SLPVectorizer.cpp    |  6 +--
 .../SLPVectorizer/SystemZ/revec-fix-128169.ll | 37 ++++++++++++++++++-
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index c854821417c96..b7ee5bfc310d9 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -22141,8 +22141,8 @@ class HorizontalReduction {
         if (isa<FixedVectorType>(ScalarTy)) {
           assert(SLPReVec && "FixedVectorType is not expected.");
           unsigned ScalarTyNumElements = getNumElements(ScalarTy);
-          Value *ReducedSubTree = PoisonValue::get(getWidenedType(
-              VectorizedRoot->getType()->getScalarType(), ScalarTyNumElements));
+          Value *ReducedSubTree = PoisonValue::get(
+              getWidenedType(ScalarTy->getScalarType(), ScalarTyNumElements));
           for (unsigned I : seq<unsigned>(ScalarTyNumElements)) {
             // Do reduction for each lane.
             // e.g., do reduce add for
@@ -22359,7 +22359,7 @@ class HorizontalReduction {
                         Type *DestTy) {
     Value *Rdx = emitReduction(Vec, Builder, &TTI, DestTy);
     if (Rdx->getType() != DestTy->getScalarType())
-      Rdx = Builder.CreateIntCast(Rdx, DestTy, IsSigned);
+      Rdx = Builder.CreateIntCast(Rdx, DestTy->getScalarType(), IsSigned);
     // Improved analysis for add/fadd/xor reductions with same scale
     // factor for all operands of reductions. We can emit scalar ops for
     // them instead.
diff --git a/llvm/test/Transforms/SLPVectorizer/SystemZ/revec-fix-128169.ll b/llvm/test/Transforms/SLPVectorizer/SystemZ/revec-fix-128169.ll
index 5320c6b9cb873..b9f35451b02ae 100644
--- a/llvm/test/Transforms/SLPVectorizer/SystemZ/revec-fix-128169.ll
+++ b/llvm/test/Transforms/SLPVectorizer/SystemZ/revec-fix-128169.ll
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -mtriple=s390x-unknown-linux-gnu -mcpu=z17 -passes=slp-vectorizer -S -slp-revec %s | FileCheck %s
+; RUN: opt -mtriple=s390x-unknown-linux-gnu -mcpu=z17 -passes=slp-vectorizer -S -slp-revec < %s | FileCheck %s
+; RUN: opt -mtriple=s390x-unknown-linux-gnu -mcpu=z17 -passes=slp-vectorizer -S -slp-revec -slp-threshold=-1000 < %s | FileCheck %s --check-prefix=THRESH
 
 define void @e(<4 x i16> %0) {
 ; CHECK-LABEL: @e(
@@ -22,6 +23,40 @@ define void @e(<4 x i16> %0) {
 ; CHECK-NEXT:    [[TMP12]] = or <4 x i32> [[TMP9]], [[TMP11]]
 ; CHECK-NEXT:    br label [[VECTOR_BODY]]
 ;
+; THRESH-LABEL: @e(
+; THRESH-NEXT:  entry:
+; THRESH-NEXT:    [[TMP1:%.*]] = call <8 x i16> @llvm.vector.insert.v8i16.v4i16(<8 x i16> poison, <4 x i16> zeroinitializer, i64 0)
+; THRESH-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.vector.insert.v8i16.v4i16(<8 x i16> [[TMP1]], <4 x i16> zeroinitializer, i64 4)
+; THRESH-NEXT:    [[TMP3:%.*]] = call <8 x i16> @llvm.vector.insert.v8i16.v4i16(<8 x i16> poison, <4 x i16> zeroinitializer, i64 4)
+; THRESH-NEXT:    [[TMP4:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v4i16(<16 x i16> poison, <4 x i16> zeroinitializer, i64 0)
+; THRESH-NEXT:    [[TMP5:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v4i16(<16 x i16> [[TMP4]], <4 x i16> zeroinitializer, i64 4)
+; THRESH-NEXT:    [[TMP6:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v4i16(<16 x i16> [[TMP5]], <4 x i16> zeroinitializer, i64 8)
+; THRESH-NEXT:    [[TMP7:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v4i16(<16 x i16> [[TMP6]], <4 x i16> zeroinitializer, i64 12)
+; THRESH-NEXT:    br label [[VECTOR_BODY:%.*]]
+; THRESH:       vector.body:
+; THRESH-NEXT:    [[VEC_IND:%.*]] = phi <4 x i16> [ zeroinitializer, [[ENTRY:%.*]] ], [ zeroinitializer, [[VECTOR_BODY]] ]
+; THRESH-NEXT:    [[VEC_PHI:%.*]] = phi <4 x i32> [ zeroinitializer, [[ENTRY]] ], [ [[TMP26:%.*]], [[VECTOR_BODY]] ]
+; THRESH-NEXT:    [[TMP8:%.*]] = call <8 x i16> @llvm.vector.insert.v8i16.v4i16(<8 x i16> [[TMP3]], <4 x i16> [[VEC_IND]], i64 0)
+; THRESH-NEXT:    [[TMP9:%.*]] = add <8 x i16> [[TMP2]], [[TMP8]]
+; THRESH-NEXT:    [[TMP10:%.*]] = shufflevector <8 x i16> [[TMP8]], <8 x i16> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
+; THRESH-NEXT:    [[TMP11:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v4i16(<16 x i16> [[TMP10]], <4 x i16> [[TMP0:%.*]], i64 4)
+; THRESH-NEXT:    [[TMP12:%.*]] = call <16 x i16> @llvm.vector.insert.v16i16.v8i16(<16 x i16> [[TMP11]], <8 x i16> [[TMP9]], i64 8)
+; THRESH-NEXT:    [[TMP13:%.*]] = icmp sgt <16 x i16> [[TMP12]], [[TMP7]]
+; THRESH-NEXT:    [[TMP14:%.*]] = shufflevector <16 x i1> [[TMP13]], <16 x i1> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
+; THRESH-NEXT:    [[TMP15:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP14]])
+; THRESH-NEXT:    [[TMP16:%.*]] = shufflevector <16 x i1> [[TMP13]], <16 x i1> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
+; THRESH-NEXT:    [[TMP17:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP16]])
+; THRESH-NEXT:    [[TMP18:%.*]] = shufflevector <16 x i1> [[TMP13]], <16 x i1> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
+; THRESH-NEXT:    [[TMP19:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP18]])
+; THRESH-NEXT:    [[TMP20:%.*]] = shufflevector <16 x i1> [[TMP13]], <16 x i1> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
+; THRESH-NEXT:    [[TMP21:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP20]])
+; THRESH-NEXT:    [[TMP22:%.*]] = insertelement <4 x i1> poison, i1 [[TMP15]], i32 0
+; THRESH-NEXT:    [[TMP23:%.*]] = insertelement <4 x i1> [[TMP22]], i1 [[TMP17]], i32 1
+; THRESH-NEXT:    [[TMP24:%.*]] = insertelement <4 x i1> [[TMP23]], i1 [[TMP19]], i32 2
+; THRESH-NEXT:    [[TMP25:%.*]] = insertelement <4 x i1> [[TMP24]], i1 [[TMP21]], i32 3
+; THRESH-NEXT:    [[TMP26]] = zext <4 x i1> [[TMP25]] to <4 x i32>
+; THRESH-NEXT:    br label [[VECTOR_BODY]]
+;
 entry:
   br label %vector.body
 

>From e911f90a4035ee6a70d9b608ef35c6870aa86fdb Mon Sep 17 00:00:00 2001
From: Kevin Gleason <gleasonk at google.com>
Date: Fri, 11 Apr 2025 13:00:47 -0500
Subject: [PATCH 21/76] [mlir] Add support for broader range of input files in
 generate-test-checks.py (#134327)

A few additions:

- Lines with `{{`: These can show up if serializing non-MLIR info into
string attrs `my.attr = {{proto}, {...}}`. String escape the opening
`{{`, given that check lines are generated this has no effect on
`{{.*}}` etc in generated lines.
- File split line: Normally these are skipped because of their indent
level, but if using `--starts_from_scope=0` to generate checks for the
`module {...} {` line, and since MLIR opt tools emit file split lines by
default, some `CHECK: // -----` lines were emit.
- (edit removed this, fixed by
https://github.com/llvm/llvm-project/pull/134364) AttrAliases: I'm not
sure if I'm missing something for the attribute parser to work
correctly, but I was getting many `#[[?]]` for all dialect attrs. Only
use the attr aliasing if there's a match.
---
 mlir/utils/generate-test-checks.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py
index 07440990a58d7..394ef7e0f7da0 100755
--- a/mlir/utils/generate-test-checks.py
+++ b/mlir/utils/generate-test-checks.py
@@ -236,9 +236,13 @@ def process_attribute_references(line, attribute_namer):
 # Pre-process a line of input to remove any character sequences that will be
 # problematic with FileCheck.
 def preprocess_line(line):
+    # Replace any `{{` with escaped replacements. `{{` corresponds to regex
+    # checks in FileCheck.
+    output_line = line.replace("{{", "{{\\{\\{}}")
+
     # Replace any double brackets, '[[' with escaped replacements. '[['
     # corresponds to variable names in FileCheck.
-    output_line = line.replace("[[", "{{\\[\\[}}")
+    output_line = output_line.replace("[[", "{{\\[\\[}}")
 
     # Replace any single brackets that are followed by an SSA identifier, the
     # identifier will be replace by a variable; Creating the same situation as
@@ -327,6 +331,11 @@ def main():
         if not input_line:
             continue
 
+        # When using `--starts_from_scope=0` to capture module lines, the file
+        # split needs to be skipped, otherwise a `CHECK: // -----` is inserted.
+        if input_line.startswith("// -----"):
+            continue
+
         # Check if this is an attribute definition and process it
         process_attribute_definition(input_line, attribute_namer, output)
 

>From e15025dd50ce2f3db6c8f3f414f95a7b58ef8501 Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Fri, 11 Apr 2025 18:41:50 +0200
Subject: [PATCH 22/76] [libc++] Another Apple CI quick-fix.

Like #135202 this fixes another issue after the XCode update.
---
 libcxxabi/test/uncaught_exception.pass.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libcxxabi/test/uncaught_exception.pass.cpp b/libcxxabi/test/uncaught_exception.pass.cpp
index cace88a309d0b..8e8468c43240d 100644
--- a/libcxxabi/test/uncaught_exception.pass.cpp
+++ b/libcxxabi/test/uncaught_exception.pass.cpp
@@ -6,6 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+// TODO(mordante) Investigate
+// UNSUPPORTED: apple-clang
+
 // UNSUPPORTED: no-exceptions
 
 // This tests that libc++abi still provides __cxa_uncaught_exception() for

>From c9ad5bed7fa9ff0b16da1212875ba5341d288f3c Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Fri, 11 Apr 2025 11:08:49 -0700
Subject: [PATCH 23/76] [SLP][NFC]Add a test with the incorrect type promotion
 after bitwidth analysis, NFC

---
 .../trunced-buildvector-scalar-extended.ll    | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll

diff --git a/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll b/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll
new file mode 100644
index 0000000000000..29aed14dc3ffc
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll
@@ -0,0 +1,43 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+
+define <4 x float> @test(i64 %0) {
+; CHECK-LABEL: define <4 x float> @test(
+; CHECK-SAME: i64 [[TMP0:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <4 x i32> <i32 0, i32 0, i32 poison, i32 0>, i32 [[TMP1]], i32 2
+; CHECK-NEXT:    [[TMP3:%.*]] = sext <4 x i32> [[TMP2]] to <4 x i64>
+; CHECK-NEXT:    [[TMP4:%.*]] = sitofp <4 x i64> [[TMP3]] to <4 x float>
+; CHECK-NEXT:    [[TMP5:%.*]] = sitofp <4 x i32> [[TMP2]] to <4 x float>
+; CHECK-NEXT:    [[TMP6:%.*]] = fadd <4 x float> [[TMP4]], [[TMP5]]
+; CHECK-NEXT:    [[TMP7:%.*]] = fcmp ogt <4 x float> [[TMP6]], zeroinitializer
+; CHECK-NEXT:    ret <4 x float> [[TMP6]]
+;
+entry:
+  %1 = trunc i64 0 to i32
+  %2 = sitofp i32 %1 to float
+  %3 = sitofp i64 0 to float
+  %4 = fadd float %3, %2
+  %to_max.i = fcmp ogt float %4, 0.000000e+00
+  %5 = trunc i64 0 to i32
+  %6 = sitofp i32 %5 to float
+  %7 = sitofp i64 0 to float
+  %8 = fadd float %7, %6
+  %to_max.i.1 = fcmp ogt float %8, 0.000000e+00
+  %9 = trunc i64 %0 to i32
+  %10 = sitofp i32 %9 to float
+  %11 = sitofp i64 %0 to float
+  %12 = fadd float %11, %10
+  %to_max.i.2 = fcmp ogt float %12, 0.000000e+00
+  %13 = trunc i64 0 to i32
+  %14 = sitofp i32 %13 to float
+  %15 = sitofp i64 0 to float
+  %16 = fadd float %15, %14
+  %to_max.i.3 = fcmp ogt float %16, 0.000000e+00
+  %r0 = insertelement <4 x float> poison, float %4, i32 0
+  %r1 = insertelement <4 x float> %r0, float %8, i32 1
+  %r2 = insertelement <4 x float> %r1, float %12, i32 2
+  %r3 = insertelement <4 x float> %r2, float %16, i32 3
+  ret <4 x float> %r3
+}

>From 1e54bca669d0f16fbd0809d5ada68af8ba5cf28b Mon Sep 17 00:00:00 2001
From: Daniel Thornburgh <dthorn at google.com>
Date: Fri, 11 Apr 2025 11:19:43 -0700
Subject: [PATCH 24/76] [libc] Add dthorn as maintainer for allocator on
 baremetal (#135203)

This was on request from other maintainers, given that I've been
de-facto acting as maintainer of the baremetal allocator stuff.
---
 libc/Maintainers.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libc/Maintainers.rst b/libc/Maintainers.rst
index 8f3c251a0edb1..57a6a0ce0c9d1 100644
--- a/libc/Maintainers.rst
+++ b/libc/Maintainers.rst
@@ -22,6 +22,11 @@ Baremetal
 | Petr Hosek
 | phosek\@google.com (email), `petrhosek <https://github.com/petrhosek>`_ (github)
 
+Baremetal (Allocator)
+---------------------
+| Daniel Thornburgh
+| dthorn\@google.com (email), `mysterymath <https://github.com/mysterymath>`_ (github)
+
 Fixed Point
 -----------
 | Leonard Chan

>From df579ce4b6006ed23bb3a31f009269a1ba2587d4 Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Fri, 11 Apr 2025 20:27:29 +0200
Subject: [PATCH 25/76] [libc++] Adds is_implemented function for new ftm
 generator. (#134538)

At the moment the ftm macro for __cpp_lib_to_chars will have the
following values:

standard_ftms: {
    "c++17": "201611L",
    "c++20": "201611L",
    "c++23": "201611L",
    "c++26": "201611L",
}

implemented_ftms: {
    "c++17": None,
}

This is an issue with the test whether the FTM is implemented it does:
  self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
This will fail in C++20 since implemented_ftms[ftm] does not have the
key c++20. This adds a new helper function and removes the None entries
when a FTM is not implemented.

---------

Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
---
 .../feature_test_macro/implemented_ftms.sh.py | 12 +-----
 .../feature_test_macro/is_implemented.sh.py   | 39 +++++++++++++++++++
 .../generate_feature_test_macro_components.py | 17 +++++++-
 3 files changed, 56 insertions(+), 12 deletions(-)
 create mode 100644 libcxx/test/libcxx/feature_test_macro/is_implemented.sh.py

diff --git a/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py b/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py
index 92e14757ddd49..4f445d55c883c 100644
--- a/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py
+++ b/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py
@@ -38,11 +38,7 @@ def test_implementation(self):
                 "c++23": "201907L",
                 "c++26": "299900L",
             },
-            "__cpp_lib_format": {
-                "c++20": None,
-                "c++23": None,
-                "c++26": None,
-            },
+            "__cpp_lib_format": {},
             "__cpp_lib_parallel_algorithm": {
                 "c++17": "201603L",
                 "c++20": "201603L",
@@ -55,11 +51,7 @@ def test_implementation(self):
                 "c++23": "202102L",
                 "c++26": "202102L",
             },
-            "__cpp_lib_missing_FTM_in_older_standard": {
-                "c++17": None,
-                "c++20": None,
-                "c++26": None,
-            },
+            "__cpp_lib_missing_FTM_in_older_standard": {},
         }
 
         self.assertEqual(self.ftm.implemented_ftms, expected)
diff --git a/libcxx/test/libcxx/feature_test_macro/is_implemented.sh.py b/libcxx/test/libcxx/feature_test_macro/is_implemented.sh.py
new file mode 100644
index 0000000000000..0414722b89a76
--- /dev/null
+++ b/libcxx/test/libcxx/feature_test_macro/is_implemented.sh.py
@@ -0,0 +1,39 @@
+# ===----------------------------------------------------------------------===##
+#
+# 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
+#
+# ===----------------------------------------------------------------------===##
+
+# RUN: %{python} %s %{libcxx-dir}/utils %{libcxx-dir}/test/libcxx/feature_test_macro/test_data.json
+
+import sys
+import unittest
+
+UTILS = sys.argv[1]
+TEST_DATA = sys.argv[2]
+del sys.argv[1:3]
+
+sys.path.append(UTILS)
+from generate_feature_test_macro_components import FeatureTestMacros, Metadata
+
+
+class Test(unittest.TestCase):
+    def setUp(self):
+        self.ftm = FeatureTestMacros(TEST_DATA)
+        self.maxDiff = None  # This causes the diff to be printed when the test fails
+
+    def test_implementation(self):
+        # FTM not available in C++14.
+        self.assertEqual(self.ftm.is_implemented("__cpp_lib_any", "c++14"), False)
+        self.assertEqual(self.ftm.is_implemented("__cpp_lib_any", "c++17"), True)
+
+        self.assertEqual(self.ftm.is_implemented("__cpp_lib_format", "c++20"), False)
+
+        # FTM C++20 202106L, libc++ has 202102L
+        self.assertEqual(self.ftm.is_implemented("__cpp_lib_variant", "c++20"), False)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index c627f6b6bde99..f16841eed9e96 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -2011,7 +2011,8 @@ def get_ftms(
                         else:
                             break
 
-                entry[std] = last
+                if last:
+                    entry[std] = last
         result[feature["name"]] = entry
 
     return result
@@ -2207,6 +2208,18 @@ def implemented_ftms(self) -> Dict[Ftm, Dict[Std, Optional[Value]]]:
 
         return get_ftms(self.__data, self.std_dialects, True)
 
+    def is_implemented(self, ftm: Ftm, std: Std) -> bool:
+        """Has the FTM `ftm` been implemented in the dialect `std`?"""
+
+        # When a paper for C++20 has not been implemented in libc++, then there will be no
+        # FTM entry in implemented_ftms for C++23 and later. Similarly, a paper like <format>
+        # has no entry in standard_ftms for e.g. C++11.
+        if not std in self.implemented_ftms[ftm].keys() or not std in self.standard_ftms[ftm].keys():
+            return False
+
+        return self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
+
+
     @functools.cached_property
     def ftm_metadata(self) -> Dict[Ftm, Metadata]:
         """Returns the metadata of the FTMs defined in the Standard.
@@ -2240,7 +2253,7 @@ def version_header_implementation(self) -> Dict[Std, Dict[Ftm, VersionHeader]]:
                     continue
                 last_value = value
 
-                implemented = self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
+                implemented = self.is_implemented(ftm, std)
                 entry = VersionHeader(
                     value,
                     implemented,

>From 6f5e993b179a6f93b40d375a8864f2a482f3ca5d Mon Sep 17 00:00:00 2001
From: Farzon Lotfi <farzonlotfi at microsoft.com>
Date: Fri, 11 Apr 2025 14:32:44 -0400
Subject: [PATCH 26/76] [DirectX] legalize usub.sat (#135288)

fixes #135285

This change implements the `usub.sat` intrinsic to perform an unsigned
saturating subtraction on the 2 arguments.
The minimum value this operation is clamp to is 0.
---
 .../Target/DirectX/DXILIntrinsicExpansion.cpp | 18 ++++++
 llvm/test/CodeGen/DirectX/usub_sat.ll         | 60 +++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 llvm/test/CodeGen/DirectX/usub_sat.ll

diff --git a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
index 84acf4d536d0c..70f284e08b250 100644
--- a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
+++ b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
@@ -65,12 +65,27 @@ static bool isIntrinsicExpansion(Function &F) {
   case Intrinsic::dx_sign:
   case Intrinsic::dx_step:
   case Intrinsic::dx_radians:
+  case Intrinsic::usub_sat:
   case Intrinsic::vector_reduce_add:
   case Intrinsic::vector_reduce_fadd:
     return true;
   }
   return false;
 }
+
+static Value *expandUsubSat(CallInst *Orig) {
+  Value *A = Orig->getArgOperand(0);
+  Value *B = Orig->getArgOperand(1);
+  Type *Ty = A->getType();
+
+  IRBuilder<> Builder(Orig);
+
+  Value *Cmp = Builder.CreateICmpULT(A, B, "usub.cmp");
+  Value *Sub = Builder.CreateSub(A, B, "usub.sub");
+  Value *Zero = ConstantInt::get(Ty, 0);
+  return Builder.CreateSelect(Cmp, Zero, Sub, "usub.sat");
+}
+
 static Value *expandVecReduceAdd(CallInst *Orig, Intrinsic::ID IntrinsicId) {
   assert(IntrinsicId == Intrinsic::vector_reduce_add ||
          IntrinsicId == Intrinsic::vector_reduce_fadd);
@@ -586,6 +601,9 @@ static bool expandIntrinsic(Function &F, CallInst *Orig) {
   case Intrinsic::dx_radians:
     Result = expandRadiansIntrinsic(Orig);
     break;
+  case Intrinsic::usub_sat:
+    Result = expandUsubSat(Orig);
+    break;
   case Intrinsic::vector_reduce_add:
   case Intrinsic::vector_reduce_fadd:
     Result = expandVecReduceAdd(Orig, IntrinsicId);
diff --git a/llvm/test/CodeGen/DirectX/usub_sat.ll b/llvm/test/CodeGen/DirectX/usub_sat.ll
new file mode 100644
index 0000000000000..8cfb1a1fe9bd1
--- /dev/null
+++ b/llvm/test/CodeGen/DirectX/usub_sat.ll
@@ -0,0 +1,60 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S  -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; Make sure dxil operation function calls for pow are generated.
+
+define noundef i16 @usub_sat_i16(i16 noundef %a, i16 noundef %b) {
+; CHECK-LABEL: define noundef i16 @usub_sat_i16(
+; CHECK-SAME: i16 noundef [[A:%.*]], i16 noundef [[B:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[USUB_CMP:%.*]] = icmp ult i16 [[A]], [[B]]
+; CHECK-NEXT:    [[USUB_SUB:%.*]] = sub i16 [[A]], [[B]]
+; CHECK-NEXT:    [[ELT_USUB_SAT:%.*]] = select i1 [[USUB_CMP]], i16 0, i16 [[USUB_SUB]]
+; CHECK-NEXT:    ret i16 [[ELT_USUB_SAT]]
+;
+entry:
+  %elt.usub_sat = call i16 @llvm.usub.sat.i16(i16 %a, i16 %b)
+  ret i16 %elt.usub_sat
+}
+
+define noundef i32 @usub_sat_i32(i32 noundef %a, i32 noundef %b) {
+; CHECK-LABEL: define noundef i32 @usub_sat_i32(
+; CHECK-SAME: i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[USUB_CMP:%.*]] = icmp ult i32 [[A]], [[B]]
+; CHECK-NEXT:    [[USUB_SUB:%.*]] = sub i32 [[A]], [[B]]
+; CHECK-NEXT:    [[ELT_USUB_SAT:%.*]] = select i1 [[USUB_CMP]], i32 0, i32 [[USUB_SUB]]
+; CHECK-NEXT:    ret i32 [[ELT_USUB_SAT]]
+;
+entry:
+  %elt.usub_sat = call i32 @llvm.usub.sat.i32(i32 %a, i32 %b)
+  ret i32 %elt.usub_sat
+}
+
+define noundef i64 @usub_sat_i64(i64 noundef %a, i64 noundef %b) {
+; CHECK-LABEL: define noundef i64 @usub_sat_i64(
+; CHECK-SAME: i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[USUB_CMP:%.*]] = icmp ult i64 [[A]], [[B]]
+; CHECK-NEXT:    [[USUB_SUB:%.*]] = sub i64 [[A]], [[B]]
+; CHECK-NEXT:    [[ELT_USUB_SAT:%.*]] = select i1 [[USUB_CMP]], i64 0, i64 [[USUB_SUB]]
+; CHECK-NEXT:    ret i64 [[ELT_USUB_SAT]]
+;
+entry:
+  %elt.usub_sat = call i64 @llvm.usub.sat.i64(i64 %a, i64 %b)
+  ret i64 %elt.usub_sat
+}
+
+define noundef <4 x i32> @usub_sat_vec(<4 x i32> noundef %a, <4 x i32> noundef %b) {
+; CHECK-LABEL: define noundef <4 x i32> @usub_sat_vec(
+; CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[USUB_CMP:%.*]] = icmp ult <4 x i32> [[A]], [[B]]
+; CHECK-NEXT:    [[USUB_SUB:%.*]] = sub <4 x i32> [[A]], [[B]]
+; CHECK-NEXT:    [[ELT_USUB_SAT:%.*]] = select <4 x i1> [[USUB_CMP]], <4 x i32> zeroinitializer, <4 x i32> [[USUB_SUB]]
+; CHECK-NEXT:    ret <4 x i32> [[ELT_USUB_SAT]]
+;
+entry:
+  %elt.usub_sat = call <4 x i32> @llvm.usub.sat.v4i32(<4 x i32> %a, <4 x i32> %b)
+  ret <4 x i32> %elt.usub_sat
+}

>From 52ef55864f50077072e083c5582d23a9ec494142 Mon Sep 17 00:00:00 2001
From: erichkeane <ekeane at nvidia.com>
Date: Fri, 11 Apr 2025 11:30:43 -0700
Subject: [PATCH 27/76] [OpenACC] Fix source-location on a handful of CIR
 Directives

Apparently we used the 'end location' instead of 'start' in a few
places.
---
 clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
index 5e3f826e2fa84..152f996ed0fed 100644
--- a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
@@ -200,7 +200,7 @@ mlir::LogicalResult CIRGenFunction::emitOpenACCOp(
 
 mlir::LogicalResult
 CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) {
-  mlir::Location start = getLoc(s.getSourceRange().getEnd());
+  mlir::Location start = getLoc(s.getSourceRange().getBegin());
   mlir::Location end = getLoc(s.getSourceRange().getEnd());
 
   switch (s.getDirectiveKind()) {
@@ -223,7 +223,7 @@ CIRGenFunction::emitOpenACCComputeConstruct(const OpenACCComputeConstruct &s) {
 
 mlir::LogicalResult
 CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) {
-  mlir::Location start = getLoc(s.getSourceRange().getEnd());
+  mlir::Location start = getLoc(s.getSourceRange().getBegin());
   mlir::Location end = getLoc(s.getSourceRange().getEnd());
 
   return emitOpenACCOpAssociatedStmt<DataOp, mlir::acc::TerminatorOp>(
@@ -233,21 +233,21 @@ CIRGenFunction::emitOpenACCDataConstruct(const OpenACCDataConstruct &s) {
 
 mlir::LogicalResult
 CIRGenFunction::emitOpenACCInitConstruct(const OpenACCInitConstruct &s) {
-  mlir::Location start = getLoc(s.getSourceRange().getEnd());
+  mlir::Location start = getLoc(s.getSourceRange().getBegin());
   return emitOpenACCOp<InitOp>(start, s.getDirectiveKind(), s.getDirectiveLoc(),
                                s.clauses());
 }
 
 mlir::LogicalResult
 CIRGenFunction::emitOpenACCSetConstruct(const OpenACCSetConstruct &s) {
-  mlir::Location start = getLoc(s.getSourceRange().getEnd());
+  mlir::Location start = getLoc(s.getSourceRange().getBegin());
   return emitOpenACCOp<SetOp>(start, s.getDirectiveKind(), s.getDirectiveLoc(),
                               s.clauses());
 }
 
 mlir::LogicalResult CIRGenFunction::emitOpenACCShutdownConstruct(
     const OpenACCShutdownConstruct &s) {
-  mlir::Location start = getLoc(s.getSourceRange().getEnd());
+  mlir::Location start = getLoc(s.getSourceRange().getBegin());
   return emitOpenACCOp<ShutdownOp>(start, s.getDirectiveKind(),
                                    s.getDirectiveLoc(), s.clauses());
 }

>From db4ad4686f09822add4575801a2bbb10c8d56ebb Mon Sep 17 00:00:00 2001
From: Roland McGrath <mcgrathr at google.com>
Date: Fri, 11 Apr 2025 11:33:52 -0700
Subject: [PATCH 28/76] [libc] Add myself as maintainer for Public Headers /
 hdrgen (#135209)

---
 libc/Maintainers.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libc/Maintainers.rst b/libc/Maintainers.rst
index 57a6a0ce0c9d1..2ef1ec565056b 100644
--- a/libc/Maintainers.rst
+++ b/libc/Maintainers.rst
@@ -59,4 +59,9 @@ RISC-V
 | Mikhail R. Gadelha
 | mikhail\@igalia.com (email), `mikhailramalho <https://github.com/mikhailramalho>`_ (github)
 
+Public Headers / hdrgen
+-----------------------
+| Roland McGrath
+| mcgrathr\@google.com (email), `frobtech <https://github.com/frobtech>`_ (github)
+
 .. TODO: add "Inactive Maintainers" section when needed.

>From 38e64b1a84d1af0bb232833f8f6f57bd4d6e8a7a Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Fri, 11 Apr 2025 11:36:46 -0700
Subject: [PATCH 29/76] [SLP]Fix minbiwidth analysis for gather nodes with
 SIToFP users

If the buildvector node has cast to float user, it cannot be considered as safe
for truncation, need to use the original bitwidth here.

Fixes #135410
---
 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp              | 4 +++-
 .../SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll | 5 ++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index b7ee5bfc310d9..50c403906daa9 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -19974,8 +19974,10 @@ void BoUpSLP::computeMinimumValueSizes() {
                       return false;
                     if (!isa<CastInst, BinaryOperator, FreezeInst, PHINode,
                              SelectInst>(U) ||
+                        isa<SIToFPInst, UIToFPInst>(U) ||
                         !isa<CastInst, BinaryOperator, FreezeInst, PHINode,
-                             SelectInst>(UserTE->getMainOp()))
+                             SelectInst>(UserTE->getMainOp()) ||
+                        isa<SIToFPInst, UIToFPInst>(UserTE->getMainOp()))
                       return true;
                     unsigned UserTESz = DL->getTypeSizeInBits(
                         UserTE->Scalars.front()->getType());
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll b/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll
index 29aed14dc3ffc..ffeb8045dea7e 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/trunced-buildvector-scalar-extended.ll
@@ -5,9 +5,8 @@ define <4 x float> @test(i64 %0) {
 ; CHECK-LABEL: define <4 x float> @test(
 ; CHECK-SAME: i64 [[TMP0:%.*]]) {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
-; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
-; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <4 x i32> <i32 0, i32 0, i32 poison, i32 0>, i32 [[TMP1]], i32 2
-; CHECK-NEXT:    [[TMP3:%.*]] = sext <4 x i32> [[TMP2]] to <4 x i64>
+; CHECK-NEXT:    [[TMP3:%.*]] = insertelement <4 x i64> <i64 0, i64 0, i64 poison, i64 0>, i64 [[TMP0]], i32 2
+; CHECK-NEXT:    [[TMP2:%.*]] = trunc <4 x i64> [[TMP3]] to <4 x i32>
 ; CHECK-NEXT:    [[TMP4:%.*]] = sitofp <4 x i64> [[TMP3]] to <4 x float>
 ; CHECK-NEXT:    [[TMP5:%.*]] = sitofp <4 x i32> [[TMP2]] to <4 x float>
 ; CHECK-NEXT:    [[TMP6:%.*]] = fadd <4 x float> [[TMP4]], [[TMP5]]

>From c2939b9bf672713ac36910a3e6d00c19ace1bd44 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Fri, 11 Apr 2025 11:46:22 -0700
Subject: [PATCH 30/76] Reland "[lldb] Clear thread-creation breakpoints in
 ProcessGDBRemote::Clear (#134397)" (#135296)

This reapplies commit
https://github.com/llvm/llvm-project/commit/232525f06942adb3b9977632e38dcd5f08c0642d.

The original commit triggered a sanitizer failure when `Target` was
destroyed. In `Target::Destroy`, `DeleteCurrentProcess` was called, but
it did not destroy the thread creation breakpoints for the underlying
`ProcessGDBRemote` because `ProcessGDBRemote::Clear` was not called in
that path.

`Target `then proceeded to destroy its breakpoints, which resulted in a
call to the destructor of a `std::vector` containing the breakpoints.
Through a sequence of complicated events, destroying breakpoints caused
the reference count of the underlying `ProcessGDBRemote` to finally
reach zero. This, in turn, called `ProcessGDBRemote::Clear`, which
attempted to destroy the breakpoints. To do that, it would go back into
the Target's vector of breakpoints, which we are in the middle of
destroying.

We solve this by moving the breakpoint deletion into
`Process:DoDestroy`, which is a virtual Process method that will be
called much earlier.
---
 .../Process/gdb-remote/ProcessGDBRemote.cpp   |  9 +++++++++
 .../Process/gdb-remote/ProcessGDBRemote.h     |  3 +++
 .../TestBreakpointsThreadInit.py              | 20 +++++++++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 68360788c96e6..b616e99be83b2 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2571,9 +2571,18 @@ Status ProcessGDBRemote::DoDestroy() {
 
   StopAsyncThread();
   KillDebugserverProcess();
+  RemoveNewThreadBreakpoints();
   return Status();
 }
 
+void ProcessGDBRemote::RemoveNewThreadBreakpoints() {
+  if (m_thread_create_bp_sp) {
+    if (TargetSP target_sp = m_target_wp.lock())
+      target_sp->RemoveBreakpointByID(m_thread_create_bp_sp->GetID());
+    m_thread_create_bp_sp.reset();
+  }
+}
+
 void ProcessGDBRemote::SetLastStopPacket(
     const StringExtractorGDBRemote &response) {
   const bool did_exec =
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 1cbd1e82b381d..20d7fc0801eb3 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -436,6 +436,9 @@ class ProcessGDBRemote : public Process,
                                            lldb::user_id_t break_id,
                                            lldb::user_id_t break_loc_id);
 
+  /// Remove the breakpoints associated with thread creation from the Target.
+  void RemoveNewThreadBreakpoints();
+
   // ContinueDelegate interface
   void HandleAsyncStdout(llvm::StringRef out) override;
   void HandleAsyncMisc(llvm::StringRef data) override;
diff --git a/lldb/test/API/macosx/thread_start_bps/TestBreakpointsThreadInit.py b/lldb/test/API/macosx/thread_start_bps/TestBreakpointsThreadInit.py
index 1c6fd4f91c73e..bf667f6f7d336 100644
--- a/lldb/test/API/macosx/thread_start_bps/TestBreakpointsThreadInit.py
+++ b/lldb/test/API/macosx/thread_start_bps/TestBreakpointsThreadInit.py
@@ -35,3 +35,23 @@ def test_internal_bps_resolved(self):
         for bp in bps:
             num_resolved += bp.GetNumResolvedLocations()
         self.assertGreater(num_resolved, 0)
+
+    @skipUnlessDarwin
+    def test_internal_bps_deleted_on_relaunch(self):
+        self.build()
+
+        source_file = lldb.SBFileSpec("main.c")
+        target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+            self, "initial hello", source_file
+        )
+
+        self.runCmd("break list --internal")
+        output = self.res.GetOutput()
+        self.assertEqual(output.count("thread-creation"), 1)
+
+        process.Kill()
+        self.runCmd("run", RUN_SUCCEEDED)
+
+        self.runCmd("break list --internal")
+        output = self.res.GetOutput()
+        self.assertEqual(output.count("thread-creation"), 1)

>From 179d30f8c3fddd3c85056fd2b8e877a4a8513158 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Fri, 11 Apr 2025 11:50:42 -0700
Subject: [PATCH 31/76] Revert "[lldb] Make sure the process is stopped when
 computing the symbol context (#134757)" (#135408)

This reverts commit e84a80408523a48d6eaacd795f1615e821ffb233 because on
Linux there seems to be a race around GetRunLock. See #134757 for more
context.
---
 lldb/source/Core/Statusline.cpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/lldb/source/Core/Statusline.cpp b/lldb/source/Core/Statusline.cpp
index e14691e2538a2..ed5308ef53eb0 100644
--- a/lldb/source/Core/Statusline.cpp
+++ b/lldb/source/Core/Statusline.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Host/StreamFile.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Symbol/SymbolContext.h"
-#include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Utility/AnsiTerminal.h"
 #include "lldb/Utility/StreamString.h"
@@ -135,15 +134,8 @@ void Statusline::Redraw(bool update) {
     exe_ctx.SetTargetPtr(&m_debugger.GetSelectedOrDummyTarget());
 
   SymbolContext symbol_ctx;
-  if (ProcessSP process_sp = exe_ctx.GetProcessSP()) {
-    // Check if the process is stopped, and if it is, make sure it remains
-    // stopped until we've computed the symbol context.
-    Process::StopLocker stop_locker;
-    if (stop_locker.TryLock(&process_sp->GetRunLock())) {
-      if (auto frame_sp = exe_ctx.GetFrameSP())
-        symbol_ctx = frame_sp->GetSymbolContext(eSymbolContextEverything);
-    }
-  }
+  if (auto frame_sp = exe_ctx.GetFrameSP())
+    symbol_ctx = frame_sp->GetSymbolContext(eSymbolContextEverything);
 
   StreamString stream;
   if (auto *format = m_debugger.GetStatuslineFormat())

>From fedd79bdcd8363456ec87796694ae0f37d28a98f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrzej=20Warzy=C5=84ski?= <andrzej.warzynski at arm.com>
Date: Fri, 11 Apr 2025 20:08:08 +0100
Subject: [PATCH 32/76] [mlir][vector] Tighten the semantics of
 vector.{load|store} (#135151)

This change refines the verifier for `vector.load` and `vector.store` to
disallow the use of vectors with higher rank than the source or
destination memref. For example, the following is now rejected:

```mlir
  %0 = vector.load %src[%c0] : memref<?xi8>, vector<16x16xi8>
  vector.store %vec, %dest[%c0] : memref<?xi8>, vector<16x16xi8>
```

This pattern was previously used in SME end-to-end tests and "happened"
to work by implicitly assuming row-major memory layout. However, there
is no guarantee that such an assumption will always hold, and we should
avoid relying on it unless it can be enforced deterministically.

Notably, production ArmSME lowering pipelines do not rely on this
behavior. Instead, the expected usage (illustrated here with scalable
vector syntax) would be:

```mlir
  %0 = vector.load %src[%c0, %c0] : memref<?x?xi8>, vector<[16]x[16]xi8>
```

This PR updates the verifier accordingly and adjusts all affected tests.
These tests are either removed (if no longer relevant) or updated to use
memrefs with appropriately matching rank.
---
 mlir/lib/Dialect/Vector/IR/VectorOps.cpp      |  7 ++
 .../VectorToArmSME/vector-to-arm-sme.mlir     | 12 ---
 .../Dialect/MemRef/fold-memref-alias-ops.mlir | 67 ++++++++++-----
 mlir/test/Dialect/Vector/invalid.mlir         | 32 ++++++-
 .../vector-transfer-to-vector-load-store.mlir |  8 +-
 .../Dialect/Vector/CPU/ArmSME/transpose.mlir  |  9 +-
 .../Vector/CPU/ArmSME/vector-load-store.mlir  | 84 +++++++++----------
 7 files changed, 130 insertions(+), 89 deletions(-)

diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index 754dab21ee1f3..5324e38fa7d25 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -5100,6 +5100,10 @@ LogicalResult vector::LoadOp::verify() {
   if (failed(verifyLoadStoreMemRefLayout(*this, resVecTy, memRefTy)))
     return failure();
 
+  if (memRefTy.getRank() < resVecTy.getRank())
+    return emitOpError(
+        "destination memref has lower rank than the result vector");
+
   // Checks for vector memrefs.
   Type memElemTy = memRefTy.getElementType();
   if (auto memVecTy = llvm::dyn_cast<VectorType>(memElemTy)) {
@@ -5132,6 +5136,9 @@ LogicalResult vector::StoreOp::verify() {
   if (failed(verifyLoadStoreMemRefLayout(*this, valueVecTy, memRefTy)))
     return failure();
 
+  if (memRefTy.getRank() < valueVecTy.getRank())
+    return emitOpError("source memref has lower rank than the vector to store");
+
   // Checks for vector memrefs.
   Type memElemTy = memRefTy.getElementType();
   if (auto memVecTy = llvm::dyn_cast<VectorType>(memElemTy)) {
diff --git a/mlir/test/Conversion/VectorToArmSME/vector-to-arm-sme.mlir b/mlir/test/Conversion/VectorToArmSME/vector-to-arm-sme.mlir
index 0f973af799634..c8a434bb8f5de 100644
--- a/mlir/test/Conversion/VectorToArmSME/vector-to-arm-sme.mlir
+++ b/mlir/test/Conversion/VectorToArmSME/vector-to-arm-sme.mlir
@@ -718,18 +718,6 @@ func.func @vector_load_i8_with_offset(%arg0 : memref<?x?xi8>) -> vector<[16]x[16
 
 // -----
 
-// CHECK-LABEL: @vector_load_i8_from_rank_1_memref(
-// CHECK-SAME:                                     %[[MEMREF:.*]]: memref<?xi8>)
-// CHECK: %[[C0:.*]] = arith.constant 0 : index
-// CHECK: arm_sme.tile_load %[[MEMREF]][%[[C0]]] : memref<?xi8>, vector<[16]x[16]xi8>
-func.func @vector_load_i8_from_rank_1_memref(%arg0 : memref<?xi8>) -> vector<[16]x[16]xi8> {
-  %c0 = arith.constant 0 : index
-  %tile = vector.load %arg0[%c0] : memref<?xi8>, vector<[16]x[16]xi8>
-  return %tile : vector<[16]x[16]xi8>
-}
-
-// -----
-
 // CHECK-LABEL: @vector_load_i16(
 // CHECK: arm_sme.tile_load {{.*}} : memref<?x?xi16>, vector<[8]x[8]xi16>
 func.func @vector_load_i16(%arg0 : memref<?x?xi16>) -> vector<[8]x[8]xi16> {
diff --git a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
index 067cdb5c5fd20..3160fd9c65c04 100644
--- a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
+++ b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
@@ -819,18 +819,29 @@ func.func @test_ldmatrix(%arg0: memref<4x32x32xf16, 3>, %arg1: index, %arg2: ind
 
 // -----
 
-func.func @fold_vector_load_subview(
-  %arg0 : memref<12x32xf32>, %arg1 : index, %arg2 : index) -> vector<12x32xf32> {
-  %0 = memref.subview %arg0[%arg1, %arg2][1, 1][1, 1] : memref<12x32xf32> to memref<f32, strided<[], offset: ?>>
-  %1 = vector.load %0[] : memref<f32, strided<[], offset: ?>>, vector<12x32xf32>
-  return %1 : vector<12x32xf32>
+func.func @fold_vector_load_subview(%src : memref<24x64xf32>,
+                                    %off1 : index,
+                                    %off2 : index,
+                                    %dim1 : index,
+                                    %dim2 : index,
+                                    %idx : index) -> vector<12x32xf32> {
+
+    %0 = memref.subview %src[%off1, %off2][%dim1, %dim2][1, 1] : memref<24x64xf32> to memref<?x?xf32, strided<[64, 1], offset: ?>>
+    %1 = vector.load %0[%idx, %idx] :  memref<?x?xf32, strided<[64, 1], offset: ?>>, vector<12x32xf32>
+    return %1 : vector<12x32xf32>
 }
 
-//      CHECK: func @fold_vector_load_subview
-// CHECK-SAME:   %[[ARG0:[a-zA-Z0-9_]+]]: memref<12x32xf32>
-// CHECK-SAME:   %[[ARG1:[a-zA-Z0-9_]+]]: index
-// CHECK-SAME:   %[[ARG2:[a-zA-Z0-9_]+]]: index
-//      CHECK:   vector.load %[[ARG0]][%[[ARG1]], %[[ARG2]]] :  memref<12x32xf32>, vector<12x32xf32>
+// CHECK: #[[$ATTR_46:.+]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-LABEL:   func.func @fold_vector_load_subview(
+// CHECK-SAME:      %[[SRC:[a-zA-Z0-9$._-]*]]: memref<24x64xf32>,
+// CHECK-SAME:      %[[OFF_1:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[OFF_2:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[DIM_1:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[DIM_2:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[IDX:[a-zA-Z0-9$._-]*]]: index) -> vector<12x32xf32> {
+// CHECK:           %[[VAL_6:.*]] = affine.apply #[[$ATTR_46]](){{\[}}%[[OFF_1]], %[[IDX]]]
+// CHECK:           %[[VAL_7:.*]] = affine.apply #[[$ATTR_46]](){{\[}}%[[OFF_2]], %[[IDX]]]
+// CHECK:           %[[VAL_8:.*]] = vector.load %[[SRC]]{{\[}}%[[VAL_6]], %[[VAL_7]]] : memref<24x64xf32>, vector<12x32xf32>
 
 // -----
 
@@ -851,20 +862,32 @@ func.func @fold_vector_maskedload_subview(
 
 // -----
 
-func.func @fold_vector_store_subview(
-  %arg0 : memref<12x32xf32>, %arg1 : index, %arg2 : index, %arg3: vector<2x32xf32>) -> () {
-  %0 = memref.subview %arg0[%arg1, %arg2][1, 1][1, 1] : memref<12x32xf32> to memref<f32, strided<[], offset: ?>>
-  vector.store %arg3, %0[] : memref<f32, strided<[], offset: ?>>, vector<2x32xf32>
-  return
+func.func @fold_vector_store_subview(%src : memref<24x64xf32>,
+                                     %off1 : index,
+                                     %off2 : index,
+                                     %vec: vector<2x32xf32>,
+                                     %idx : index,
+                                     %dim1 : index,
+                                     %dim2 : index) -> () {
+
+    %0 = memref.subview %src[%off1, %off2][%dim1, %dim2][1, 1] : memref<24x64xf32> to memref<?x?xf32, strided<[64, 1], offset: ?>>
+    vector.store %vec, %0[%idx, %idx] : memref<?x?xf32, strided<[64, 1], offset: ?>> , vector<2x32xf32>
+    return
 }
 
-//      CHECK: func @fold_vector_store_subview
-// CHECK-SAME:   %[[ARG0:[a-zA-Z0-9_]+]]: memref<12x32xf32>
-// CHECK-SAME:   %[[ARG1:[a-zA-Z0-9_]+]]: index
-// CHECK-SAME:   %[[ARG2:[a-zA-Z0-9_]+]]: index
-// CHECK-SAME:   %[[ARG3:[a-zA-Z0-9_]+]]: vector<2x32xf32>
-//      CHECK:   vector.store %[[ARG3]], %[[ARG0]][%[[ARG1]], %[[ARG2]]] :  memref<12x32xf32>, vector<2x32xf32>
-//      CHECK:   return
+// CHECK: #[[$ATTR_47:.+]] = affine_map<()[s0, s1] -> (s0 + s1)>
+
+// CHECK-LABEL:   func.func @fold_vector_store_subview(
+// CHECK-SAME:      %[[SRC:[a-zA-Z0-9$._-]*]]: memref<24x64xf32>,
+// CHECK-SAME:      %[[OFF1:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[OFF_2:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[VEC:[a-zA-Z0-9$._-]*]]: vector<2x32xf32>,
+// CHECK-SAME:      %[[IDX:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[VAL_5:[a-zA-Z0-9$._-]*]]: index,
+// CHECK-SAME:      %[[VAL_6:[a-zA-Z0-9$._-]*]]: index) {
+//      CHECK:      %[[VAL_7:.*]] = affine.apply #[[$ATTR_47]](){{\[}}%[[OFF1]], %[[IDX]]]
+//      CHECK:      %[[VAL_8:.*]] = affine.apply #[[$ATTR_47]](){{\[}}%[[OFF_2]], %[[IDX]]]
+//      CHECK:      vector.store %[[VEC]], %[[SRC]]{{\[}}%[[VAL_7]], %[[VAL_8]]] : memref<24x64xf32>, vector<2x32xf32>
 
 // -----
 
diff --git a/mlir/test/Dialect/Vector/invalid.mlir b/mlir/test/Dialect/Vector/invalid.mlir
index ef87030bf0752..dbf829e014b8d 100644
--- a/mlir/test/Dialect/Vector/invalid.mlir
+++ b/mlir/test/Dialect/Vector/invalid.mlir
@@ -1743,13 +1743,11 @@ func.func @invalid_outerproduct(%src : memref<?xf32>) {
 
 // -----
 
-func.func @invalid_outerproduct1(%src : memref<?xf32>) {
+func.func @invalid_outerproduct1(%src : memref<?xf32>, %lhs : vector<[4]x[4]xf32>, %rhs : vector<[4]xf32>) {
   %idx = arith.constant 0 : index
-  %0 = vector.load %src[%idx] : memref<?xf32>, vector<[4]x[4]xf32>
-  %1 = vector.load %src[%idx] : memref<?xf32>, vector<[4]xf32>
 
   // expected-error @+1 {{'vector.outerproduct' op expected 1-d vector for operand #1}}
-  %op = vector.outerproduct %0, %1 : vector<[4]x[4]xf32>, vector<[4]xf32>
+  %op = vector.outerproduct %lhs, %rhs : vector<[4]x[4]xf32>, vector<[4]xf32>
 }
 
 // -----
@@ -1870,3 +1868,29 @@ func.func @flat_transpose_scalable(%arg0: vector<[16]xf32>) -> vector<[16]xf32>
      : vector<[16]xf32> -> vector<[16]xf32>
   return %0 : vector<[16]xf32>
 }
+
+// -----
+
+//===----------------------------------------------------------------------===//
+// vector.load
+//===----------------------------------------------------------------------===//
+
+func.func @vector_load(%src : memref<?xi8>) {
+  %c0 = arith.constant 0 : index
+  // expected-error @+1 {{'vector.load' op destination memref has lower rank than the result vector}}
+  %0 = vector.load %src[%c0] : memref<?xi8>, vector<16x16xi8>
+  return
+}
+
+// -----
+
+//===----------------------------------------------------------------------===//
+// vector.store
+//===----------------------------------------------------------------------===//
+
+func.func @vector_store(%dest : memref<?xi8>, %vec : vector<16x16xi8>) {
+  %c0 = arith.constant 0 : index
+  // expected-error @+1 {{'vector.store' op source memref has lower rank than the vector to store}}
+  vector.store %vec, %dest[%c0] : memref<?xi8>, vector<16x16xi8>
+  return
+}
diff --git a/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir b/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir
index fd50acf03e79b..511ab70f35086 100644
--- a/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir
+++ b/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir
@@ -2,8 +2,8 @@
 
 // CHECK-LABEL: func @vector_transfer_ops_0d_memref(
 //  CHECK-SAME:   %[[MEM:.*]]: memref<f32>
-//  CHECK-SAME:   %[[VEC:.*]]: vector<1x1x1xf32>
-func.func @vector_transfer_ops_0d_memref(%mem: memref<f32>, %vec: vector<1x1x1xf32>) {
+//  CHECK-SAME:   %[[VEC:.*]]: vector<f32>
+func.func @vector_transfer_ops_0d_memref(%mem: memref<f32>, %vec: vector<f32>) {
     %f0 = arith.constant 0.0 : f32
 
 //  CHECK-NEXT:   %[[S:.*]] = vector.load %[[MEM]][] : memref<f32>, vector<f32>
@@ -12,8 +12,8 @@ func.func @vector_transfer_ops_0d_memref(%mem: memref<f32>, %vec: vector<1x1x1xf
 //  CHECK-NEXT:   vector.store %[[S]], %[[MEM]][] : memref<f32>, vector<f32>
     vector.transfer_write %0, %mem[] : vector<f32>, memref<f32>
 
-//  CHECK-NEXT:   vector.store %[[VEC]], %[[MEM]][] : memref<f32>, vector<1x1x1xf32>
-    vector.store %vec, %mem[] : memref<f32>, vector<1x1x1xf32>
+//  CHECK-NEXT:   vector.store %[[VEC]], %[[MEM]][] : memref<f32>, vector<f32>
+    vector.store %vec, %mem[] : memref<f32>, vector<f32>
 
     return
 }
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/transpose.mlir b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/transpose.mlir
index ff20f99b63cd1..8188e66ce0662 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/transpose.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/transpose.mlir
@@ -14,10 +14,9 @@ func.func @entry() {
 
   // Calculate the size of a 32-bit tile, e.g. ZA{n}.s.
   %svl_s = arm_sme.streaming_vl <word>
-  %za_s_size = arith.muli %svl_s, %svl_s : index
 
   // Allocate memory.
-  %mem1 = memref.alloca(%za_s_size) : memref<?xi32>
+  %mem1 = memref.alloca(%svl_s, %svl_s) : memref<?x?xi32>
 
   // Fill each "row" of "mem1" with row number.
   //
@@ -29,15 +28,15 @@ func.func @entry() {
   //   3, 3, 3, 3
   //
   %init_0 = arith.constant 0 : i32
-  scf.for %i = %c0 to %za_s_size step %svl_s iter_args(%val = %init_0) -> (i32) {
+  scf.for %i = %c0 to %svl_s step %c1 iter_args(%val = %init_0) -> (i32) {
     %splat_val = vector.broadcast %val : i32 to vector<[4]xi32>
-    vector.store %splat_val, %mem1[%i] : memref<?xi32>, vector<[4]xi32>
+    vector.store %splat_val, %mem1[%i, %c0] : memref<?x?xi32>, vector<[4]xi32>
     %val_next = arith.addi %val, %c1_i32 : i32
     scf.yield %val_next : i32
   }
 
   // Load tile from "mem1".
-  %tile = vector.load %mem1[%c0] : memref<?xi32>, vector<[4]x[4]xi32>
+  %tile = vector.load %mem1[%c0, %c0] : memref<?x?xi32>, vector<[4]x[4]xi32>
 
   // Transpose tile.
   %transposed_tile = vector.transpose %tile, [1, 0] : vector<[4]x[4]xi32> to vector<[4]x[4]xi32>
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-load-store.mlir b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-load-store.mlir
index 6e25bee65f095..b69a200b2a49a 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-load-store.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/vector-load-store.mlir
@@ -33,12 +33,11 @@ func.func @za0_d_f64() -> i32 {
   //   2.1, 2.1, 2.1, 2.1
   //   3.1, 3.1, 3.1, 3.1
   //
-  %tilesize = arith.muli %svl_d, %svl_d : index
-  %mem1 = memref.alloca(%tilesize) : memref<?xf64>
+  %mem1 = memref.alloca(%svl_d, %svl_d) : memref<?x?xf64>
   %init_0 = arith.constant 0.1 : f64
-  scf.for %i = %c0 to %tilesize step %svl_d iter_args(%val = %init_0) -> (f64) {
+  scf.for %i = %c0 to %svl_d step %c1_index iter_args(%val = %init_0) -> (f64) {
     %splat_val = vector.broadcast %val : f64 to vector<[2]xf64>
-    vector.store %splat_val, %mem1[%i] : memref<?xf64>, vector<[2]xf64>
+    vector.store %splat_val, %mem1[%i, %c0] : memref<?x?xf64>, vector<[2]xf64>
     %val_next = arith.addf %val, %c1_f64 : f64
     scf.yield %val_next : f64
   }
@@ -48,27 +47,29 @@ func.func @za0_d_f64() -> i32 {
   //
   // CHECK-ZA0_D:      ( 0.1, 0.1
   // CHECK-ZA0_D-NEXT: ( 1.1, 1.1
-  scf.for %i = %c0 to %tilesize step %svl_d {
-    %tileslice = vector.load %mem1[%i] : memref<?xf64>, vector<[2]xf64>
+  scf.for %i = %c0 to %svl_d step %c1_index {
+    %tileslice = vector.load %mem1[%i, %c0] : memref<?x?xf64>, vector<[2]xf64>
     vector.print %tileslice : vector<[2]xf64>
   }
 
   // Load ZA0.D from "mem1"
-  %za0_d = vector.load %mem1[%c0] : memref<?xf64>, vector<[2]x[2]xf64>
+  %za0_d = vector.load %mem1[%c0, %c0] : memref<?x?xf64>, vector<[2]x[2]xf64>
 
   // Allocate "mem2" to store ZA0.D to
-  %mem2 = memref.alloca(%tilesize) : memref<?xf64>
+  %mem2 = memref.alloca(%svl_d, %svl_d) : memref<?x?xf64>
 
   // Zero "mem2"
-  scf.for %i = %c0 to %tilesize step %c1_index {
-    memref.store %c0_f64, %mem2[%i] : memref<?xf64>
+  scf.for %i = %c0 to %svl_d step %c1_index {
+    scf.for %j = %c0 to %svl_d step %c1_index {
+      memref.store %c0_f64, %mem2[%i, %j] : memref<?x?xf64>
+    }
   }
 
   // Verify "mem2" is zeroed by doing an add reduction with initial value of
   // zero
   %init_0_f64 = arith.constant 0.0 : f64
-  %add_reduce = scf.for %vnum = %c0 to %tilesize step %svl_d iter_args(%iter = %init_0_f64) -> (f64) {
-    %row = vector.load %mem2[%vnum] : memref<?xf64>, vector<[2]xf64>
+  %add_reduce = scf.for %vnum = %c0 to %svl_d step %c1_index iter_args(%iter = %init_0_f64) -> (f64) {
+    %row = vector.load %mem2[%vnum, %c0] : memref<?x?xf64>, vector<[2]xf64>
 
     %inner_add_reduce = scf.for %offset = %c0 to %svl_d step %c1_index iter_args(%inner_iter = %init_0_f64) -> (f64) {
       %t = vector.extractelement %row[%offset : index] : vector<[2]xf64>
@@ -88,16 +89,16 @@ func.func @za0_d_f64() -> i32 {
   //
   // CHECK-ZA0_D-NEXT: ( 0, 0
   // CHECK-ZA0_D-NEXT: ( 0, 0
-  scf.for %i = %c0 to %tilesize step %svl_d {
-    %tileslice = vector.load %mem2[%i] : memref<?xf64>, vector<[2]xf64>
+  scf.for %i = %c0 to  %svl_d  step %c1_index{
+    %tileslice = vector.load %mem2[%i, %c0] : memref<?x?xf64>, vector<[2]xf64>
     vector.print %tileslice : vector<[2]xf64>
   }
 
   // Verify "mem1" != "mem2"
   %init_1 = arith.constant 1 : i64
-  %mul_reduce_0 = scf.for %vnum = %c0 to %tilesize step %svl_d iter_args(%iter = %init_1) -> (i64) {
-    %row_1 = vector.load %mem1[%vnum] : memref<?xf64>, vector<[2]xf64>
-    %row_2 = vector.load %mem2[%vnum] : memref<?xf64>, vector<[2]xf64>
+  %mul_reduce_0 = scf.for %vnum = %c0 to %svl_d step %c1_index iter_args(%iter = %init_1) -> (i64) {
+    %row_1 = vector.load %mem1[%vnum, %c0] : memref<?x?xf64>, vector<[2]xf64>
+    %row_2 = vector.load %mem2[%vnum, %c0] : memref<?x?xf64>, vector<[2]xf64>
     %cmp = arith.cmpf one, %row_1, %row_2 : vector<[2]xf64>
 
     %inner_mul_reduce = scf.for %i = %c0 to %svl_d step %c1_index iter_args(%inner_iter = %init_1) -> (i64) {
@@ -115,12 +116,12 @@ func.func @za0_d_f64() -> i32 {
   vector.print %mul_reduce_0 : i64
 
   // Store ZA0.D to "mem2"
-  vector.store %za0_d, %mem2[%c0] : memref<?xf64>, vector<[2]x[2]xf64>
+  vector.store %za0_d, %mem2[%c0, %c0] : memref<?x?xf64>, vector<[2]x[2]xf64>
 
   // Verify "mem1" == "mem2"
-  %mul_reduce_1 = scf.for %vnum = %c0 to %tilesize step %svl_d iter_args(%iter = %init_1) -> (i64) {
-    %row_1 = vector.load %mem1[%vnum] : memref<?xf64>, vector<[2]xf64>
-    %row_2 = vector.load %mem2[%vnum] : memref<?xf64>, vector<[2]xf64>
+  %mul_reduce_1 = scf.for %vnum = %c0 to %svl_d step %c1_index iter_args(%iter = %init_1) -> (i64) {
+    %row_1 = vector.load %mem1[%vnum, %c0] : memref<?x?xf64>, vector<[2]xf64>
+    %row_2 = vector.load %mem2[%vnum, %c0] : memref<?x?xf64>, vector<[2]xf64>
     %cmp = arith.cmpf oeq, %row_1, %row_2 : vector<[2]xf64>
 
     %inner_mul_reduce = scf.for %i = %c0 to %svl_d step %c1_index iter_args(%inner_iter = %init_1) -> (i64) {
@@ -142,8 +143,8 @@ func.func @za0_d_f64() -> i32 {
   //
   // CHECK-ZA0_D-NEXT: ( 0.1, 0.1
   // CHECK-ZA0_D-NEXT: ( 1.1, 1.1
-  scf.for %i = %c0 to %tilesize step %svl_d {
-    %tileslice = vector.load %mem2[%i] : memref<?xf64>, vector<[2]xf64>
+  scf.for %i = %c0 to %svl_d step %c1_index{
+    %tileslice = vector.load %mem2[%i, %c0] : memref<?x?xf64>, vector<[2]xf64>
     vector.print %tileslice : vector<[2]xf64>
   }
 
@@ -169,9 +170,8 @@ func.func @load_store_two_za_s_tiles() -> i32 {
   %svl_s = arm_sme.streaming_vl <word>
 
   // Allocate memory for two 32-bit element tiles.
-  %size_of_tile = arith.muli %svl_s, %svl_s : index
-  %size_of_two_tiles = arith.muli %size_of_tile, %c2_index : index
-  %mem1 = memref.alloca(%size_of_two_tiles) : memref<?xi32>
+  %svl_s_x_2 = arith.muli %svl_s, %c2_index : index
+  %mem1 = memref.alloca(%svl_s_x_2, %svl_s) : memref<?x?xi32>
 
   // Fill memory that tile 1 will be loaded from with '1' and '2' for tile 2.
   //
@@ -191,15 +191,15 @@ func.func @load_store_two_za_s_tiles() -> i32 {
   //   2, 2, 2, 2
   //   2, 2, 2, 2
   //
-  scf.for %i = %c0 to %size_of_two_tiles step %svl_s {
-    %isFirstTile = arith.cmpi ult, %i, %size_of_tile : index
+  scf.for %i = %c0 to %svl_s_x_2 step %c1_index {
+    %isFirstTile = arith.cmpi ult, %i, %svl_s : index
     %val = scf.if %isFirstTile -> i32 {
       scf.yield %c1_i32 : i32
     } else {
       scf.yield %c2_i32 : i32
     }
     %splat_val = vector.broadcast %val : i32 to vector<[4]xi32>
-    vector.store %splat_val, %mem1[%i] : memref<?xi32>, vector<[4]xi32>
+    vector.store %splat_val, %mem1[%i, %c0] : memref<?x?xi32>, vector<[4]xi32>
   }
 
   // Dump "mem1". The smallest SVL is 128-bits so each tile will be at least
@@ -213,32 +213,32 @@ func.func @load_store_two_za_s_tiles() -> i32 {
   // CHECK-NEXT: ( 2, 2, 2, 2
   // CHECK-NEXT: ( 2, 2, 2, 2
   // CHECK-NEXT: ( 2, 2, 2, 2
-  scf.for %i = %c0 to %size_of_two_tiles step %svl_s {
-    %tileslice = vector.load %mem1[%i] : memref<?xi32>, vector<[4]xi32>
+  scf.for %i = %c0 to %svl_s_x_2 step %c1_index {
+    %tileslice = vector.load %mem1[%i, %c0] : memref<?x?xi32>, vector<[4]xi32>
     vector.print %tileslice : vector<[4]xi32>
   }
 
   // Load tile 1 from memory
-  %za0_s = vector.load %mem1[%c0] : memref<?xi32>, vector<[4]x[4]xi32>
+  %za0_s = vector.load %mem1[%c0, %c0] : memref<?x?xi32>, vector<[4]x[4]xi32>
 
   // Load tile 2 from memory
-  %za1_s = vector.load %mem1[%size_of_tile] : memref<?xi32>, vector<[4]x[4]xi32>
+  %za1_s = vector.load %mem1[%svl_s, %c0] : memref<?x?xi32>, vector<[4]x[4]xi32>
 
   // Allocate new memory to store tiles to
-  %mem2 = memref.alloca(%size_of_two_tiles)  : memref<?xi32>
+  %mem2 = memref.alloca(%svl_s_x_2, %svl_s)  : memref<?x?xi32>
 
   // Zero new memory
-  scf.for %i = %c0 to %size_of_two_tiles step %c1_index {
-    memref.store %c0_i32, %mem2[%i] : memref<?xi32>
+  scf.for %i = %c0 to %svl_s_x_2 step %c1_index {
+    memref.store %c0_i32, %mem2[%i, %c0] : memref<?x?xi32>
   }
 
   // Stores tiles back to (new) memory in reverse order
 
   // Store tile 2 to memory
-  vector.store %za1_s, %mem2[%c0] : memref<?xi32>, vector<[4]x[4]xi32>
+  vector.store %za1_s, %mem2[%c0, %c0] : memref<?x?xi32>, vector<[4]x[4]xi32>
 
   // Store tile 1 to memory
-  vector.store %za0_s, %mem2[%size_of_tile] : memref<?xi32>, vector<[4]x[4]xi32>
+  vector.store %za0_s, %mem2[%svl_s, %c0] : memref<?x?xi32>, vector<[4]x[4]xi32>
 
   // Dump "mem2" and check the tiles were stored in reverse order. The smallest
   // SVL is 128-bits so the tiles will be at least 4x4xi32.
@@ -256,12 +256,12 @@ func.func @load_store_two_za_s_tiles() -> i32 {
   // CHECK-NEXT: ( 1, 1, 1, 1
   // CHECK:      TILE END
   vector.print str "TILE BEGIN\n"
-  scf.for %i = %c0 to %size_of_two_tiles step %svl_s {
-    %av = vector.load %mem2[%i] : memref<?xi32>, vector<[4]xi32>
+  scf.for %i = %c0 to %svl_s_x_2 step %c1_index {
+    %av = vector.load %mem2[%i, %c0] : memref<?x?xi32>, vector<[4]xi32>
     vector.print %av : vector<[4]xi32>
 
-    %tileSizeMinusStep = arith.subi %size_of_tile, %svl_s : index
-    %isNextTile = arith.cmpi eq, %i, %tileSizeMinusStep : index
+    %tileSizeMinusStep = arith.subi %svl_s, %c1_index : index
+    %isNextTile = arith.cmpi eq, %i, %svl_s : index
     scf.if %isNextTile {
       vector.print str "TILE END\n"
       vector.print str "TILE BEGIN\n"

>From 052225dc0366ddf56631b1e4104ef09896f1139b Mon Sep 17 00:00:00 2001
From: David Green <david.green at arm.com>
Date: Fri, 11 Apr 2025 20:18:26 +0100
Subject: [PATCH 33/76] [AArch64] Use a lower Costsize cost in
 getScalarizationOverhead.

This is a follow on to #130946 to use the same codesize cost override in
getScalarizationOverhead for vector instructions.
---
 .../AArch64/AArch64TargetTransformInfo.cpp    |  5 +-
 llvm/test/Analysis/CostModel/AArch64/bswap.ll |  2 +-
 llvm/test/Analysis/CostModel/AArch64/ctlz.ll  |  4 +-
 llvm/test/Analysis/CostModel/AArch64/cttz.ll  | 28 +++++------
 .../Analysis/CostModel/AArch64/masked_ldst.ll | 36 +++++++-------
 .../CostModel/AArch64/mem-op-cost-model.ll    | 48 +++++++++----------
 .../CostModel/AArch64/sve-intrinsics.ll       | 20 ++++----
 7 files changed, 72 insertions(+), 71 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index b1d8277182add..ca1a486901951 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -3832,8 +3832,9 @@ InstructionCost AArch64TTIImpl::getScalarizationOverhead(
   if (Ty->getElementType()->isFloatingPointTy())
     return BaseT::getScalarizationOverhead(Ty, DemandedElts, Insert, Extract,
                                            CostKind);
-  return DemandedElts.popcount() * (Insert + Extract) *
-         ST->getVectorInsertExtractBaseCost();
+  unsigned VecInstCost =
+      CostKind == TTI::TCK_CodeSize ? 1 : ST->getVectorInsertExtractBaseCost();
+  return DemandedElts.popcount() * (Insert + Extract) * VecInstCost;
 }
 
 InstructionCost AArch64TTIImpl::getArithmeticInstrCost(
diff --git a/llvm/test/Analysis/CostModel/AArch64/bswap.ll b/llvm/test/Analysis/CostModel/AArch64/bswap.ll
index 8dad1f218577a..2df508ebe40bc 100644
--- a/llvm/test/Analysis/CostModel/AArch64/bswap.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/bswap.ll
@@ -44,7 +44,7 @@ define void @neon() {
 ; CHECK-NEXT:  Cost Model: Found costs of 1 for: %v2i64 = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found costs of 2 for: %v4i64 = call <4 x i64> @llvm.bswap.v4i64(<4 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found costs of 1 for: %v3i32 = call <3 x i32> @llvm.bswap.v3i32(<3 x i32> undef)
-; CHECK-NEXT:  Cost Model: Found costs of 12 for: %v4i48 = call <4 x i48> @llvm.bswap.v4i48(<4 x i48> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:12 CodeSize:8 Lat:12 SizeLat:12 for: %v4i48 = call <4 x i48> @llvm.bswap.v4i48(<4 x i48> undef)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
   %v4i16 = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> undef)
diff --git a/llvm/test/Analysis/CostModel/AArch64/ctlz.ll b/llvm/test/Analysis/CostModel/AArch64/ctlz.ll
index 4ad359d4d2c68..34e7f87028477 100644
--- a/llvm/test/Analysis/CostModel/AArch64/ctlz.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/ctlz.ll
@@ -55,7 +55,7 @@ declare i8 @llvm.ctlz.i8(i8)
 define <2 x i64> @test_ctlz_v2i64(<2 x i64> %a) {
 ;
 ; CHECK-LABEL: 'test_ctlz_v2i64'
-; CHECK-NEXT:  Cost Model: Found costs of 10 for: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:6 Lat:10 SizeLat:10 for: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i64> %ctlz
 ;
   %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false)
@@ -154,7 +154,7 @@ define <16 x i8> @test_ctlz_v16i8(<16 x i8> %a) {
 
 define <4 x i64> @test_ctlz_v4i64(<4 x i64> %a) {
 ; CHECK-LABEL: 'test_ctlz_v4i64'
-; CHECK-NEXT:  Cost Model: Found costs of 20 for: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i64> %ctlz
 ;
   %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
diff --git a/llvm/test/Analysis/CostModel/AArch64/cttz.ll b/llvm/test/Analysis/CostModel/AArch64/cttz.ll
index 021eb73234f31..6f7810372388a 100644
--- a/llvm/test/Analysis/CostModel/AArch64/cttz.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/cttz.ll
@@ -55,7 +55,7 @@ declare i8 @llvm.cttz.i8(i8)
 define <2 x i64> @test_cttz_v2i64(<2 x i64> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v2i64'
-; CHECK-NEXT:  Cost Model: Found costs of 10 for: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:6 Lat:10 SizeLat:10 for: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i64> %cttz
 ;
   %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
@@ -65,7 +65,7 @@ define <2 x i64> @test_cttz_v2i64(<2 x i64> %a) {
 define <2 x i32> @test_cttz_v2i32(<2 x i32> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v2i32'
-; CHECK-NEXT:  Cost Model: Found costs of 10 for: %cttz = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:6 Lat:10 SizeLat:10 for: %cttz = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i32> %cttz
 ;
   %cttz = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 true)
@@ -75,7 +75,7 @@ define <2 x i32> @test_cttz_v2i32(<2 x i32> %a) {
 define <4 x i32> @test_cttz_v4i32(<4 x i32> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v4i32'
-; CHECK-NEXT:  Cost Model: Found costs of 20 for: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %cttz
 ;
   %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
@@ -85,7 +85,7 @@ define <4 x i32> @test_cttz_v4i32(<4 x i32> %a) {
 define <2 x i16> @test_cttz_v2i16(<2 x i16> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v2i16'
-; CHECK-NEXT:  Cost Model: Found costs of 10 for: %cttz = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:6 Lat:10 SizeLat:10 for: %cttz = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i16> %cttz
 ;
   %cttz = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> %a, i1 true)
@@ -95,7 +95,7 @@ define <2 x i16> @test_cttz_v2i16(<2 x i16> %a) {
 define <4 x i16> @test_cttz_v4i16(<4 x i16> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v4i16'
-; CHECK-NEXT:  Cost Model: Found costs of 20 for: %cttz = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %cttz = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i16> %cttz
 ;
   %cttz = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> %a, i1 true)
@@ -105,7 +105,7 @@ define <4 x i16> @test_cttz_v4i16(<4 x i16> %a) {
 define <8 x i16> @test_cttz_v8i16(<8 x i16> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v8i16'
-; CHECK-NEXT:  Cost Model: Found costs of 40 for: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:24 Lat:40 SizeLat:40 for: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i16> %cttz
 ;
   %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
@@ -115,7 +115,7 @@ define <8 x i16> @test_cttz_v8i16(<8 x i16> %a) {
 define <2 x i8> @test_cttz_v2i8(<2 x i8> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v2i8'
-; CHECK-NEXT:  Cost Model: Found costs of 10 for: %cttz = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:6 Lat:10 SizeLat:10 for: %cttz = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i8> %cttz
 ;
   %cttz = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> %a, i1 true)
@@ -125,7 +125,7 @@ define <2 x i8> @test_cttz_v2i8(<2 x i8> %a) {
 define <4 x i8> @test_cttz_v4i8(<4 x i8> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v4i8'
-; CHECK-NEXT:  Cost Model: Found costs of 20 for: %cttz = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %cttz = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %cttz
 ;
   %cttz = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> %a, i1 true)
@@ -135,7 +135,7 @@ define <4 x i8> @test_cttz_v4i8(<4 x i8> %a) {
 define <8 x i8> @test_cttz_v8i8(<8 x i8> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v8i8'
-; CHECK-NEXT:  Cost Model: Found costs of 40 for: %cttz = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:24 Lat:40 SizeLat:40 for: %cttz = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i8> %cttz
 ;
   %cttz = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> %a, i1 true)
@@ -145,7 +145,7 @@ define <8 x i8> @test_cttz_v8i8(<8 x i8> %a) {
 define <16 x i8> @test_cttz_v16i8(<16 x i8> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v16i8'
-; CHECK-NEXT:  Cost Model: Found costs of 80 for: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:48 Lat:80 SizeLat:80 for: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <16 x i8> %cttz
 ;
   %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
@@ -155,7 +155,7 @@ define <16 x i8> @test_cttz_v16i8(<16 x i8> %a) {
 define <4 x i64> @test_cttz_v4i64(<4 x i64> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v4i64'
-; CHECK-NEXT:  Cost Model: Found costs of 20 for: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i64> %cttz
 ;
   %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
@@ -165,7 +165,7 @@ define <4 x i64> @test_cttz_v4i64(<4 x i64> %a) {
 define <8 x i32> @test_cttz_v8i32(<8 x i32> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v8i32'
-; CHECK-NEXT:  Cost Model: Found costs of 40 for: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:24 Lat:40 SizeLat:40 for: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i32> %cttz
 ;
   %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
@@ -175,7 +175,7 @@ define <8 x i32> @test_cttz_v8i32(<8 x i32> %a) {
 define <16 x i16> @test_cttz_v16i16(<16 x i16> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v16i16'
-; CHECK-NEXT:  Cost Model: Found costs of 80 for: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:48 Lat:80 SizeLat:80 for: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <16 x i16> %cttz
 ;
   %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
@@ -185,7 +185,7 @@ define <16 x i16> @test_cttz_v16i16(<16 x i16> %a) {
 define <32 x i8> @test_cttz_v32i8(<32 x i8> %a) {
 ;
 ; CHECK-LABEL: 'test_cttz_v32i8'
-; CHECK-NEXT:  Cost Model: Found costs of 160 for: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:160 CodeSize:96 Lat:160 SizeLat:160 for: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <32 x i8> %cttz
 ;
   %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
diff --git a/llvm/test/Analysis/CostModel/AArch64/masked_ldst.ll b/llvm/test/Analysis/CostModel/AArch64/masked_ldst.ll
index 5a1ed4e7e07ae..56ae1ac86c825 100644
--- a/llvm/test/Analysis/CostModel/AArch64/masked_ldst.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/masked_ldst.ll
@@ -5,24 +5,24 @@ target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
 
 define void @fixed() {
 ; CHECK-LABEL: 'fixed'
-; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:12 Lat:12 SizeLat:12 for: %v2i8 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i8> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:24 Lat:24 SizeLat:24 for: %v4i8 = call <4 x i8> @llvm.masked.load.v4i8.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i8> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:48 Lat:48 SizeLat:48 for: %v8i8 = call <8 x i8> @llvm.masked.load.v8i8.p0(ptr undef, i32 8, <8 x i1> undef, <8 x i8> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:96 Lat:96 SizeLat:96 for: %v16i8 = call <16 x i8> @llvm.masked.load.v16i8.p0(ptr undef, i32 8, <16 x i1> undef, <16 x i8> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:12 Lat:12 SizeLat:12 for: %v2i16 = call <2 x i16> @llvm.masked.load.v2i16.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i16> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:24 Lat:24 SizeLat:24 for: %v4i16 = call <4 x i16> @llvm.masked.load.v4i16.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i16> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:48 Lat:48 SizeLat:48 for: %v8i16 = call <8 x i16> @llvm.masked.load.v8i16.p0(ptr undef, i32 8, <8 x i1> undef, <8 x i16> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:12 Lat:12 SizeLat:12 for: %v2i32 = call <2 x i32> @llvm.masked.load.v2i32.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i32> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:24 Lat:24 SizeLat:24 for: %v4i32 = call <4 x i32> @llvm.masked.load.v4i32.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i32> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:12 Lat:12 SizeLat:12 for: %v2i64 = call <2 x i64> @llvm.masked.load.v2i64.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i64> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:10 SizeLat:10 for: %v2f16 = call <2 x half> @llvm.masked.load.v2f16.p0(ptr undef, i32 8, <2 x i1> undef, <2 x half> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:18 CodeSize:19 Lat:22 SizeLat:22 for: %v4f16 = call <4 x half> @llvm.masked.load.v4f16.p0(ptr undef, i32 8, <4 x i1> undef, <4 x half> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:38 CodeSize:39 Lat:46 SizeLat:46 for: %v8f16 = call <8 x half> @llvm.masked.load.v8f16.p0(ptr undef, i32 8, <8 x i1> undef, <8 x half> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:10 SizeLat:10 for: %v2f32 = call <2 x float> @llvm.masked.load.v2f32.p0(ptr undef, i32 8, <2 x i1> undef, <2 x float> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:18 CodeSize:19 Lat:22 SizeLat:22 for: %v4f32 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr undef, i32 8, <4 x i1> undef, <4 x float> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:10 SizeLat:10 for: %v2f64 = call <2 x double> @llvm.masked.load.v2f64.p0(ptr undef, i32 8, <2 x i1> undef, <2 x double> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:24 Lat:24 SizeLat:24 for: %v4i64 = call <4 x i64> @llvm.masked.load.v4i64.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i64> undef)
-; CHECK-NEXT:  Cost Model: Found costs of RThru:152 CodeSize:156 Lat:184 SizeLat:184 for: %v32f16 = call <32 x half> @llvm.masked.load.v32f16.p0(ptr undef, i32 8, <32 x i1> undef, <32 x half> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:8 Lat:12 SizeLat:12 for: %v2i8 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i8> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:16 Lat:24 SizeLat:24 for: %v4i8 = call <4 x i8> @llvm.masked.load.v4i8.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i8> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:32 Lat:48 SizeLat:48 for: %v8i8 = call <8 x i8> @llvm.masked.load.v8i8.p0(ptr undef, i32 8, <8 x i1> undef, <8 x i8> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:64 Lat:96 SizeLat:96 for: %v16i8 = call <16 x i8> @llvm.masked.load.v16i8.p0(ptr undef, i32 8, <16 x i1> undef, <16 x i8> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:8 Lat:12 SizeLat:12 for: %v2i16 = call <2 x i16> @llvm.masked.load.v2i16.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:16 Lat:24 SizeLat:24 for: %v4i16 = call <4 x i16> @llvm.masked.load.v4i16.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:32 Lat:48 SizeLat:48 for: %v8i16 = call <8 x i16> @llvm.masked.load.v8i16.p0(ptr undef, i32 8, <8 x i1> undef, <8 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:8 Lat:12 SizeLat:12 for: %v2i32 = call <2 x i32> @llvm.masked.load.v2i32.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:16 Lat:24 SizeLat:24 for: %v4i32 = call <4 x i32> @llvm.masked.load.v4i32.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:10 CodeSize:8 Lat:12 SizeLat:12 for: %v2i64 = call <2 x i64> @llvm.masked.load.v2i64.p0(ptr undef, i32 8, <2 x i1> undef, <2 x i64> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:7 Lat:10 SizeLat:10 for: %v2f16 = call <2 x half> @llvm.masked.load.v2f16.p0(ptr undef, i32 8, <2 x i1> undef, <2 x half> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:18 CodeSize:15 Lat:22 SizeLat:22 for: %v4f16 = call <4 x half> @llvm.masked.load.v4f16.p0(ptr undef, i32 8, <4 x i1> undef, <4 x half> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:38 CodeSize:31 Lat:46 SizeLat:46 for: %v8f16 = call <8 x half> @llvm.masked.load.v8f16.p0(ptr undef, i32 8, <8 x i1> undef, <8 x half> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:7 Lat:10 SizeLat:10 for: %v2f32 = call <2 x float> @llvm.masked.load.v2f32.p0(ptr undef, i32 8, <2 x i1> undef, <2 x float> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:18 CodeSize:15 Lat:22 SizeLat:22 for: %v4f32 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr undef, i32 8, <4 x i1> undef, <4 x float> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:7 Lat:10 SizeLat:10 for: %v2f64 = call <2 x double> @llvm.masked.load.v2f64.p0(ptr undef, i32 8, <2 x i1> undef, <2 x double> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:16 Lat:24 SizeLat:24 for: %v4i64 = call <4 x i64> @llvm.masked.load.v4i64.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i64> undef)
+; CHECK-NEXT:  Cost Model: Found costs of RThru:152 CodeSize:124 Lat:184 SizeLat:184 for: %v32f16 = call <32 x half> @llvm.masked.load.v32f16.p0(ptr undef, i32 8, <32 x i1> undef, <32 x half> undef)
 ; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 entry:
diff --git a/llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll b/llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll
index fb54f8de023cd..ae638e5dd366d 100644
--- a/llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/mem-op-cost-model.ll
@@ -190,11 +190,11 @@ declare <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr>, i32 immarg, <4 x i1>,
 define <4 x i8> @gather_load_4xi8_constant_mask(<4 x ptr> %ptrs) {
 ; CHECK:         gather_load_4xi8_constant_mask
 ; CHECK-NEON-LABEL: 'gather_load_4xi8_constant_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of 20 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %lv
 ;
 ; CHECK-SVE-128-LABEL: 'gather_load_4xi8_constant_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of 20 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i8> undef)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %lv
 ;
 ; CHECK-SVE-256-LABEL: 'gather_load_4xi8_constant_mask'
@@ -212,11 +212,11 @@ define <4 x i8> @gather_load_4xi8_constant_mask(<4 x ptr> %ptrs) {
 define <4 x i8> @gather_load_4xi8_variable_mask(<4 x ptr> %ptrs, <4 x i1> %cond) {
 ; CHECK:         gather_load_4xi8_variable_mask
 ; CHECK-NEON-LABEL: 'gather_load_4xi8_variable_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %lv
 ;
 ; CHECK-SVE-128-LABEL: 'gather_load_4xi8_variable_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %lv = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i8> undef)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %lv
 ;
 ; CHECK-SVE-256-LABEL: 'gather_load_4xi8_variable_mask'
@@ -235,11 +235,11 @@ declare void @llvm.masked.scatter.v4i8.v4p0(<4 x i8>, <4 x ptr>, i32 immarg, <4
 define void @scatter_store_4xi8_constant_mask(<4 x i8> %val, <4 x ptr> %ptrs) {
 ; CHECK:         scatter_store_4xi8_constant_mask
 ; CHECK-NEON-LABEL: 'scatter_store_4xi8_constant_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of 20 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi8_constant_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of 20 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi8_constant_mask'
@@ -257,11 +257,11 @@ define void @scatter_store_4xi8_constant_mask(<4 x i8> %val, <4 x ptr> %ptrs) {
 define void @scatter_store_4xi8_variable_mask(<4 x i8> %val, <4 x ptr> %ptrs, <4 x i1> %cond) {
 ; CHECK:         scatter_store_4xi8_variable_mask
 ; CHECK-NEON-LABEL: 'scatter_store_4xi8_variable_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi8_variable_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi8_variable_mask'
@@ -280,11 +280,11 @@ declare <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr>, i32 immarg, <4 x i1>
 define <4 x i32> @gather_load_4xi32_constant_mask(<4 x ptr> %ptrs) {
 ; CHECK:         gather_load_4xi32_constant_mask
 ; CHECK-NEON-LABEL: 'gather_load_4xi32_constant_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of 20 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %lv
 ;
 ; CHECK-SVE-128-LABEL: 'gather_load_4xi32_constant_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of 20 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true), <4 x i32> undef)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %lv
 ;
 ; CHECK-SVE-256-LABEL: 'gather_load_4xi32_constant_mask'
@@ -302,11 +302,11 @@ define <4 x i32> @gather_load_4xi32_constant_mask(<4 x ptr> %ptrs) {
 define <4 x i32> @gather_load_4xi32_variable_mask(<4 x ptr> %ptrs, <4 x i1> %cond) {
 ; CHECK:         gather_load_4xi32_variable_mask
 ; CHECK-NEON-LABEL: 'gather_load_4xi32_variable_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %lv
 ;
 ; CHECK-SVE-128-LABEL: 'gather_load_4xi32_variable_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %lv = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 1, <4 x i1> %cond, <4 x i32> undef)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %lv
 ;
 ; CHECK-SVE-256-LABEL: 'gather_load_4xi32_variable_mask'
@@ -325,11 +325,11 @@ declare void @llvm.masked.scatter.v4i32.v4p0(<4 x i32>, <4 x ptr>, i32 immarg, <
 define void @scatter_store_4xi32_constant_mask(<4 x i32> %val, <4 x ptr> %ptrs) {
 ; CHECK:         scatter_store_4xi32_constant_mask
 ; CHECK-NEON-LABEL: 'scatter_store_4xi32_constant_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of 20 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi32_constant_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of 20 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:20 CodeSize:12 Lat:20 SizeLat:20 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> splat (i1 true))
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi32_constant_mask'
@@ -347,11 +347,11 @@ define void @scatter_store_4xi32_constant_mask(<4 x i32> %val, <4 x ptr> %ptrs)
 define void @scatter_store_4xi32_variable_mask(<4 x i32> %val, <4 x ptr> %ptrs, <4 x i1> %cond) {
 ; CHECK:         scatter_store_4xi32_variable_mask
 ; CHECK-NEON-LABEL: 'scatter_store_4xi32_variable_mask'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'scatter_store_4xi32_variable_mask'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %val, <4 x ptr> %ptrs, i32 1, <4 x i1> %cond)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'scatter_store_4xi32_variable_mask'
@@ -370,11 +370,11 @@ declare <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr>, i32, <256 x
 define void @sve_gather_vls(<256 x i1> %v256i1mask) {
 ; CHECK-LABEL: 'sve_scatter_vls'
 ; CHECK-NEON-LABEL: 'sve_gather_vls'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:2048 Lat:2048 SizeLat:2048 for: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:1280 Lat:2048 SizeLat:2048 for: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'sve_gather_vls'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:2048 Lat:2048 SizeLat:2048 for: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:1280 Lat:2048 SizeLat:2048 for: %res.v256i16 = call <256 x i16> @llvm.masked.gather.v256i16.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x i16> zeroinitializer)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'sve_gather_vls'
@@ -394,11 +394,11 @@ declare <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr>, i32, <256
 define void @sve_gather_vls_float(<256 x i1> %v256i1mask) {
 ; CHECK-LABEL: 'sve_gather_vls_float'
 ; CHECK-NEON-LABEL: 'sve_gather_vls_float'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1664 CodeSize:1728 Lat:1920 SizeLat:1920 for: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1664 CodeSize:1216 Lat:1920 SizeLat:1920 for: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'sve_gather_vls_float'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1664 CodeSize:1728 Lat:1920 SizeLat:1920 for: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1664 CodeSize:1216 Lat:1920 SizeLat:1920 for: %res.v256f32 = call <256 x float> @llvm.masked.gather.v256f32.v256p0(<256 x ptr> undef, i32 0, <256 x i1> %v256i1mask, <256 x float> zeroinitializer)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'sve_gather_vls_float'
@@ -418,11 +418,11 @@ declare void @llvm.masked.scatter.v256i8.v256p0(<256 x i8>, <256 x ptr>, i32, <2
 define void @sve_scatter_vls(<256 x i1> %v256i1mask){
 ; CHECK-LABEL: 'sve_scatter_vls'
 ; CHECK-NEON-LABEL: 'sve_scatter_vls'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:2048 Lat:2048 SizeLat:2048 for: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:1280 Lat:2048 SizeLat:2048 for: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'sve_scatter_vls'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:2048 Lat:2048 SizeLat:2048 for: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:1792 CodeSize:1280 Lat:2048 SizeLat:2048 for: call void @llvm.masked.scatter.v256i8.v256p0(<256 x i8> undef, <256 x ptr> undef, i32 0, <256 x i1> %v256i1mask)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'sve_scatter_vls'
@@ -442,11 +442,11 @@ declare void @llvm.masked.scatter.v512f16.v512p0(<512 x half>, <512 x ptr>, i32,
 define void @sve_scatter_vls_float(<512 x i1> %v512i1mask){
 ; CHECK-LABEL: 'sve_scatter_vls_float'
 ; CHECK-NEON-LABEL: 'sve_scatter_vls_float'
-; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:3456 CodeSize:3520 Lat:3968 SizeLat:3968 for: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
+; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:3456 CodeSize:2496 Lat:3968 SizeLat:3968 for: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
 ; CHECK-NEON-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-128-LABEL: 'sve_scatter_vls_float'
-; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:3456 CodeSize:3520 Lat:3968 SizeLat:3968 for: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
+; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:3456 CodeSize:2496 Lat:3968 SizeLat:3968 for: call void @llvm.masked.scatter.v512f16.v512p0(<512 x half> undef, <512 x ptr> undef, i32 0, <512 x i1> %v512i1mask)
 ; CHECK-SVE-128-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-SVE-256-LABEL: 'sve_scatter_vls_float'
diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll b/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
index 308a3785c9f05..1483d476bef0d 100644
--- a/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
@@ -1103,15 +1103,15 @@ define <vscale x 8 x i32> @masked_gather_nxv8i32(<vscale x 8 x ptr> %ld, <vscale
 
 define <4 x i32> @masked_gather_v4i32(<4 x ptr> %ld, <4 x i1> %masks, <4 x i32> %passthru) {
 ; CHECK-VSCALE-1-LABEL: 'masked_gather_v4i32'
-; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
+; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
 ; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %res
 ;
 ; CHECK-VSCALE-2-LABEL: 'masked_gather_v4i32'
-; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
+; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
 ; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %res
 ;
 ; TYPE_BASED_ONLY-LABEL: 'masked_gather_v4i32'
-; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of 36 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
+; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of RThru:36 CodeSize:20 Lat:36 SizeLat:36 for: %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
 ; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %res
 ;
   %res = call <4 x i32> @llvm.masked.gather.v4i32(<4 x ptr> %ld, i32 0, <4 x i1> %masks, <4 x i32> %passthru)
@@ -1120,11 +1120,11 @@ define <4 x i32> @masked_gather_v4i32(<4 x ptr> %ld, <4 x i1> %masks, <4 x i32>
 
 define <1 x i128> @masked_gather_v1i128(<1 x ptr> %ld, <1 x i1> %masks, <1 x i128> %passthru) {
 ; CHECK-VSCALE-1-LABEL: 'masked_gather_v1i128'
-; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:8 SizeLat:9 for: %res = call <1 x i128> @llvm.masked.gather.v1i128.v1p0(<1 x ptr> %ld, i32 0, <1 x i1> %masks, <1 x i128> %passthru)
+; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:9 for: %res = call <1 x i128> @llvm.masked.gather.v1i128.v1p0(<1 x ptr> %ld, i32 0, <1 x i1> %masks, <1 x i128> %passthru)
 ; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <1 x i128> %res
 ;
 ; CHECK-VSCALE-2-LABEL: 'masked_gather_v1i128'
-; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:8 SizeLat:9 for: %res = call <1 x i128> @llvm.masked.gather.v1i128.v1p0(<1 x ptr> %ld, i32 0, <1 x i1> %masks, <1 x i128> %passthru)
+; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:9 for: %res = call <1 x i128> @llvm.masked.gather.v1i128.v1p0(<1 x ptr> %ld, i32 0, <1 x i1> %masks, <1 x i128> %passthru)
 ; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <1 x i128> %res
 ;
 ; TYPE_BASED_ONLY-LABEL: 'masked_gather_v1i128'
@@ -1173,15 +1173,15 @@ define void @masked_scatter_nxv8i32(<vscale x 8 x i32> %data, <vscale x 8 x ptr>
 
 define void @masked_scatter_v4i32(<4 x i32> %data, <4 x ptr> %ptrs, <4 x i1> %masks) {
 ; CHECK-VSCALE-1-LABEL: 'masked_scatter_v4i32'
-; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
+; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
 ; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-VSCALE-2-LABEL: 'masked_scatter_v4i32'
-; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:32 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
+; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:20 Lat:32 SizeLat:32 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
 ; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; TYPE_BASED_ONLY-LABEL: 'masked_scatter_v4i32'
-; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of 28 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
+; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of RThru:28 CodeSize:16 Lat:28 SizeLat:28 for: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
 ; TYPE_BASED_ONLY-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 
@@ -1191,11 +1191,11 @@ define void @masked_scatter_v4i32(<4 x i32> %data, <4 x ptr> %ptrs, <4 x i1> %ma
 
 define void @masked_scatter_v1i128(<1 x i128> %data, <1 x ptr> %ptrs, <1 x i1> %masks) {
 ; CHECK-VSCALE-1-LABEL: 'masked_scatter_v1i128'
-; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:8 SizeLat:9 for: call void @llvm.masked.scatter.v1i128.v1p0(<1 x i128> %data, <1 x ptr> %ptrs, i32 0, <1 x i1> %masks)
+; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:9 for: call void @llvm.masked.scatter.v1i128.v1p0(<1 x i128> %data, <1 x ptr> %ptrs, i32 0, <1 x i1> %masks)
 ; CHECK-VSCALE-1-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; CHECK-VSCALE-2-LABEL: 'masked_scatter_v1i128'
-; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:9 Lat:8 SizeLat:9 for: call void @llvm.masked.scatter.v1i128.v1p0(<1 x i128> %data, <1 x ptr> %ptrs, i32 0, <1 x i1> %masks)
+; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:9 for: call void @llvm.masked.scatter.v1i128.v1p0(<1 x i128> %data, <1 x ptr> %ptrs, i32 0, <1 x i1> %masks)
 ; CHECK-VSCALE-2-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; TYPE_BASED_ONLY-LABEL: 'masked_scatter_v1i128'

>From 32c39092eab3a401d9d028c21f4707102fd70e32 Mon Sep 17 00:00:00 2001
From: Ikhlas Ajbar <iajbar at quicinc.com>
Date: Fri, 11 Apr 2025 14:25:50 -0500
Subject: [PATCH 34/76] [llvm][Hexagon] Promote operand v2i1 to v2i32 (#135409)

Fixes #118879
---
 llvm/lib/Target/Hexagon/HexagonCallingConv.td |  1 +
 llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll

diff --git a/llvm/lib/Target/Hexagon/HexagonCallingConv.td b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
index 2378bbc928d49..e0302b85fa948 100644
--- a/llvm/lib/Target/Hexagon/HexagonCallingConv.td
+++ b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
@@ -65,6 +65,7 @@ def CC_Hexagon: CallingConv<[
   CCIfType<[i32],
     CCIfSplit<
       CCCustom<"CC_SkipOdd">>>,
+  CCIfType<[v2i1],  CCPromoteToType<v2i32>>,
   CCIfType<[v4i1],  CCPromoteToType<v4i16>>,
   CCIfType<[v8i1],  CCPromoteToType<v8i8>>,
 
diff --git a/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll b/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll
new file mode 100644
index 0000000000000..2dcd5fe571e36
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll
@@ -0,0 +1,14 @@
+;RUN: llc -mtriple=hexagon  < %s | FileCheck %s
+
+; Check that v2i1 type is promoted to v2i32.
+; CHECK: call f
+; CHECK: r{{[0-9]+}}:{{[0-9]+}} = memd(r29+#8)
+
+define  <2 x i1> @test(<2 x i1> %1) {
+Entry:
+   %2 = call <2 x i1> @f(<2 x i1> %1)
+  ret <2 x i1> %2
+
+  }
+
+declare <2 x i1> @f(<2 x i1>)

>From a45b133d400b0e57ca1ba70d50a91fbdf11d3b93 Mon Sep 17 00:00:00 2001
From: Shilei Tian <i at tianshilei.me>
Date: Fri, 11 Apr 2025 15:32:37 -0400
Subject: [PATCH 35/76] [AMDGPU][Verifier] Mark calls to entry functions as
 invalid in the IR verifier (#134910)

---
 llvm/include/llvm/IR/CallingConv.h            |  21 +
 llvm/lib/IR/Verifier.cpp                      |  11 +-
 llvm/test/Bitcode/calling-conventions.3.2.ll  |   6 -
 .../Bitcode/calling-conventions.3.2.ll.bc     | Bin 2568 -> 2888 bytes
 .../AMDGPU/attributor-flatscratchinit.ll      |  15 -
 .../AMDGPU/call-to-kernel-undefined.ll        |  20 -
 llvm/test/CodeGen/AMDGPU/call-to-kernel.ll    |  18 -
 llvm/test/Other/spir_cc.ll                    |   1 -
 llvm/test/Verifier/amdgpu-cc.ll               |  23 -
 .../call-to-non-callable-functions.ll         | 529 ++++++++++++++++++
 10 files changed, 553 insertions(+), 91 deletions(-)
 delete mode 100644 llvm/test/CodeGen/AMDGPU/call-to-kernel-undefined.ll
 delete mode 100644 llvm/test/CodeGen/AMDGPU/call-to-kernel.ll
 create mode 100644 llvm/test/Verifier/call-to-non-callable-functions.ll

diff --git a/llvm/include/llvm/IR/CallingConv.h b/llvm/include/llvm/IR/CallingConv.h
index 7897aabb6c1a9..d68491eb5535c 100644
--- a/llvm/include/llvm/IR/CallingConv.h
+++ b/llvm/include/llvm/IR/CallingConv.h
@@ -290,6 +290,27 @@ namespace CallingConv {
 
 } // end namespace CallingConv
 
+/// \return true if the calling convention allows the function to be called
+/// directly or indirectly via a call-like instruction.
+constexpr bool isCallableCC(CallingConv::ID CC) {
+  switch (CC) {
+  case CallingConv::AMDGPU_CS_Chain:
+  case CallingConv::AMDGPU_CS_ChainPreserve:
+  case CallingConv::AMDGPU_CS:
+  case CallingConv::AMDGPU_ES:
+  case CallingConv::AMDGPU_GS:
+  case CallingConv::AMDGPU_HS:
+  case CallingConv::AMDGPU_KERNEL:
+  case CallingConv::AMDGPU_LS:
+  case CallingConv::AMDGPU_PS:
+  case CallingConv::AMDGPU_VS:
+  case CallingConv::SPIR_KERNEL:
+    return false;
+  default:
+    return true;
+  }
+}
+
 } // end namespace llvm
 
 #endif // LLVM_IR_CALLINGCONV_H
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 7d32bf29ae108..e3f6c1ad5a65b 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3596,14 +3596,9 @@ void Verifier::visitCallBase(CallBase &Call) {
     Check(Callee->getValueType() == FTy,
           "Intrinsic called with incompatible signature", Call);
 
-  // Disallow calls to functions with the amdgpu_cs_chain[_preserve] calling
-  // convention.
-  auto CC = Call.getCallingConv();
-  Check(CC != CallingConv::AMDGPU_CS_Chain &&
-            CC != CallingConv::AMDGPU_CS_ChainPreserve,
-        "Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions "
-        "not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.",
-        Call);
+  // Verify if the calling convention of the callee is callable.
+  Check(isCallableCC(Call.getCallingConv()),
+        "calling convention does not permit calls", Call);
 
   // Disallow passing/returning values with alignment higher than we can
   // represent.
diff --git a/llvm/test/Bitcode/calling-conventions.3.2.ll b/llvm/test/Bitcode/calling-conventions.3.2.ll
index 9221ef30c8dc9..678886777ad4c 100644
--- a/llvm/test/Bitcode/calling-conventions.3.2.ll
+++ b/llvm/test/Bitcode/calling-conventions.3.2.ll
@@ -80,12 +80,6 @@ define void @call_cc10 () {
   ret void
 }
 
-define void @call_spir_kernel() {
-; CHECK: call spir_kernel void @spir_kernel
-  call spir_kernel void @spir_kernel()
-  ret void
-}
-
 define void @call_spir_func() {
 ; CHECK: call spir_func void @spir_func
   call spir_func void @spir_func()
diff --git a/llvm/test/Bitcode/calling-conventions.3.2.ll.bc b/llvm/test/Bitcode/calling-conventions.3.2.ll.bc
index b7ac769a82b34aeabe70edab8562f53bc0601f31..19cdf69be1c26552e8208b56efc3feba41caf047 100644
GIT binary patch
delta 1749
zcmZ9NeN0<b7{*U~`^DC at d{dx>URDXtY`ruwX=yv5#o2u+A(~(&fr at 1?`6#r5u^4+x
zyOn7TCDee?#dc%BmZ+c;FhMPJTZ)v~Ik#0|j2b$aLCHw}&`lH1EnvHQ{<tUicc1gV
z&->ilv at 6w@UZ_%g7N1WAfDQn7lZ}avy#C!_<&!I~Wcx&=6bT)mYygU>0PLiq0B#_&
zr|^)eg5&5xOC9dc^VCc)b2cqgVz)n&C at 3=e05~fIAOQ;VYH5jIsyb&9%i+b*GF_(G
zk&v&xPFG3tS*$EdK?#Ejve3gEL+JFo<FjALislA~ynkjqQhq)@+w}M!-KX96mp9&@
z8yi2W|NCfV&aJA3v2Xu9-?tL!!%RnVzn=-;mHKOk?ycPU>yNR%dy&YzvVHCiNyf*@
z0V;#Sf(Eu$H8}IC1r<`Z?*U+Y9J>pxq8Pv_ymF=0MT-#(s4v$iRiH6KXgbc0>>%ox
zwlFO8JDcxLBXZeVJRE&ZpqPe%ZZ8jDU(&dfib=Jub?&mNwl#1^uz|<)m$1`uh*7P%
z&3R84ZMlVsjydTjZR*o4Kh!9w&ywu-*ICO+G3;}*h7w~92xkFRQW?qF3_UNViKcZ>
zoKB3ry{b(x(u<>U#iRB+KPcT+5Id1XlQhmJAo|^?Nsbr65ijOC;|WZDcScX#EPzPf
zJR^z|nTS_-{N?<oOhHeB8)Q$H(=>7CqMp7fBYWC-k?iSfNq77)!qd5qn5Pr~O*w+X
zvdDe_gy{&>&VJR1h^VGrzpZKc(`G?1l(B{i9-xA&s33?6R?*yA;W_!FS~-EpoEDkC
zVp6YXwx494Vlhu?Z0&km=Ijb*9pi?UI1h`t4_(|a=A|HpVP-qeR at HCQ>upAt%^0w?
z_M5FGvL&x{M6GnFW&Yx;F2N6O!BR=i;uODDWU9e9ArEH_<H9OoOpRJj at R$aTt;%J4
z2Zx78ofL)Lt8jXy0d>)&Meg_7udy{~no64kz22A-l$%p)4<Exg>q74O5 at WrL8zD+@
z!b^+?LT)I)31b(EEp2to4wfymJZr)$w<7WZwbXCPwjwfzC0XG|6jra)NkjrJ at c`J<
zJ4IKUMsPE;qrj%GX11NQwZNGRn5`B1PrTAA6#0Nf>GV?H<_A&!LWsX0<S%Q9>#8|t
zTFVc(`M%9SwNn&s1bTp$aL&%I&AI45O5qeiwan**vC8dgnH^F35INEPCj8PFaA*1z
zy(x@*6H7ZnV66}U;!UQ|rn)E;kC4Zz{+|=BH at Oe;`&2?3V*$t(Nh~Phu@*>d6|#8}
z>qkvI)~_UpL*XwZ)&*IR#6}>yOJWYl?vPkNWVcDo1=-I8GsR6Z4B;)3a00TQNX!G-
zO==5F0cHs#oWwk9QWz;1-G`?<LNwYJ at U$mL9Yup at oThcTHF#z>ZMftBp8XNc7dn6o
zF3?uZ2l3p`Xso<L0BrrlD&gPB8CWbCaX#0(%v|Z6XI<Aw3io1rv19c{ab0txPHd>F
zZ!p$to5ZEfH76Q%O-6&b%}~?)mQLKz(AKy|-`ad!S7VIch>bdfQLL&rMj!XCB;@`F
DVRpT7

delta 1411
zcmZ9MZ%7ki9LImRJ8e at jmzyoq+NDDJV&1mWZCaFPCF=S|z6cg<ZfA-AD#aHO?2;K%
z3Z~PtvQiSwLReH(FRY1KOMD?zV1cCtCZZ9&De6tXTk6jHjoqH-bKiS at -+iBl3nh6~
z`T{oiX{QPx3INLEm~`v$=M~n!j}DcTr4<r}D4^p2772h at 84WVjB(>>F+?uTISw8*w
zfUQkC8ba8j1&G04!?uuI>uRR_be{(=Up>7()rQiGmtsAx(u9OG$N&zN0LgS|{B&@P
zd$?4i8_pl7Z?63F+p4R7?a0Yn+Wq8J-IL+P{(;ZmpH<DZKbu;l)eN;qcx<^yH`AAV
z2^1 at H06Sbf)}l;Dn=2I;^exb`jFl+>PiT%>OM)?LHRB~sW%7tfSm)#nHIxuRL5Le%
zm{Igc2t>Q>Mf+l`AXzIbsavZOB3dpDPruJLUC5+X000B*y~e|`Ba)WC0 at NKz%fc^;
zB0BP*;C`$yv7;c2-2ZQoOy5sMhN(FsgJ^qEb5b!caaOGJi8SG~&OH#>0>GuRE{oCv
zK=<luaiSn3ah4RedAUE1uwUnvgW|=7zxcOH6hk=qLAhEi!rd7^&?hEB@~82*i3&X>
zcV>!!;Hh&cpAhvAn;MT2Osy7rD$72$I>mwDsiRHmX=x%+EJ9DkHMhjX4(T~^m3lpZ
zcMQ27zeYKq@^bcJJGoiLu(KcO)Vbc2AH<e%N6Nfo|GN*PCJ&hx7|otyEfcK8%US}g
zWs=<ugBk#(e>j@;pI*1qO_lcuZ5&zvVG|Om5idamwHnINgHs6)A-At`67T=lPa?l9
zb7*nzR at qFthPowTQ^;<vVQzw$N7%gv5=0lRp>9YRkGks;=0$c*!UD*;B+Q5Gs)ThR
zyW*C>9)z6|b{AQPggr&(m#`qRcG($BL5V3C;uE%cl&$1;!ptXLA&W-Lyt<b><*@J@
z?~`64kKgo|yxXhG<2Sz`Lwoc2)Hme(Y(BsBEh%r>#naP5lHodmFTGYAZ6G_${vC>M
z(N)~pTCUo!jG5f8XLR_fZ>-h2j7EdgXyA;D+2u0kR_Mz)B<7qQW|Pz8%yn_)PN&J`
eWOTOb>c$#d16SW*E2wO6*10&FKQneK9>{;hLKcqz

diff --git a/llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll b/llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll
index fc61aa5f981dd..a3d6c3b729523 100644
--- a/llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll
+++ b/llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll
@@ -849,21 +849,6 @@ define amdgpu_kernel void @calls_intrin_ascast_cc_kernel(ptr addrspace(3) %ptr)
   ret void
 }
 
-define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(ptr addrspace(3) %ptr) {
-; GFX9-LABEL: define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(
-; GFX9-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR1]] {
-; GFX9-NEXT:    call void @calls_intrin_ascast_cc_kernel(ptr addrspace(3) [[PTR]])
-; GFX9-NEXT:    ret void
-;
-; GFX10-LABEL: define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(
-; GFX10-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR1]] {
-; GFX10-NEXT:    call void @calls_intrin_ascast_cc_kernel(ptr addrspace(3) [[PTR]])
-; GFX10-NEXT:    ret void
-;
-  call void @calls_intrin_ascast_cc_kernel(ptr addrspace(3) %ptr)
-  ret void
-}
-
 define amdgpu_kernel void @with_inline_asm() {
 ; GFX9-LABEL: define amdgpu_kernel void @with_inline_asm(
 ; GFX9-SAME: ) #[[ATTR3]] {
diff --git a/llvm/test/CodeGen/AMDGPU/call-to-kernel-undefined.ll b/llvm/test/CodeGen/AMDGPU/call-to-kernel-undefined.ll
deleted file mode 100644
index da7385475088b..0000000000000
--- a/llvm/test/CodeGen/AMDGPU/call-to-kernel-undefined.ll
+++ /dev/null
@@ -1,20 +0,0 @@
-; RUN: not --crash llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s
-
-; FIXME: It should be invalid IR to have a call to a kernel, but this
-; is currently relied on, but should be eliminated before codegen.
-define amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out) #0 {
-entry:
-  store volatile i32 0, ptr addrspace(1) %out
-  ret void
-}
-
-; Make sure there's no crash when the callsite calling convention
-; doesn't match.
-; CHECK: LLVM ERROR: invalid call to entry function
-define amdgpu_kernel void @caller_kernel(ptr addrspace(1) %out) #0 {
-entry:
-  call void @callee_kernel(ptr addrspace(1) %out)
-  ret void
-}
-
-attributes #0 = { nounwind noinline }
diff --git a/llvm/test/CodeGen/AMDGPU/call-to-kernel.ll b/llvm/test/CodeGen/AMDGPU/call-to-kernel.ll
deleted file mode 100644
index 1f4f6471fcdba..0000000000000
--- a/llvm/test/CodeGen/AMDGPU/call-to-kernel.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: not --crash llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s
-
-; FIXME: It should be invalid IR to have a call to a kernel, but this
-; is currently relied on, but should be eliminated before codegen.
-define amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out) #0 {
-entry:
-  store volatile i32 0, ptr addrspace(1) %out
-  ret void
-}
-
-; CHECK: LLVM ERROR: Unsupported calling convention for call
-define amdgpu_kernel void @caller_kernel(ptr addrspace(1) %out) #0 {
-entry:
-  call amdgpu_kernel void @callee_kernel(ptr addrspace(1) %out)
-  ret void
-}
-
-attributes #0 = { nounwind noinline }
diff --git a/llvm/test/Other/spir_cc.ll b/llvm/test/Other/spir_cc.ll
index ffc02945de4d2..33cf0bbf86a1f 100644
--- a/llvm/test/Other/spir_cc.ll
+++ b/llvm/test/Other/spir_cc.ll
@@ -8,6 +8,5 @@ define spir_func void @foo() {
 
 define spir_kernel void @bar() {
         call spir_func void @foo( )
-        call spir_kernel void @bar( )
         ret void
 }
diff --git a/llvm/test/Verifier/amdgpu-cc.ll b/llvm/test/Verifier/amdgpu-cc.ll
index ce48d1fdae3e5..aec09771d2e4f 100644
--- a/llvm/test/Verifier/amdgpu-cc.ll
+++ b/llvm/test/Verifier/amdgpu-cc.ll
@@ -217,26 +217,3 @@ define amdgpu_cs_chain_preserve void @preallocated_cc_amdgpu_cs_chain_preserve(p
 define amdgpu_cs_chain_preserve void @inalloca_cc_amdgpu_cs_chain_preserve(ptr inalloca(i32) %ptr) {
   ret void
 }
-
-declare amdgpu_cs_chain void @amdgpu_cs_chain_call_target()
-declare amdgpu_cs_chain_preserve void @amdgpu_cs_chain_preserve_call_target()
-
-define amdgpu_cs_chain void @cant_call_amdgpu_cs_chain_functions(ptr %f) {
-  ; CHECK: Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.
-  ; CHECK-NEXT: call amdgpu_cs_chain
-  call amdgpu_cs_chain void @amdgpu_cs_chain_call_target()
-
-  ; CHECK: Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.
-  ; CHECK-NEXT: call amdgpu_cs_chain_preserve
-  call amdgpu_cs_chain_preserve void @amdgpu_cs_chain_preserve_call_target()
-
-  ; CHECK: Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.
-  ; CHECK-NEXT: call amdgpu_cs_chain
-  call amdgpu_cs_chain void %f()
-
-  ; CHECK: Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.
-  ; CHECK-NEXT: call amdgpu_cs_chain
-  call amdgpu_cs_chain_preserve void %f()
-
-  ret void
-}
diff --git a/llvm/test/Verifier/call-to-non-callable-functions.ll b/llvm/test/Verifier/call-to-non-callable-functions.ll
new file mode 100644
index 0000000000000..f33682c0dbe23
--- /dev/null
+++ b/llvm/test/Verifier/call-to-non-callable-functions.ll
@@ -0,0 +1,529 @@
+; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+
+declare amdgpu_cs_chain void @callee_amdgpu_cs_chain()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs_chain void @callee_amdgpu_cs_chain()
+define amdgpu_cs_chain void @call_caller_amdgpu_cs_chain() {
+entry:
+  call amdgpu_cs_chain void @callee_amdgpu_cs_chain()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs_chain void %func()
+define amdgpu_cs_chain void @indirect_call_caller_amdgpu_cs_chain(ptr %func) {
+entry:
+  call amdgpu_cs_chain void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_cs_chain void @callee_amdgpu_cs_chain()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs_chain void @invoke_caller_amdgpu_cs_chain() {
+entry:
+  invoke amdgpu_cs_chain void @callee_amdgpu_cs_chain() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_cs_chain void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs_chain void @indirect_invoke_caller_amdgpu_cs_chain(ptr %func) {
+entry:
+  invoke amdgpu_cs_chain void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_cs_chain_preserve void @callee_amdgpu_cs_chain_preserve()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs_chain_preserve void @callee_amdgpu_cs_chain_preserve()
+define amdgpu_cs_chain_preserve void @call_caller_amdgpu_cs_chain_preserve() {
+entry:
+  call amdgpu_cs_chain_preserve void @callee_amdgpu_cs_chain_preserve()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs_chain_preserve void %func()
+define amdgpu_cs_chain_preserve void @indirect_call_caller_amdgpu_cs_chain_preserve(ptr %func) {
+entry:
+  call amdgpu_cs_chain_preserve void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_cs_chain_preserve void @callee_amdgpu_cs_chain_preserve()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs_chain_preserve void @invoke_caller_amdgpu_cs_chain_preserve() {
+entry:
+  invoke amdgpu_cs_chain_preserve void @callee_amdgpu_cs_chain_preserve() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_cs_chain_preserve void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs_chain_preserve void @indirect_invoke_caller_amdgpu_cs_chain_preserve(ptr %func) {
+entry:
+  invoke amdgpu_cs_chain_preserve void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_cs void @callee_amdgpu_cs()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs void @callee_amdgpu_cs()
+define amdgpu_cs void @call_caller_amdgpu_cs() {
+entry:
+  call amdgpu_cs void @callee_amdgpu_cs()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_cs void %func()
+define amdgpu_cs void @indirect_call_caller_amdgpu_cs(ptr %func) {
+entry:
+  call amdgpu_cs void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_cs void @callee_amdgpu_cs()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs void @invoke_caller_amdgpu_cs() {
+entry:
+  invoke amdgpu_cs void @callee_amdgpu_cs() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_cs void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_cs void @indirect_invoke_caller_amdgpu_cs(ptr %func) {
+entry:
+  invoke amdgpu_cs void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_es void @callee_amdgpu_es()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_es void @callee_amdgpu_es()
+define amdgpu_es void @call_caller_amdgpu_es() {
+entry:
+  call amdgpu_es void @callee_amdgpu_es()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_es void %func()
+define amdgpu_es void @indirect_call_caller_amdgpu_es(ptr %func) {
+entry:
+  call amdgpu_es void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_es void @callee_amdgpu_es()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_es void @invoke_caller_amdgpu_es() {
+entry:
+  invoke amdgpu_es void @callee_amdgpu_es() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_es void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_es void @indirect_invoke_caller_amdgpu_es(ptr %func) {
+entry:
+  invoke amdgpu_es void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_gs void @callee_amdgpu_gs()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_gs void @callee_amdgpu_gs()
+define amdgpu_gs void @call_caller_amdgpu_gs() {
+entry:
+  call amdgpu_gs void @callee_amdgpu_gs()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_gs void %func()
+define amdgpu_gs void @indirect_call_caller_amdgpu_gs(ptr %func) {
+entry:
+  call amdgpu_gs void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_gs void @callee_amdgpu_gs()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_gs void @invoke_caller_amdgpu_gs() {
+entry:
+  invoke amdgpu_gs void @callee_amdgpu_gs() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_gs void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_gs void @indirect_invoke_caller_amdgpu_gs(ptr %func) {
+entry:
+  invoke amdgpu_gs void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_hs void @callee_amdgpu_hs()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_hs void @callee_amdgpu_hs()
+define amdgpu_hs void @call_caller_amdgpu_hs() {
+entry:
+  call amdgpu_hs void @callee_amdgpu_hs()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_hs void %func()
+define amdgpu_hs void @indirect_call_caller_amdgpu_hs(ptr %func) {
+entry:
+  call amdgpu_hs void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_hs void @callee_amdgpu_hs()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_hs void @invoke_caller_amdgpu_hs() {
+entry:
+  invoke amdgpu_hs void @callee_amdgpu_hs() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_hs void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_hs void @indirect_invoke_caller_amdgpu_hs(ptr %func) {
+entry:
+  invoke amdgpu_hs void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_kernel void @callee_amdgpu_kernel()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_kernel void @callee_amdgpu_kernel()
+define amdgpu_kernel void @call_caller_amdgpu_kernel() {
+entry:
+  call amdgpu_kernel void @callee_amdgpu_kernel()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_kernel void %func()
+define amdgpu_kernel void @indirect_call_caller_amdgpu_kernel(ptr %func) {
+entry:
+  call amdgpu_kernel void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_kernel void @callee_amdgpu_kernel()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_kernel void @invoke_caller_amdgpu_kernel() {
+entry:
+  invoke amdgpu_kernel void @callee_amdgpu_kernel() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_kernel void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_kernel void @indirect_invoke_caller_amdgpu_kernel(ptr %func) {
+entry:
+  invoke amdgpu_kernel void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_ls void @callee_amdgpu_ls()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_ls void @callee_amdgpu_ls()
+define amdgpu_ls void @call_caller_amdgpu_ls() {
+entry:
+  call amdgpu_ls void @callee_amdgpu_ls()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_ls void %func()
+define amdgpu_ls void @indirect_call_caller_amdgpu_ls(ptr %func) {
+entry:
+  call amdgpu_ls void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_ls void @callee_amdgpu_ls()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_ls void @invoke_caller_amdgpu_ls() {
+entry:
+  invoke amdgpu_ls void @callee_amdgpu_ls() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_ls void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_ls void @indirect_invoke_caller_amdgpu_ls(ptr %func) {
+entry:
+  invoke amdgpu_ls void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_ps void @callee_amdgpu_ps()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_ps void @callee_amdgpu_ps()
+define amdgpu_ps void @call_caller_amdgpu_ps() {
+entry:
+  call amdgpu_ps void @callee_amdgpu_ps()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_ps void %func()
+define amdgpu_ps void @indirect_call_caller_amdgpu_ps(ptr %func) {
+entry:
+  call amdgpu_ps void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_ps void @callee_amdgpu_ps()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_ps void @invoke_caller_amdgpu_ps() {
+entry:
+  invoke amdgpu_ps void @callee_amdgpu_ps() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_ps void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_ps void @indirect_invoke_caller_amdgpu_ps(ptr %func) {
+entry:
+  invoke amdgpu_ps void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare amdgpu_vs void @callee_amdgpu_vs()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_vs void @callee_amdgpu_vs()
+define amdgpu_vs void @call_caller_amdgpu_vs() {
+entry:
+  call amdgpu_vs void @callee_amdgpu_vs()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call amdgpu_vs void %func()
+define amdgpu_vs void @indirect_call_caller_amdgpu_vs(ptr %func) {
+entry:
+  call amdgpu_vs void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke amdgpu_vs void @callee_amdgpu_vs()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_vs void @invoke_caller_amdgpu_vs() {
+entry:
+  invoke amdgpu_vs void @callee_amdgpu_vs() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke amdgpu_vs void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define amdgpu_vs void @indirect_invoke_caller_amdgpu_vs(ptr %func) {
+entry:
+  invoke amdgpu_vs void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+declare spir_kernel void @callee_spir_kernel()
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call spir_kernel void @callee_spir_kernel()
+define spir_kernel void @call_caller_spir_kernel() {
+entry:
+  call spir_kernel void @callee_spir_kernel()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: call spir_kernel void %func()
+define spir_kernel void @indirect_call_caller_spir_kernel(ptr %func) {
+entry:
+  call spir_kernel void %func()
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK-NEXT: invoke spir_kernel void @callee_spir_kernel()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define spir_kernel void @invoke_caller_spir_kernel() {
+entry:
+  invoke spir_kernel void @callee_spir_kernel() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}
+
+; CHECK: calling convention does not permit calls
+; CHECK: invoke spir_kernel void %func()
+; CHECK-NEXT: to label %cont unwind label %unwind
+define spir_kernel void @indirect_invoke_caller_spir_kernel(ptr %func) {
+entry:
+  invoke spir_kernel void %func() to label %cont unwind label %unwind
+  ret void
+
+cont:
+  ret void
+
+unwind:
+  ret void
+}

>From 72144d119a7291f8b6b8e022a2947fbe31e66afc Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Fri, 11 Apr 2025 12:52:23 -0700
Subject: [PATCH 36/76] [flang][runtime] Fix recently broken big-endian
 formatted integer input (#135417)

My recent change to speed up formatted integer input has a bug on
big-endian targets that has shown up on ppc64 AIX build bots. Fix.
---
 flang-rt/lib/runtime/edit-input.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang-rt/lib/runtime/edit-input.cpp b/flang-rt/lib/runtime/edit-input.cpp
index 0a7b09f836c7d..4aa8c70f776cd 100644
--- a/flang-rt/lib/runtime/edit-input.cpp
+++ b/flang-rt/lib/runtime/edit-input.cpp
@@ -293,8 +293,8 @@ RT_API_ATTRS bool EditIntegerInput(IoStatementState &io, const DataEdit &edit,
 #if USING_NATIVE_INT128_T
     auto shft{static_cast<int>(sizeof value - kind)};
     if (!isHostLittleEndian && shft >= 0) {
-      auto l{value << shft};
-      std::memcpy(n, &l, kind);
+      auto shifted{value << (8 * shft)};
+      std::memcpy(n, &shifted, kind);
     } else {
       std::memcpy(n, &value, kind); // a blank field means zero
     }

>From ae0aa2dea2dee3af01326e5ff96ab436628f7e2b Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo at fhahn.com>
Date: Fri, 11 Apr 2025 21:01:57 +0100
Subject: [PATCH 37/76] [VPlan] Merge cases using getResultType in
 inferScalarType (NFC).

---
 llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp b/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
index 142a7080ec761..375d4c9787994 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
@@ -262,7 +262,8 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
             return inferScalarType(R->getOperand(0));
           })
           // VPInstructionWithType must be handled before VPInstruction.
-          .Case<VPInstructionWithType, VPWidenIntrinsicRecipe>(
+          .Case<VPInstructionWithType, VPWidenIntrinsicRecipe,
+                VPWidenCastRecipe>(
               [](const auto *R) { return R->getResultType(); })
           .Case<VPBlendRecipe, VPInstruction, VPWidenRecipe, VPReplicateRecipe,
                 VPWidenCallRecipe, VPWidenMemoryRecipe, VPWidenSelectRecipe>(
@@ -271,8 +272,6 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
             // TODO: Use info from interleave group.
             return V->getUnderlyingValue()->getType();
           })
-          .Case<VPWidenCastRecipe>(
-              [](const VPWidenCastRecipe *R) { return R->getResultType(); })
           .Case<VPExpandSCEVRecipe>([](const VPExpandSCEVRecipe *R) {
             return R->getSCEV()->getType();
           })

>From d78b48641429c8b48e2c376fa3870d841e319c96 Mon Sep 17 00:00:00 2001
From: Tai Ly <tai.ly at arm.com>
Date: Fri, 11 Apr 2025 15:14:46 -0500
Subject: [PATCH 38/76] [mlir][tosa] Add error_if checks for Mul Op (#135075)

This adds error_if validation checking for Mul Op

Signed-off-by: Tai Ly <tai.ly at arm.com>
---
 .../Tosa/Transforms/TosaValidation.cpp        | 35 ++++++++++++++++++-
 mlir/test/Dialect/Tosa/error_if_check.mlir    | 30 ++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index 28e562c813eb3..11eb0d969d78b 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -979,8 +979,41 @@ bool checkErrorIfResize(Operation *op) {
   return true;
 }
 
+bool checkErrorIfMul(Operation *op) {
+  auto mul = dyn_cast<tosa::MulOp>(op);
+  if (!mul)
+    return true;
+
+  // REQUIRE(0 <= shift && shift <= 63);
+  // REQUIRE(is_same<in_t,int32_t>() || shift == 0);
+  ElementsAttr shift_elem;
+  if (!matchPattern(mul.getShift(), m_Constant(&shift_elem))) {
+    return true;
+  }
+  int32_t shift = shift_elem.getValues<IntegerAttr>()[0].getInt();
+  auto inputElemType = getElementTypeOrSelf(mul.getInput1());
+  if (inputElemType.isInteger(32)) {
+    // 0 <= shift <= 63 for int32_t type
+    if (shift < 0 || shift > 63) {
+      op->emitOpError() << "requires 0 <= shift && shift <= 63, but got: "
+                        << shift;
+      return false;
+    }
+  } else {
+    // shift must be 0 for all other types
+    if (shift != 0) {
+      op->emitOpError() << "requires shift = 0 for all input data types that "
+                           "are not int32_t, but got: "
+                        << shift;
+      return false;
+    }
+  }
+
+  return true;
+}
+
 LogicalResult TosaValidation::applyErrorIfCheck(Operation *op) {
-  if (!checkErrorIfResize(op))
+  if (!checkErrorIfResize(op) || !checkErrorIfMul(op))
     return failure();
   return success();
 }
diff --git a/mlir/test/Dialect/Tosa/error_if_check.mlir b/mlir/test/Dialect/Tosa/error_if_check.mlir
index ce3ad04ea68ca..f7ca0faa8bc9e 100644
--- a/mlir/test/Dialect/Tosa/error_if_check.mlir
+++ b/mlir/test/Dialect/Tosa/error_if_check.mlir
@@ -83,3 +83,33 @@ func.func @test_resize_invalid_boarder_x(%arg0: tensor<1x8x8x8xf32>) -> tensor<?
   %1 = tosa.resize %arg0, %scale, %offset, %border { mode = "BILINEAR" } : (tensor<1x8x8x8xf32>, !tosa.shape<4>, !tosa.shape<2>, !tosa.shape<2>) -> tensor<?x?x?x?xf32>
   return %1 : tensor<?x?x?x?xf32>
 }
+
+// -----
+
+// CHECK-LABEL: test_mul_negative_shift
+func.func @test_mul_negative_shift(%arg0: tensor<1x8x8x8xi32>, %arg1: tensor<1x8x8x8xi32>) -> tensor<1x8x8x8xi32> {
+  %shift = "tosa.const" () { values = dense<-1> : tensor<1xi8> } : () -> tensor<1xi8>
+  // expected-error at +1 {{'tosa.mul' op requires 0 <= shift && shift <= 63, but got: -1}}
+  %mul = tosa.mul %arg0, %arg1, %shift : (tensor<1x8x8x8xi32>, tensor<1x8x8x8xi32>, tensor<1xi8>) -> tensor<1x8x8x8xi32>
+  return %mul : tensor<1x8x8x8xi32>
+}
+
+// -----
+
+// CHECK-LABEL: test_mul_too_big_shift
+func.func @test_mul_too_big_shift(%arg0: tensor<1x8x8x8xi32>, %arg1: tensor<1x8x8x8xi32>) -> tensor<1x8x8x8xi32> {
+  %shift = "tosa.const" () { values = dense<64> : tensor<1xi8> } : () -> tensor<1xi8>
+  // expected-error at +1 {{'tosa.mul' op requires 0 <= shift && shift <= 63, but got: 64}}
+  %mul = tosa.mul %arg0, %arg1, %shift : (tensor<1x8x8x8xi32>, tensor<1x8x8x8xi32>, tensor<1xi8>) -> tensor<1x8x8x8xi32>
+  return %mul : tensor<1x8x8x8xi32>
+}
+
+// -----
+
+// CHECK-LABEL: test_mul_non_zero_shift
+func.func @test_mul_non_zero_shift(%arg0: tensor<1x8x8x8xi16>, %arg1: tensor<1x8x8x8xi16>) -> tensor<1x8x8x8xi32> {
+  %shift = "tosa.const" () { values = dense<1> : tensor<1xi8> } : () -> tensor<1xi8>
+  // expected-error at +1 {{'tosa.mul' op requires shift = 0 for all input data types that are not int32_t, but got: 1}}
+  %mul = tosa.mul %arg0, %arg1, %shift : (tensor<1x8x8x8xi16>, tensor<1x8x8x8xi16>, tensor<1xi8>) -> tensor<1x8x8x8xi32>
+  return %mul : tensor<1x8x8x8xi32>
+}

>From 90a202f2ff241a9f4b11ec625dcc3446cbceb924 Mon Sep 17 00:00:00 2001
From: Victor Vianna <victor.vianna10 at gmail.com>
Date: Fri, 11 Apr 2025 21:16:33 +0100
Subject: [PATCH 39/76] [cpp23] Remove usage of std::aligned_union<> in llvm
 (#135146)

std::aligned_union<> is deprecated in C++23. See more details in the
linked bug.

Bug: https://crbug.com/388068052
---
 compiler-rt/lib/orc/error.h            | 4 ++--
 llvm/include/llvm/ADT/TrieRawHashMap.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler-rt/lib/orc/error.h b/compiler-rt/lib/orc/error.h
index e64332e9ae764..28035095b692a 100644
--- a/compiler-rt/lib/orc/error.h
+++ b/compiler-rt/lib/orc/error.h
@@ -367,8 +367,8 @@ template <typename T> class ORC_RT_NODISCARD Expected {
   }
 
   union {
-    std::aligned_union_t<1, storage_type> TStorage;
-    std::aligned_union_t<1, error_type> ErrorStorage;
+    alignas(storage_type) char TStorage[sizeof(storage_type)];
+    alignas(error_type) char ErrorStorage[sizeof(error_type)];
   };
 
   bool HasError : 1;
diff --git a/llvm/include/llvm/ADT/TrieRawHashMap.h b/llvm/include/llvm/ADT/TrieRawHashMap.h
index 5bfe5c9e6a0f4..e312967edeb58 100644
--- a/llvm/include/llvm/ADT/TrieRawHashMap.h
+++ b/llvm/include/llvm/ADT/TrieRawHashMap.h
@@ -72,7 +72,7 @@ class ThreadSafeTrieRawHashMapBase {
 private:
   template <class T> struct AllocValueType {
     char Base[TrieContentBaseSize];
-    std::aligned_union_t<sizeof(T), T> Content;
+    alignas(T) char Content[sizeof(T)];
   };
 
 protected:

>From d1fd97737e9064431983e48c2105d1c54d5feacc Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Fri, 11 Apr 2025 16:21:00 -0400
Subject: [PATCH 40/76] [compiler-rt][sanitizer] add Haiku support (#134772)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: JérÎme Duval <jerome.duval at gmail.com>
---
 compiler-rt/CMakeLists.txt                    |   4 +
 compiler-rt/cmake/config-ix.cmake             |   4 +-
 compiler-rt/lib/asan/asan_linux.cpp           |  20 +-
 compiler-rt/lib/asan/asan_malloc_linux.cpp    |   2 +-
 compiler-rt/lib/asan/asan_posix.cpp           |   2 +-
 compiler-rt/lib/asan/tests/CMakeLists.txt     |   1 +
 compiler-rt/lib/asan/tests/asan_test.cpp      |   2 +-
 compiler-rt/lib/interception/interception.h   |   4 +-
 .../lib/interception/interception_linux.cpp   |   2 +-
 .../lib/interception/interception_linux.h     |   2 +-
 .../lib/sanitizer_common/CMakeLists.txt       |   5 +
 .../sanitizer_common_interceptors_ioctl.inc   |  18 +-
 .../lib/sanitizer_common/sanitizer_errno.h    |   2 +
 .../sanitizer_common/sanitizer_errno_codes.h  |  21 +-
 .../lib/sanitizer_common/sanitizer_haiku.cpp  | 361 ++++++++++++++++++
 .../lib/sanitizer_common/sanitizer_linux.cpp  |  73 +++-
 .../lib/sanitizer_common/sanitizer_linux.h    |   8 +-
 .../sanitizer_linux_libcdep.cpp               |  21 +-
 .../lib/sanitizer_common/sanitizer_platform.h |  15 +-
 .../sanitizer_platform_limits_posix.cpp       |  51 ++-
 .../sanitizer_platform_limits_posix.h         |  46 ++-
 .../lib/sanitizer_common/sanitizer_procmaps.h |   2 +-
 .../sanitizer_procmaps_haiku.cpp              |  94 +++++
 .../sanitizer_unwind_linux_libcdep.cpp        |   4 +-
 .../lib/sanitizer_common/tests/CMakeLists.txt |   3 +
 compiler-rt/lib/ubsan/ubsan_platform.h        |   2 +-
 .../Instrumentation/AddressSanitizer.cpp      |   4 +
 27 files changed, 693 insertions(+), 80 deletions(-)
 create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp
 create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_procmaps_haiku.cpp

diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index f319113e5c16e..9f8e8334d75ba 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -569,6 +569,10 @@ append_list_if(COMPILER_RT_HAS_LIBC c SANITIZER_COMMON_LINK_LIBS)
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
   list(APPEND SANITIZER_COMMON_LINK_LIBS zircon)
 endif()
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
+  list(APPEND SANITIZER_COMMON_LINK_LIBS root)
+  list(APPEND SANITIZER_COMMON_LINK_LIBS bsd)
+endif()
 
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
   set(SANITIZER_NO_UNDEFINED_SYMBOLS_DEFAULT ON)
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index cf729c3adb1f5..e3310b1ff0e2c 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -760,7 +760,7 @@ set(COMPILER_RT_SANITIZERS_TO_BUILD all CACHE STRING
 list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}")
 
 if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
-    (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR
+    (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS|Haiku" OR
     (OS_NAME MATCHES "Windows" AND NOT CYGWIN AND
         (NOT MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"))))
   set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
@@ -875,7 +875,7 @@ else()
 endif()
 
 if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND
-    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS")
+    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS|Haiku")
   set(COMPILER_RT_HAS_UBSAN TRUE)
 else()
   set(COMPILER_RT_HAS_UBSAN FALSE)
diff --git a/compiler-rt/lib/asan/asan_linux.cpp b/compiler-rt/lib/asan/asan_linux.cpp
index 3b40f76836efe..b5b4d88d1c3c2 100644
--- a/compiler-rt/lib/asan/asan_linux.cpp
+++ b/compiler-rt/lib/asan/asan_linux.cpp
@@ -13,7 +13,11 @@
 
 #include "sanitizer_common/sanitizer_platform.h"
 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
+
+#  if SANITIZER_HAIKU
+#    define _DEFAULT_SOURCE
+#  endif
 
 #  include <dlfcn.h>
 #  include <fcntl.h>
@@ -22,7 +26,9 @@
 #  include <stdio.h>
 #  include <sys/mman.h>
 #  include <sys/resource.h>
-#  include <sys/syscall.h>
+#  if !SANITIZER_HAIKU
+#    include <sys/syscall.h>
+#  endif
 #  include <sys/time.h>
 #  include <sys/types.h>
 #  include <unistd.h>
@@ -37,7 +43,7 @@
 #  include "sanitizer_common/sanitizer_libc.h"
 #  include "sanitizer_common/sanitizer_procmaps.h"
 
-#  if SANITIZER_FREEBSD
+#  if SANITIZER_FREEBSD || SANITIZER_HAIKU
 #    include <sys/link_elf.h>
 #  endif
 
@@ -54,6 +60,8 @@
 #  elif SANITIZER_NETBSD
 #    include <link_elf.h>
 #    include <ucontext.h>
+#  elif SANITIZER_HAIKU
+extern "C" void *_DYNAMIC;
 #  else
 #    include <link.h>
 #    include <sys/ucontext.h>
@@ -162,6 +170,12 @@ static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size,
     return 0;
   }
 
+#    if SANITIZER_HAIKU
+  if (!info->dlpi_name[0] ||
+      internal_strncmp(info->dlpi_name, "/boot/system/runtime_loader",
+                       sizeof("/boot/system/runtime_loader") - 1) == 0)
+    return 0;
+#    endif
 #    if SANITIZER_LINUX
   // Ignore vDSO. glibc versions earlier than 2.15 (and some patched
   // by distributors) return an empty name for the vDSO entry, so
diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cpp b/compiler-rt/lib/asan/asan_malloc_linux.cpp
index 3d6b03fefab70..cbcdd9c1be29d 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cpp
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cpp
@@ -15,7 +15,7 @@
 
 #include "sanitizer_common/sanitizer_platform.h"
 #if SANITIZER_FREEBSD || SANITIZER_FUCHSIA || SANITIZER_LINUX || \
-    SANITIZER_NETBSD || SANITIZER_SOLARIS
+    SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 #  include "asan_allocator.h"
 #  include "asan_interceptors.h"
diff --git a/compiler-rt/lib/asan/asan_posix.cpp b/compiler-rt/lib/asan/asan_posix.cpp
index 070ba89048f99..fb66c871ea8a5 100644
--- a/compiler-rt/lib/asan/asan_posix.cpp
+++ b/compiler-rt/lib/asan/asan_posix.cpp
@@ -180,7 +180,7 @@ static void AfterFork(bool fork_child) {
 
 void InstallAtForkHandler() {
 #  if SANITIZER_SOLARIS || SANITIZER_NETBSD || SANITIZER_APPLE || \
-      (SANITIZER_LINUX && SANITIZER_SPARC)
+      (SANITIZER_LINUX && SANITIZER_SPARC) || SANITIZER_HAIKU
   // While other Linux targets use clone in internal_fork which doesn't
   // trigger pthread_atfork handlers, Linux/sparc64 uses __fork, causing a
   // hang.
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt
index 00dcbf6534e28..9cd9c97bed813 100644
--- a/compiler-rt/lib/asan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/asan/tests/CMakeLists.txt
@@ -109,6 +109,7 @@ if(NOT APPLE)
   append_list_if(COMPILER_RT_HAS_LIBM -lm ASAN_UNITTEST_NOINST_LINK_FLAGS)
   append_list_if(COMPILER_RT_HAS_LIBDL -ldl ASAN_UNITTEST_NOINST_LINK_FLAGS)
   append_list_if(COMPILER_RT_HAS_LIBRT -lrt ASAN_UNITTEST_NOINST_LINK_FLAGS)
+  append_list_if(HAIKU -lbsd ASAN_UNITTEST_NOINST_LINK_FLAGS)
   append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_UNITTEST_NOINST_LINK_FLAGS)
   append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS)
 endif()
diff --git a/compiler-rt/lib/asan/tests/asan_test.cpp b/compiler-rt/lib/asan/tests/asan_test.cpp
index 0d98b1498a821..2d054ee859ed4 100644
--- a/compiler-rt/lib/asan/tests/asan_test.cpp
+++ b/compiler-rt/lib/asan/tests/asan_test.cpp
@@ -1163,7 +1163,7 @@ TEST(AddressSanitizer, DISABLED_StressStackReuseAndExceptionsTest) {
 }
 #endif
 
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(__HAIKU__)
 TEST(AddressSanitizer, MlockTest) {
   EXPECT_EQ(0, mlockall(MCL_CURRENT));
   EXPECT_EQ(0, mlock((void *)0x12345, 0x5678));
diff --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h
index 3cb6b446638e0..25480120e7ad6 100644
--- a/compiler-rt/lib/interception/interception.h
+++ b/compiler-rt/lib/interception/interception.h
@@ -19,7 +19,7 @@
 
 #if !SANITIZER_LINUX && !SANITIZER_FREEBSD && !SANITIZER_APPLE &&    \
     !SANITIZER_NETBSD && !SANITIZER_WINDOWS && !SANITIZER_FUCHSIA && \
-    !SANITIZER_SOLARIS
+    !SANITIZER_SOLARIS && !SANITIZER_HAIKU
 #  error "Interception doesn't work on this operating system."
 #endif
 
@@ -368,7 +368,7 @@ inline void DoesNotSupportStaticLinking() {}
 #define INCLUDED_FROM_INTERCEPTION_LIB
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 # include "interception_linux.h"
 # define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)
diff --git a/compiler-rt/lib/interception/interception_linux.cpp b/compiler-rt/lib/interception/interception_linux.cpp
index ef8136eb4fc70..0a6659d38ae83 100644
--- a/compiler-rt/lib/interception/interception_linux.cpp
+++ b/compiler-rt/lib/interception/interception_linux.cpp
@@ -14,7 +14,7 @@
 #include "interception.h"
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 #include <dlfcn.h>   // for dlsym() and dlvsym()
 
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h
index 2e01ff44578c3..52e34d535030e 100644
--- a/compiler-rt/lib/interception/interception_linux.h
+++ b/compiler-rt/lib/interception/interception_linux.h
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 #if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
 # error interception_linux.h should be included from interception library only
diff --git a/compiler-rt/lib/sanitizer_common/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
index 09391e4f5f370..6e6dfd2f33ebf 100644
--- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
@@ -11,6 +11,7 @@ set(SANITIZER_SOURCES_NOTERMINATION
   sanitizer_flags.cpp
   sanitizer_flag_parser.cpp
   sanitizer_fuchsia.cpp
+  sanitizer_haiku.cpp
   sanitizer_libc.cpp
   sanitizer_libignore.cpp
   sanitizer_linux.cpp
@@ -28,6 +29,7 @@ set(SANITIZER_SOURCES_NOTERMINATION
   sanitizer_procmaps_common.cpp
   sanitizer_procmaps_bsd.cpp
   sanitizer_procmaps_fuchsia.cpp
+  sanitizer_procmaps_haiku.cpp
   sanitizer_procmaps_linux.cpp
   sanitizer_procmaps_mac.cpp
   sanitizer_procmaps_solaris.cpp
@@ -227,6 +229,9 @@ set(SANITIZER_COMMON_DEFINITIONS
 
 # note: L not I, this is nodefaultlibs for msvc
 append_list_if(MSVC /Zl SANITIZER_COMMON_CFLAGS)
+if(HAIKU)
+   list(APPEND SANITIZER_COMMON_CFLAGS -I/system/develop/headers/private -I/system/develop/headers/private/system/arch/x86_64 -I/system/develop/headers/private/system)
+endif()
 set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
 # Too many existing bugs, needs cleanup.
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 49ec4097c900b..f88f914b1d149 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -48,35 +48,39 @@ static void ioctl_table_fill() {
     ++ioctl_table_size;                                  \
   }
 
+  _(FIONBIO, READ, sizeof(int));
+#if !SANITIZER_HAIKU
   _(FIOASYNC, READ, sizeof(int));
   _(FIOCLEX, NONE, 0);
   _(FIOGETOWN, WRITE, sizeof(int));
-  _(FIONBIO, READ, sizeof(int));
   _(FIONCLEX, NONE, 0);
   _(FIOSETOWN, READ, sizeof(int));
+#endif
   _(SIOCATMARK, WRITE, sizeof(int));
   _(SIOCGIFCONF, CUSTOM, 0);
   _(SIOCGPGRP, WRITE, sizeof(int));
   _(SIOCSPGRP, READ, sizeof(int));
-#if !SANITIZER_SOLARIS
+#if !SANITIZER_SOLARIS && !SANITIZER_HAIKU
   _(TIOCCONS, NONE, 0);
 #endif
-  _(TIOCEXCL, NONE, 0);
+#if !SANITIZER_HAIKU
   _(TIOCGETD, WRITE, sizeof(int));
+  _(TIOCNOTTY, NONE, 0);
+  _(TIOCPKT, READ, sizeof(int));
+  _(TIOCSETD, READ, sizeof(int));
+  _(TIOCSTI, READ, sizeof(char));
+#endif
+  _(TIOCEXCL, NONE, 0);
   _(TIOCGPGRP, WRITE, pid_t_sz);
   _(TIOCGWINSZ, WRITE, struct_winsize_sz);
   _(TIOCMBIC, READ, sizeof(int));
   _(TIOCMBIS, READ, sizeof(int));
   _(TIOCMGET, WRITE, sizeof(int));
   _(TIOCMSET, READ, sizeof(int));
-  _(TIOCNOTTY, NONE, 0);
   _(TIOCNXCL, NONE, 0);
   _(TIOCOUTQ, WRITE, sizeof(int));
-  _(TIOCPKT, READ, sizeof(int));
   _(TIOCSCTTY, NONE, 0);
-  _(TIOCSETD, READ, sizeof(int));
   _(TIOCSPGRP, READ, pid_t_sz);
-  _(TIOCSTI, READ, sizeof(char));
   _(TIOCSWINSZ, READ, struct_winsize_sz);
 
 #if !SANITIZER_IOS
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_errno.h b/compiler-rt/lib/sanitizer_common/sanitizer_errno.h
index 46c85364cef56..76919da57d942 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_errno.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_errno.h
@@ -29,6 +29,8 @@
 #  define __errno_location ___errno
 #elif SANITIZER_WINDOWS
 #  define __errno_location _errno
+#elif SANITIZER_HAIKU
+#  define __errno_location _errnop
 #endif
 
 extern "C" int *__errno_location();
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_errno_codes.h b/compiler-rt/lib/sanitizer_common/sanitizer_errno_codes.h
index 9e6e71ec80c15..10a98a9b4e4d2 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_errno_codes.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_errno_codes.h
@@ -21,12 +21,21 @@
 
 namespace __sanitizer {
 
-#define errno_ENOMEM 12
-#define errno_EBUSY 16
-#define errno_EINVAL 22
-#define errno_ERANGE 34
-#define errno_ENAMETOOLONG 36
-#define errno_ENOSYS 38
+#ifdef __HAIKU__
+#  define errno_ENOMEM (0x80000000)
+#  define errno_EBUSY (0x80000000 + 14)
+#  define errno_EINVAL (0x80000000 + 5)
+#  define errno_ERANGE (0x80007000 + 17)
+#  define errno_ENAMETOOLONG (0x80000000 + 0x6004)
+#  define errno_ENOSYS (0x80007009)
+#else
+#  define errno_ENOMEM 12
+#  define errno_EBUSY 16
+#  define errno_EINVAL 22
+#  define errno_ERANGE 34
+#  define errno_ENAMETOOLONG 36
+#  define errno_ENOSYS 38
+#endif
 
 // Those might not present or their value differ on different platforms.
 extern const int errno_EOWNERDEAD;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp
new file mode 100644
index 0000000000000..7cf2437d5b755
--- /dev/null
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp
@@ -0,0 +1,361 @@
+//===-- sanitizer_haiku.cpp -----------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is shared between Sanitizer run-time libraries and implements
+// Haiku-specific functions from sanitizer_libc.h.
+//===----------------------------------------------------------------------===//
+
+#include "sanitizer_platform.h"
+
+#if SANITIZER_HAIKU
+
+#  include "sanitizer_common.h"
+#  include "sanitizer_flags.h"
+#  include "sanitizer_getauxval.h"
+#  include "sanitizer_internal_defs.h"
+#  include "sanitizer_libc.h"
+#  include "sanitizer_linux.h"
+#  include "sanitizer_mutex.h"
+#  include "sanitizer_placement_new.h"
+#  include "sanitizer_procmaps.h"
+
+#  include <sys/param.h>
+#  include <sys/types.h>
+
+#  include <sys/mman.h>
+#  include <sys/resource.h>
+#  include <sys/stat.h>
+#  include <sys/time.h>
+
+#  include <dlfcn.h>
+#  include <errno.h>
+#  include <fcntl.h>
+#  include <limits.h>
+#  include <link.h>
+#  include <pthread.h>
+#  include <sched.h>
+#  include <signal.h>
+#  include <unistd.h>
+
+#  include "system/vm_defs.h"
+#  include "system/syscalls.h"
+#  include "shared/syscall_utils.h"
+
+namespace __sanitizer {
+
+static void *GetRealLibcAddress(const char *symbol) {
+  void *real = dlsym(RTLD_NEXT, symbol);
+  if (!real)
+    real = dlsym(RTLD_DEFAULT, symbol);
+  if (!real) {
+    Printf("GetRealLibcAddress failed for symbol=%s", symbol);
+    Die();
+  }
+  return real;
+}
+
+#  define _REAL(func, ...) real##_##func(__VA_ARGS__)
+#  define DEFINE__REAL(ret_type, func, ...)                              \
+    static ret_type (*real_##func)(__VA_ARGS__) = NULL;                  \
+    if (!real_##func) {                                                  \
+      real_##func = (ret_type(*)(__VA_ARGS__))GetRealLibcAddress(#func); \
+    }                                                                    \
+    CHECK(real_##func);
+
+// --------------- sanitizer_libc.h
+uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
+                   u64 offset) {
+  if ((flags & MAP_ANONYMOUS) != 0)
+    fd = -1;
+
+  int mapping =
+      (flags & MAP_SHARED) != 0 ? REGION_NO_PRIVATE_MAP : REGION_PRIVATE_MAP;
+
+  uint32 addressSpec;
+  if ((flags & MAP_FIXED) != 0)
+    addressSpec = B_EXACT_ADDRESS;
+  else if (addr != NULL)
+    addressSpec = B_BASE_ADDRESS;
+  else
+    addressSpec = B_RANDOMIZED_ANY_ADDRESS;
+
+  uint32 areaProtection = 0;
+  if ((prot & PROT_READ) != 0)
+    areaProtection |= B_READ_AREA;
+  if ((prot & PROT_WRITE) != 0)
+    areaProtection |= B_WRITE_AREA;
+  if ((prot & PROT_EXEC) != 0)
+    areaProtection |= B_EXECUTE_AREA;
+
+  if ((flags & MAP_NORESERVE) != 0)
+    areaProtection |= B_OVERCOMMITTING_AREA;
+
+  area_id area = _kern_map_file("sanitizer mmap", &addr, addressSpec, length,
+                                areaProtection, mapping, true, fd, offset);
+  if (area < 0)
+    RETURN_AND_SET_ERRNO(area);
+  return (uptr)addr;
+}
+
+uptr internal_munmap(void *addr, uptr length) {
+  DEFINE__REAL(int, munmap, void *a, uptr b);
+  return _REAL(munmap, addr, length);
+}
+
+uptr internal_mremap(void *old_address, uptr old_size, uptr new_size, int flags,
+                     void *new_address) {
+  CHECK(false && "internal_mremap is unimplemented on Haiku");
+  return 0;
+}
+
+int internal_mprotect(void *addr, uptr length, int prot) {
+  DEFINE__REAL(int, mprotect, void *a, uptr b, int c);
+  return _REAL(mprotect, addr, length, prot);
+}
+
+int internal_madvise(uptr addr, uptr length, int advice) {
+  DEFINE__REAL(int, madvise, void *a, uptr b, int c);
+  return _REAL(madvise, (void *)addr, length, advice);
+}
+
+uptr internal_close(fd_t fd) {
+  CHECK(&_kern_close);
+  RETURN_AND_SET_ERRNO(_kern_close(fd));
+}
+
+uptr internal_open(const char *filename, int flags) {
+  CHECK(&_kern_open);
+  RETURN_AND_SET_ERRNO(_kern_open(-1, filename, flags, 0));
+}
+
+uptr internal_open(const char *filename, int flags, u32 mode) {
+  CHECK(&_kern_open);
+  RETURN_AND_SET_ERRNO(_kern_open(-1, filename, flags, mode));
+}
+
+uptr internal_read(fd_t fd, void *buf, uptr count) {
+  sptr res;
+  CHECK(&_kern_read);
+  HANDLE_EINTR(res, (sptr)_kern_read(fd, -1, buf, (size_t)count));
+  RETURN_AND_SET_ERRNO(res);
+  return res;
+}
+
+uptr internal_write(fd_t fd, const void *buf, uptr count) {
+  sptr res;
+  CHECK(&_kern_write);
+  HANDLE_EINTR(res, (sptr)_kern_write(fd, -1, buf, count));
+  RETURN_AND_SET_ERRNO(res);
+  return res;
+}
+
+uptr internal_ftruncate(fd_t fd, uptr size) {
+  sptr res;
+  DEFINE__REAL(int, ftruncate, int, off_t);
+  return _REAL(ftruncate, fd, size);
+  return res;
+}
+
+uptr internal_stat(const char *path, void *buf) {
+  DEFINE__REAL(int, _stat_current, const char *a, void *b);
+  return _REAL(_stat_current, path, buf);
+}
+
+uptr internal_lstat(const char *path, void *buf) {
+  DEFINE__REAL(int, _lstat_current, const char *a, void *b);
+  return _REAL(_lstat_current, path, buf);
+}
+
+uptr internal_fstat(fd_t fd, void *buf) {
+  DEFINE__REAL(int, _fstat_current, int a, void *b);
+  return _REAL(_fstat_current, fd, buf);
+}
+
+uptr internal_filesize(fd_t fd) {
+  struct stat st;
+  if (internal_fstat(fd, &st))
+    return -1;
+  return (uptr)st.st_size;
+}
+
+uptr internal_dup(int oldfd) {
+  DEFINE__REAL(int, dup, int a);
+  return _REAL(dup, oldfd);
+}
+
+uptr internal_dup2(int oldfd, int newfd) {
+  DEFINE__REAL(int, dup2, int a, int b);
+  return _REAL(dup2, oldfd, newfd);
+}
+
+uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
+  CHECK(&_kern_read_link);
+  RETURN_AND_SET_ERRNO(_kern_read_link(-1, path, buf, &bufsize));
+}
+
+uptr internal_unlink(const char *path) {
+  DEFINE__REAL(int, unlink, const char *a);
+  return _REAL(unlink, path);
+}
+
+uptr internal_rename(const char *oldpath, const char *newpath) {
+  DEFINE__REAL(int, rename, const char *a, const char *b);
+  return _REAL(rename, oldpath, newpath);
+}
+
+uptr internal_sched_yield() {
+  CHECK(&_kern_thread_yield);
+  _kern_thread_yield();
+  return 0;
+}
+
+void internal__exit(int exitcode) {
+  DEFINE__REAL(void, _exit, int a);
+  _REAL(_exit, exitcode);
+  Die();  // Unreachable.
+}
+
+void internal_usleep(u64 useconds) {
+  _kern_snooze_etc(useconds, B_SYSTEM_TIMEBASE, B_RELATIVE_TIMEOUT, NULL);
+}
+
+uptr internal_execve(const char *filename, char *const argv[],
+                     char *const envp[]) {
+  DEFINE__REAL(int, execve, const char *, char *const[], char *const[]);
+  return _REAL(execve, filename, argv, envp);
+}
+
+#  if 0
+tid_t GetTid() {
+  DEFINE__REAL(int, _lwp_self);
+  return _REAL(_lwp_self);
+}
+
+int TgKill(pid_t pid, tid_t tid, int sig) {
+  DEFINE__REAL(int, _lwp_kill, int a, int b);
+  (void)pid;
+  return _REAL(_lwp_kill, tid, sig);
+}
+
+u64 NanoTime() {
+  timeval tv;
+  DEFINE__REAL(int, __gettimeofday50, void *a, void *b);
+  internal_memset(&tv, 0, sizeof(tv));
+  _REAL(__gettimeofday50, &tv, 0);
+  return (u64)tv.tv_sec * 1000 * 1000 * 1000 + tv.tv_usec * 1000;
+}
+#  endif
+
+uptr internal_clock_gettime(__sanitizer_clockid_t clk_id, void *tp) {
+  DEFINE__REAL(int, __clock_gettime50, __sanitizer_clockid_t a, void *b);
+  return _REAL(__clock_gettime50, clk_id, tp);
+}
+
+uptr internal_ptrace(int request, int pid, void *addr, int data) {
+  DEFINE__REAL(int, ptrace, int a, int b, void *c, int d);
+  return _REAL(ptrace, request, pid, addr, data);
+}
+
+uptr internal_waitpid(int pid, int *status, int options) {
+  DEFINE__REAL(int, waitpid, pid_t, int *, int);
+  return _REAL(waitpid, pid, status, options);
+}
+
+uptr internal_getpid() {
+  DEFINE__REAL(int, getpid);
+  return _REAL(getpid);
+}
+
+uptr internal_getppid() {
+  DEFINE__REAL(int, getppid);
+  return _REAL(getppid);
+}
+
+int internal_dlinfo(void *handle, int request, void *p) {
+  DEFINE__REAL(int, dlinfo, void *a, int b, void *c);
+  return _REAL(dlinfo, handle, request, p);
+}
+
+uptr internal_getdents(fd_t fd, void *dirp, unsigned int count) {
+  DEFINE__REAL(int, __getdents30, int a, void *b, size_t c);
+  return _REAL(__getdents30, fd, dirp, count);
+}
+
+uptr internal_lseek(fd_t fd, OFF_T offset, int whence) {
+  CHECK(&_kern_seek);
+  off_t result = _kern_seek(fd, offset, whence);
+  if (result < 0) {
+    errno = result;
+    return -1;
+  }
+  return result;
+}
+
+uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+  Printf("internal_prctl not implemented for Haiku");
+  Die();
+  return 0;
+}
+
+uptr internal_sigaltstack(const void *ss, void *oss) {
+  DEFINE__REAL(int, __sigaltstack14, const void *a, void *b);
+  return _REAL(__sigaltstack14, ss, oss);
+}
+
+int internal_fork() {
+  DEFINE__REAL(int, fork);
+  return _REAL(fork);
+}
+
+#  if 0
+int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
+                    uptr *oldlenp, const void *newp, uptr newlen) {
+  CHECK(&__sysctl);
+  return __sysctl(name, namelen, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
+}
+#  endif
+
+int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
+                          const void *newp, uptr newlen) {
+  DEFINE__REAL(int, sysctlbyname, const char *a, void *b, size_t *c,
+               const void *d, size_t e);
+  return _REAL(sysctlbyname, sname, oldp, (size_t *)oldlenp, newp,
+               (size_t)newlen);
+}
+
+uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
+                          __sanitizer_sigset_t *oldset) {
+  CHECK(&_kern_set_signal_mask);
+  return _kern_set_signal_mask(how, set, oldset);
+}
+
+void internal_sigfillset(__sanitizer_sigset_t *set) {
+  DEFINE__REAL(int, __sigfillset14, const void *a);
+  (void)_REAL(__sigfillset14, set);
+}
+
+void internal_sigemptyset(__sanitizer_sigset_t *set) {
+  DEFINE__REAL(int, __sigemptyset14, const void *a);
+  (void)_REAL(__sigemptyset14, set);
+}
+
+void internal_sigdelset(__sanitizer_sigset_t *set, int signo) {
+  DEFINE__REAL(int, __sigdelset14, const void *a, int b);
+  (void)_REAL(__sigdelset14, set, signo);
+}
+
+uptr internal_clone(int (*fn)(void *), void *child_stack, int flags,
+                    void *arg) {
+  DEFINE__REAL(int, clone, int (*a)(void *b), void *c, int d, void *e);
+
+  return _REAL(clone, fn, child_stack, flags, arg);
+}
+
+}  // namespace __sanitizer
+
+#endif
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index 19d414b6b3657..a06682c3bbe56 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -14,7 +14,7 @@
 #include "sanitizer_platform.h"
 
 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 #  include "sanitizer_common.h"
 #  include "sanitizer_flags.h"
@@ -63,15 +63,17 @@
 #  include <sched.h>
 #  include <signal.h>
 #  include <sys/mman.h>
-#  if !SANITIZER_SOLARIS
+#  if !SANITIZER_SOLARIS && !SANITIZER_HAIKU
 #    include <sys/ptrace.h>
 #  endif
 #  include <sys/resource.h>
 #  include <sys/stat.h>
-#  include <sys/syscall.h>
+#  if !SANITIZER_HAIKU
+#    include <sys/syscall.h>
+#    include <ucontext.h>
+#  endif
 #  include <sys/time.h>
 #  include <sys/types.h>
-#  include <ucontext.h>
 #  include <unistd.h>
 
 #  if SANITIZER_LINUX
@@ -124,6 +126,13 @@ extern struct ps_strings *__ps_strings;
 #    define environ _environ
 #  endif
 
+#  if SANITIZER_HAIKU
+#    include <OS.h>
+#    include <elf.h>
+#    include <image.h>
+extern "C" char **__libc_argv;
+#  endif
+
 extern char **environ;
 
 #  if SANITIZER_LINUX
@@ -252,7 +261,7 @@ ScopedBlockSignals::~ScopedBlockSignals() { SetSigProcMask(&saved_, nullptr); }
 #  endif
 
 // --------------- sanitizer_libc.h
-#  if !SANITIZER_SOLARIS && !SANITIZER_NETBSD
+#  if !SANITIZER_SOLARIS && !SANITIZER_NETBSD && !SANITIZER_HAIKU
 #    if !SANITIZER_S390
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
                    u64 offset) {
@@ -599,7 +608,7 @@ uptr internal_execve(const char *filename, char *const argv[],
 }
 #  endif  // !SANITIZER_SOLARIS && !SANITIZER_NETBSD
 
-#  if !SANITIZER_NETBSD
+#  if !SANITIZER_NETBSD && !SANITIZER_HAIKU
 void internal__exit(int exitcode) {
 #    if SANITIZER_FREEBSD || SANITIZER_SOLARIS
   internal_syscall(SYSCALL(exit), exitcode);
@@ -636,6 +645,8 @@ tid_t GetTid() {
   return Tid;
 #    elif SANITIZER_SOLARIS
   return thr_self();
+#    elif SANITIZER_HAIKU
+  return find_thread(NULL);
 #    else
   return internal_syscall(SYSCALL(gettid));
 #    endif
@@ -651,6 +662,8 @@ int TgKill(pid_t pid, tid_t tid, int sig) {
   errno = thr_kill(tid, sig);
   // TgKill is expected to return -1 on error, not an errno.
   return errno != 0 ? -1 : 0;
+#    elif SANITIZER_HAIKU
+  return kill_thread(tid);
 #    endif
 }
 #  endif
@@ -678,7 +691,8 @@ u64 NanoTime() {
 // 'environ' array (on some others) and does not use libc. This function
 // should be called first inside __asan_init.
 const char *GetEnv(const char *name) {
-#  if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_SOLARIS
+#  if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_SOLARIS || \
+      SANITIZER_HAIKU
   if (::environ != 0) {
     uptr NameLen = internal_strlen(name);
     for (char **Env = ::environ; *Env != 0; Env++) {
@@ -716,13 +730,14 @@ const char *GetEnv(const char *name) {
 #  endif
 }
 
-#  if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_GO
+#  if !SANITIZER_HAIKU && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \
+      !SANITIZER_GO
 extern "C" {
 SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end;
 }
 #  endif
 
-#  if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+#  if !SANITIZER_HAIKU && !SANITIZER_FREEBSD && !SANITIZER_NETBSD
 static void ReadNullSepFileToArray(const char *path, char ***arr,
                                    int arr_size) {
   char *buff;
@@ -749,7 +764,10 @@ static void ReadNullSepFileToArray(const char *path, char ***arr,
 #  endif
 
 static void GetArgsAndEnv(char ***argv, char ***envp) {
-#  if SANITIZER_FREEBSD
+#  if SANITIZER_HAIKU
+  *argv = __libc_argv;
+  *envp = environ;
+#  elif SANITIZER_FREEBSD
   // On FreeBSD, retrieving the argument and environment arrays is done via the
   // kern.ps_strings sysctl, which returns a pointer to a structure containing
   // this information. See also <sys/exec.h>.
@@ -808,7 +826,7 @@ char **GetEnviron() {
 void FutexWait(atomic_uint32_t *p, u32 cmp) {
 #    if SANITIZER_FREEBSD
   _umtx_op(p, UMTX_OP_WAIT_UINT, cmp, 0, 0);
-#    elif SANITIZER_NETBSD
+#    elif SANITIZER_NETBSD || SANITIZER_HAIKU
   sched_yield(); /* No userspace futex-like synchronization */
 #    else
   internal_syscall(SYSCALL(futex), (uptr)p, FUTEX_WAIT_PRIVATE, cmp, 0, 0, 0);
@@ -818,7 +836,7 @@ void FutexWait(atomic_uint32_t *p, u32 cmp) {
 void FutexWake(atomic_uint32_t *p, u32 count) {
 #    if SANITIZER_FREEBSD
   _umtx_op(p, UMTX_OP_WAKE, count, 0, 0);
-#    elif SANITIZER_NETBSD
+#    elif SANITIZER_NETBSD || SANITIZER_HAIKU
   /* No userspace futex-like synchronization */
 #    else
   internal_syscall(SYSCALL(futex), (uptr)p, FUTEX_WAKE_PRIVATE, count, 0, 0, 0);
@@ -850,7 +868,7 @@ struct linux_dirent {
 };
 #  endif
 
-#  if !SANITIZER_SOLARIS && !SANITIZER_NETBSD
+#  if !SANITIZER_SOLARIS && !SANITIZER_NETBSD && !SANITIZER_HAIKU
 // Syscall wrappers.
 uptr internal_ptrace(int request, int pid, void *addr, void *data) {
   return internal_syscall(SYSCALL(ptrace), request, pid, (uptr)addr,
@@ -1064,7 +1082,7 @@ bool internal_sigismember(__sanitizer_sigset_t *set, int signum) {
 #    endif
 #  endif  // !SANITIZER_SOLARIS
 
-#  if !SANITIZER_NETBSD
+#  if !SANITIZER_NETBSD && !SANITIZER_HAIKU
 // ThreadLister implementation.
 ThreadLister::ThreadLister(pid_t pid) : buffer_(4096) {
   task_path_.AppendF("/proc/%d/task", pid);
@@ -1268,7 +1286,19 @@ uptr GetPageSize() {
 #  endif
 
 uptr ReadBinaryName(/*out*/ char *buf, uptr buf_len) {
-#  if SANITIZER_SOLARIS
+#  if SANITIZER_HAIKU
+  int cookie = 0;
+  image_info info;
+  const char *argv0 = "<UNKNOWN>";
+  while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
+    if (info.type != B_APP_IMAGE)
+      continue;
+    argv0 = info.name;
+    break;
+  }
+  internal_strncpy(buf, argv0, buf_len);
+  return internal_strlen(buf);
+#  elif SANITIZER_SOLARIS
   const char *default_module_name = getexecname();
   CHECK_NE(default_module_name, NULL);
   return internal_snprintf(buf, buf_len, "%s", default_module_name);
@@ -1334,11 +1364,11 @@ bool LibraryNameIs(const char *full_name, const char *base_name) {
   return (name[base_name_length] == '-' || name[base_name_length] == '.');
 }
 
-#  if !SANITIZER_ANDROID
+#  if !SANITIZER_ANDROID && !SANITIZER_HAIKU
 // Call cb for each region mapped by map.
 void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)) {
   CHECK_NE(map, nullptr);
-#    if !SANITIZER_FREEBSD
+#    if !SANITIZER_FREEBSD && !SANITIZER_HAIKU
   typedef ElfW(Phdr) Elf_Phdr;
   typedef ElfW(Ehdr) Elf_Ehdr;
 #    endif  // !SANITIZER_FREEBSD
@@ -1997,11 +2027,15 @@ using Context = ucontext_t;
 SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
   Context *ucontext = (Context *)context;
 #  if defined(__x86_64__) || defined(__i386__)
+#    if !SANITIZER_HAIKU
   static const uptr PF_WRITE = 1U << 1;
+#    endif
 #    if SANITIZER_FREEBSD
   uptr err = ucontext->uc_mcontext.mc_err;
 #    elif SANITIZER_NETBSD
   uptr err = ucontext->uc_mcontext.__gregs[_REG_ERR];
+#    elif SANITIZER_HAIKU
+  uptr err = ucontext->uc_mcontext.r13;
 #    elif SANITIZER_SOLARIS && defined(__i386__)
   const int Err = 13;
   uptr err = ucontext->uc_mcontext.gregs[Err];
@@ -2614,6 +2648,11 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
   *pc = ucontext->uc_mcontext.mc_rip;
   *bp = ucontext->uc_mcontext.mc_rbp;
   *sp = ucontext->uc_mcontext.mc_rsp;
+#    elif SANITIZER_HAIKU
+  ucontext_t *ucontext = (ucontext_t *)context;
+  *pc = ucontext->uc_mcontext.rip;
+  *bp = ucontext->uc_mcontext.rbp;
+  *sp = ucontext->uc_mcontext.rsp;
 #    else
   ucontext_t *ucontext = (ucontext_t *)context;
   *pc = ucontext->uc_mcontext.gregs[REG_RIP];
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
index 8b7874bb5a349..c1562506babf3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
@@ -14,7 +14,7 @@
 
 #include "sanitizer_platform.h"
 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 #  include "sanitizer_common.h"
 #  include "sanitizer_internal_defs.h"
 #  include "sanitizer_platform_limits_freebsd.h"
@@ -31,6 +31,11 @@ namespace __sanitizer {
 // the one in <dirent.h>, which is used by readdir().
 struct linux_dirent;
 
+#  if SANITIZER_HAIKU
+struct MemoryMappingLayoutData {
+  long signed int cookie;
+};
+#  else
 struct ProcSelfMapsBuff {
   char *data;
   uptr mmaped_size;
@@ -43,6 +48,7 @@ struct MemoryMappingLayoutData {
 };
 
 void ReadProcMaps(ProcSelfMapsBuff *proc_maps);
+#  endif
 
 // Syscall wrappers.
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index 16eb8dec63e92..c2e2e290b0ecf 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -14,7 +14,7 @@
 #include "sanitizer_platform.h"
 
 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 
 #  include "sanitizer_allocator_internal.h"
 #  include "sanitizer_atomic.h"
@@ -28,6 +28,10 @@
 #  include "sanitizer_procmaps.h"
 #  include "sanitizer_solaris.h"
 
+#  if SANITIZER_HAIKU
+#    define _DEFAULT_SOURCE
+#  endif
+
 #  if SANITIZER_NETBSD
 #    // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
 #    include <sys/param.h>
@@ -80,6 +84,11 @@ extern "C" int __sys_sigaction(int signum, const struct sigaction *act,
 #    include <thread.h>
 #  endif
 
+#  if SANITIZER_HAIKU
+#    include <kernel/OS.h>
+#    include <sys/link_elf.h>
+#  endif
+
 #  if !SANITIZER_ANDROID
 #    include <elf.h>
 #    include <unistd.h>
@@ -643,6 +652,7 @@ static void GetTls(uptr *addr, uptr *size) {
       *addr = (uptr)tcb->tcb_dtv[1];
     }
   }
+#    elif SANITIZER_HAIKU
 #    else
 #      error "Unknown OS"
 #    endif
@@ -713,8 +723,13 @@ static int AddModuleSegments(const char *module_name, dl_phdr_info *info,
     if (phdr->p_type == PT_LOAD) {
       uptr cur_beg = info->dlpi_addr + phdr->p_vaddr;
       uptr cur_end = cur_beg + phdr->p_memsz;
+#  if SANITIZER_HAIKU
+      bool executable = phdr->p_flags & PF_EXECUTE;
+      bool writable = phdr->p_flags & PF_WRITE;
+#  else
       bool executable = phdr->p_flags & PF_X;
       bool writable = phdr->p_flags & PF_W;
+#  endif
       cur_module.addAddressRange(cur_beg, cur_end, executable, writable);
     } else if (phdr->p_type == PT_NOTE) {
 #  ifdef NT_GNU_BUILD_ID
@@ -854,6 +869,10 @@ u32 GetNumberOfCPUs() {
 #    endif
   CHECK_EQ(internal_sysctl(req, 2, &ncpu, &len, NULL, 0), 0);
   return ncpu;
+#  elif SANITIZER_HAIKU
+  system_info info;
+  get_system_info(&info);
+  return info.cpu_count;
 #  elif SANITIZER_SOLARIS
   return sysconf(_SC_NPROCESSORS_ONLN);
 #  else
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 57966403c92a9..9f5f41cd85514 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -14,7 +14,7 @@
 
 #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
     !defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) &&     \
-    !(defined(__sun__) && defined(__svr4__))
+    !(defined(__sun__) && defined(__svr4__)) && !defined(__HAIKU__)
 #  error "This operating system is not supported"
 #endif
 
@@ -55,6 +55,12 @@
 #  define SANITIZER_SOLARIS 0
 #endif
 
+#if defined(__HAIKU__)
+#  define SANITIZER_HAIKU 1
+#else
+#  define SANITIZER_HAIKU 0
+#endif
+
 // - SANITIZER_APPLE: all Apple code
 //   - TARGET_OS_OSX: macOS
 //   - SANITIZER_IOS: devices (iOS and iOS-like)
@@ -136,9 +142,9 @@
 #  define SANITIZER_MUSL 0
 #endif
 
-#define SANITIZER_POSIX                                     \
+#define SANITIZER_POSIX                                       \
   (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_APPLE || \
-   SANITIZER_NETBSD || SANITIZER_SOLARIS)
+   SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU)
 
 #if __LP64__ || defined(_WIN64)
 #  define SANITIZER_WORDSIZE 64
@@ -410,7 +416,8 @@
 #  define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0
 #endif
 
-#if SANITIZER_FREEBSD || SANITIZER_APPLE || SANITIZER_NETBSD || SANITIZER_SOLARIS
+#if SANITIZER_FREEBSD || SANITIZER_APPLE || SANITIZER_NETBSD || \
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 #  define SANITIZER_MADVISE_DONTNEED MADV_FREE
 #else
 #  define SANITIZER_MADVISE_DONTNEED MADV_DONTNEED
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index ec5f2edab6a64..edb619f4ddafa 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -24,7 +24,7 @@
 // Must go after undef _FILE_OFFSET_BITS.
 #include "sanitizer_platform.h"
 
-#if SANITIZER_LINUX || SANITIZER_APPLE
+#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU
 // Must go after undef _FILE_OFFSET_BITS.
 #include "sanitizer_glibc_version.h"
 
@@ -52,7 +52,7 @@
 #include <time.h>
 #include <wchar.h>
 #include <regex.h>
-#if !SANITIZER_APPLE
+#if !SANITIZER_APPLE && !SANITIZER_HAIKU
 #include <utmp.h>
 #endif
 
@@ -61,7 +61,9 @@
 #endif
 
 #if !SANITIZER_ANDROID
+#if !SANITIZER_HAIKU
 #include <sys/mount.h>
+#endif
 #include <sys/timeb.h>
 #include <utmpx.h>
 #endif
@@ -111,9 +113,11 @@ typedef struct user_fpregs elf_fpregset_t;
 
 #if !SANITIZER_ANDROID
 #include <ifaddrs.h>
+#if !SANITIZER_HAIKU
 #include <sys/ucontext.h>
 #include <wordexp.h>
 #endif
+#endif
 
 #if SANITIZER_LINUX
 #if SANITIZER_GLIBC
@@ -163,7 +167,7 @@ typedef struct user_fpregs elf_fpregset_t;
 #include <sys/vfs.h>
 #include <sys/epoll.h>
 #include <linux/capability.h>
-#else
+#elif !SANITIZER_HAIKU
 #include <fstab.h>
 #endif // SANITIZER_LINUX
 
@@ -173,6 +177,11 @@ typedef struct user_fpregs elf_fpregset_t;
 #include <sys/sockio.h>
 #endif
 
+#if SANITIZER_HAIKU
+#include <sys/sockio.h>
+#include <sys/ioctl.h>
+#endif
+
 // Include these after system headers to avoid name clashes and ambiguities.
 #  include "sanitizer_common.h"
 #  include "sanitizer_internal_defs.h"
@@ -217,7 +226,7 @@ namespace __sanitizer {
   unsigned struct_fstab_sz = sizeof(struct fstab);
 #endif  // SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD ||
         // SANITIZER_APPLE
-#if !SANITIZER_ANDROID
+#if !SANITIZER_ANDROID && !SANITIZER_HAIKU
   unsigned struct_statfs_sz = sizeof(struct statfs);
   unsigned struct_sockaddr_sz = sizeof(struct sockaddr);
 
@@ -324,7 +333,7 @@ namespace __sanitizer {
   int shmctl_shm_stat = (int)SHM_STAT;
 #endif
 
-#if !SANITIZER_APPLE && !SANITIZER_FREEBSD
+#if !SANITIZER_APPLE && !SANITIZER_FREEBSD && !SANITIZER_HAIKU
   unsigned struct_utmp_sz = sizeof(struct utmp);
 #endif
 #if !SANITIZER_ANDROID
@@ -356,7 +365,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
   int glob_altdirfunc = GLOB_ALTDIRFUNC;
 #endif
 
-#  if !SANITIZER_ANDROID
+#  if !SANITIZER_ANDROID && !SANITIZER_HAIKU
   const int wordexp_wrde_dooffs = WRDE_DOOFFS;
 #  endif  // !SANITIZER_ANDROID
 
@@ -540,7 +549,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
   unsigned struct_sock_fprog_sz = sizeof(struct sock_fprog);
 #  endif  // SANITIZER_GLIBC
 
-#  if !SANITIZER_ANDROID && !SANITIZER_APPLE
+#  if !SANITIZER_ANDROID && !SANITIZER_APPLE && !SANITIZER_HAIKU
   unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req);
   unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
 #endif
@@ -551,12 +560,14 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
 
   const unsigned IOCTL_NOT_PRESENT = 0;
 
+  unsigned IOCTL_FIONBIO = FIONBIO;
+#if !SANITIZER_HAIKU
   unsigned IOCTL_FIOASYNC = FIOASYNC;
   unsigned IOCTL_FIOCLEX = FIOCLEX;
   unsigned IOCTL_FIOGETOWN = FIOGETOWN;
-  unsigned IOCTL_FIONBIO = FIONBIO;
   unsigned IOCTL_FIONCLEX = FIONCLEX;
   unsigned IOCTL_FIOSETOWN = FIOSETOWN;
+#endif
   unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI;
   unsigned IOCTL_SIOCATMARK = SIOCATMARK;
   unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI;
@@ -577,23 +588,27 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
   unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU;
   unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK;
   unsigned IOCTL_SIOCSPGRP = SIOCSPGRP;
+
+#if !SANITIZER_HAIKU
   unsigned IOCTL_TIOCCONS = TIOCCONS;
-  unsigned IOCTL_TIOCEXCL = TIOCEXCL;
   unsigned IOCTL_TIOCGETD = TIOCGETD;
+  unsigned IOCTL_TIOCNOTTY = TIOCNOTTY;
+  unsigned IOCTL_TIOCPKT = TIOCPKT;
+  unsigned IOCTL_TIOCSETD = TIOCSETD;
+  unsigned IOCTL_TIOCSTI = TIOCSTI;
+#endif
+
+  unsigned IOCTL_TIOCEXCL = TIOCEXCL;
   unsigned IOCTL_TIOCGPGRP = TIOCGPGRP;
   unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ;
   unsigned IOCTL_TIOCMBIC = TIOCMBIC;
   unsigned IOCTL_TIOCMBIS = TIOCMBIS;
   unsigned IOCTL_TIOCMGET = TIOCMGET;
   unsigned IOCTL_TIOCMSET = TIOCMSET;
-  unsigned IOCTL_TIOCNOTTY = TIOCNOTTY;
   unsigned IOCTL_TIOCNXCL = TIOCNXCL;
   unsigned IOCTL_TIOCOUTQ = TIOCOUTQ;
-  unsigned IOCTL_TIOCPKT = TIOCPKT;
   unsigned IOCTL_TIOCSCTTY = TIOCSCTTY;
-  unsigned IOCTL_TIOCSETD = TIOCSETD;
   unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
-  unsigned IOCTL_TIOCSTI = TIOCSTI;
   unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
   unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
@@ -1103,7 +1118,7 @@ COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
 CHECK_SIZE_AND_OFFSET(dirent, d_ino);
 #if SANITIZER_APPLE
 CHECK_SIZE_AND_OFFSET(dirent, d_seekoff);
-#elif SANITIZER_FREEBSD
+#elif SANITIZER_FREEBSD || SANITIZER_HAIKU
 // There is no 'd_off' field on FreeBSD.
 #else
 CHECK_SIZE_AND_OFFSET(dirent, d_off);
@@ -1119,7 +1134,9 @@ CHECK_SIZE_AND_OFFSET(dirent64, d_reclen);
 
 CHECK_TYPE_SIZE(ifconf);
 CHECK_SIZE_AND_OFFSET(ifconf, ifc_len);
+#if !SANITIZER_HAIKU
 CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
+#endif
 
 CHECK_TYPE_SIZE(pollfd);
 CHECK_SIZE_AND_OFFSET(pollfd, fd);
@@ -1174,7 +1191,7 @@ CHECK_TYPE_SIZE(__kernel_loff_t);
 CHECK_TYPE_SIZE(__kernel_fd_set);
 #endif
 
-#if !SANITIZER_ANDROID
+#if !SANITIZER_ANDROID && !SANITIZER_HAIKU
 CHECK_TYPE_SIZE(wordexp_t);
 CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);
 CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);
@@ -1204,7 +1221,9 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_freq);
 CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
 #endif
 
+#if !SANITIZER_HAIKU
 CHECK_TYPE_SIZE(ether_addr);
+#endif
 
 #if SANITIZER_GLIBC || SANITIZER_FREEBSD
 CHECK_TYPE_SIZE(ipc_perm);
@@ -1242,7 +1261,7 @@ CHECK_TYPE_SIZE(clock_t);
 CHECK_TYPE_SIZE(clockid_t);
 #endif
 
-#if !SANITIZER_ANDROID
+#if !SANITIZER_ANDROID && !SANITIZER_HAIKU
 CHECK_TYPE_SIZE(ifaddrs);
 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next);
 CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 1f7e3d21b6a6f..26de940f931b5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -14,7 +14,7 @@
 #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
 #define SANITIZER_PLATFORM_LIMITS_POSIX_H
 
-#if SANITIZER_LINUX || SANITIZER_APPLE
+#if SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU
 
 #include "sanitizer_internal_defs.h"
 #include "sanitizer_platform.h"
@@ -366,7 +366,7 @@ struct __sanitizer_passwd {
   long pw_change;
   char *pw_class;
 #endif
-#if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32))
+#if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32)) && !SANITIZER_HAIKU
   char *pw_gecos;
 #endif
   char *pw_dir;
@@ -374,6 +374,9 @@ struct __sanitizer_passwd {
 #if SANITIZER_APPLE
   long pw_expire;
 #endif
+#if SANITIZER_HAIKU
+  char *pw_gecos;
+#endif
 };
 
 struct __sanitizer_group {
@@ -433,7 +436,11 @@ struct __sanitizer_tm {
   int tm_wday;
   int tm_yday;
   int tm_isdst;
+#if SANITIZER_HAIKU
+  int tm_gmtoff;
+#else
   long int tm_gmtoff;
+#endif
   const char *tm_zone;
 };
 
@@ -454,7 +461,7 @@ struct __sanitizer_file_handle {
 };
 #endif
 
-#if SANITIZER_APPLE
+#if SANITIZER_APPLE || SANITIZER_HAIKU
 struct __sanitizer_msghdr {
   void *msg_name;
   unsigned msg_namelen;
@@ -502,6 +509,15 @@ struct __sanitizer_dirent {
   unsigned short d_reclen;
   // more fields that we don't care about
 };
+#elif SANITIZER_HAIKU
+struct __sanitizer_dirent {
+  int d_dev;
+  int d_pdev;
+  unsigned long long d_ino;
+  unsigned long long d_pino;
+  unsigned short d_reclen;
+  // more fields that we don't care about
+};
 #  elif (SANITIZER_LINUX && !SANITIZER_GLIBC) || defined(__x86_64__) || \
       defined(__hexagon__)
 struct __sanitizer_dirent {
@@ -529,13 +545,15 @@ struct __sanitizer_dirent64 {
 extern unsigned struct_sock_fprog_sz;
 #endif
 
-#if defined(__x86_64__) && !defined(_LP64)
+#if SANITIZER_HAIKU
+typedef int __sanitizer_clock_t;
+#elif defined(__x86_64__) && !defined(_LP64)
 typedef long long __sanitizer_clock_t;
 #else
 typedef long __sanitizer_clock_t;
 #endif
 
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX || SANITIZER_HAIKU
 typedef int __sanitizer_clockid_t;
 typedef unsigned long long __sanitizer_eventfd_t;
 #endif
@@ -584,6 +602,8 @@ typedef unsigned long __sanitizer_sigset_t;
 # endif
 #elif SANITIZER_APPLE
 typedef unsigned __sanitizer_sigset_t;
+#elif SANITIZER_HAIKU
+typedef unsigned long __sanitizer_sigset_t;
 #elif SANITIZER_LINUX
 struct __sanitizer_sigset_t {
   // The size is determined by looking at sizeof of real sigset_t on linux.
@@ -692,7 +712,7 @@ struct __sanitizer_sigaction {
 #        endif
 #      endif
 #    endif
-#    if SANITIZER_LINUX
+#    if SANITIZER_LINUX || SANITIZER_HAIKU
   void (*sa_restorer)();
 #    endif
 #    if defined(__mips__) && (SANITIZER_WORDSIZE == 32) && !SANITIZER_MUSL
@@ -779,7 +799,7 @@ struct __sanitizer_addrinfo {
   int ai_family;
   int ai_socktype;
   int ai_protocol;
-#if SANITIZER_ANDROID || SANITIZER_APPLE
+#if SANITIZER_ANDROID || SANITIZER_APPLE || SANITIZER_HAIKU
   unsigned ai_addrlen;
   char *ai_canonname;
   void *ai_addr;
@@ -1128,23 +1148,25 @@ extern unsigned IOCTL_SIOCSIFMETRIC;
 extern unsigned IOCTL_SIOCSIFMTU;
 extern unsigned IOCTL_SIOCSIFNETMASK;
 extern unsigned IOCTL_SIOCSPGRP;
+#if !SANITIZER_HAIKU
 extern unsigned IOCTL_TIOCCONS;
-extern unsigned IOCTL_TIOCEXCL;
 extern unsigned IOCTL_TIOCGETD;
+extern unsigned IOCTL_TIOCNOTTY;
+extern unsigned IOCTL_TIOCPKT;
+extern unsigned IOCTL_TIOCSETD;
+extern unsigned IOCTL_TIOCSTI;
+#endif
+extern unsigned IOCTL_TIOCEXCL;
 extern unsigned IOCTL_TIOCGPGRP;
 extern unsigned IOCTL_TIOCGWINSZ;
 extern unsigned IOCTL_TIOCMBIC;
 extern unsigned IOCTL_TIOCMBIS;
 extern unsigned IOCTL_TIOCMGET;
 extern unsigned IOCTL_TIOCMSET;
-extern unsigned IOCTL_TIOCNOTTY;
 extern unsigned IOCTL_TIOCNXCL;
 extern unsigned IOCTL_TIOCOUTQ;
-extern unsigned IOCTL_TIOCPKT;
 extern unsigned IOCTL_TIOCSCTTY;
-extern unsigned IOCTL_TIOCSETD;
 extern unsigned IOCTL_TIOCSPGRP;
-extern unsigned IOCTL_TIOCSTI;
 extern unsigned IOCTL_TIOCSWINSZ;
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
 extern unsigned IOCTL_SIOCGETSGCNT;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
index bf3c2c28e32e3..d713ddf847dfb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
@@ -16,7 +16,7 @@
 #include "sanitizer_platform.h"
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_APPLE || SANITIZER_SOLARIS ||  \
+    SANITIZER_APPLE || SANITIZER_SOLARIS || SANITIZER_HAIKU ||  \
     SANITIZER_FUCHSIA
 
 #include "sanitizer_common.h"
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_haiku.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_haiku.cpp
new file mode 100644
index 0000000000000..7a6062a571ba5
--- /dev/null
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_haiku.cpp
@@ -0,0 +1,94 @@
+//===-- sanitizer_procmaps_haiku.cpp --------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Information about the process mappings
+// (Haiku-specific parts).
+//===----------------------------------------------------------------------===//
+
+#include "sanitizer_platform.h"
+#if SANITIZER_HAIKU
+#  include "sanitizer_common.h"
+#  include "sanitizer_procmaps.h"
+
+#  include <kernel/OS.h>
+
+namespace __sanitizer {
+
+void MemoryMappedSegment::AddAddressRanges(LoadedModule *module) {
+  // data_ should be unused on this platform
+  CHECK(!data_);
+  module->addAddressRange(start, end, IsExecutable(), IsWritable());
+}
+
+MemoryMappingLayout::MemoryMappingLayout(bool) { Reset(); }
+
+void MemoryMappingLayout::Reset() { data_.cookie = 0; }
+
+MemoryMappingLayout::~MemoryMappingLayout() {}
+
+// static
+void MemoryMappingLayout::CacheMemoryMappings() {}
+
+bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) {
+  area_info info;
+  if (get_next_area_info(B_CURRENT_TEAM, &data_.cookie, &info) != B_OK)
+    return false;
+
+  segment->start = (uptr)info.address;
+  segment->end = (uptr)info.address + info.size;
+  segment->offset = 0;
+  segment->protection = 0;
+  if (info.protection & B_READ_AREA)
+    segment->protection |= kProtectionRead;
+  if (info.protection & B_WRITE_AREA)
+    segment->protection |= kProtectionWrite;
+  if (info.protection & B_EXECUTE_AREA)
+    segment->protection |= kProtectionExecute;
+  if (segment->filename) {
+    uptr len = Min((uptr)B_OS_NAME_LENGTH, segment->filename_size - 1);
+    internal_strncpy(segment->filename, info.name, len);
+    segment->filename[len] = 0;
+  }
+  return true;
+}
+
+bool MemoryMappingLayout::Error() const { return false; }
+
+void MemoryMappingLayout::DumpListOfModules(
+    InternalMmapVectorNoCtor<LoadedModule> *modules) {
+  Reset();
+  InternalMmapVector<char> module_name(kMaxPathLength);
+  MemoryMappedSegment segment(module_name.data(), module_name.size());
+  for (uptr i = 0; Next(&segment); i++) {
+    const char *cur_name = segment.filename;
+    if (cur_name[0] == '\0')
+      continue;
+    // Don't subtract 'cur_beg' from the first entry:
+    // * If a binary is compiled w/o -pie, then the first entry in
+    //   process maps is likely the binary itself (all dynamic libs
+    //   are mapped higher in address space). For such a binary,
+    //   instruction offset in binary coincides with the actual
+    //   instruction address in virtual memory (as code section
+    //   is mapped to a fixed memory range).
+    // * If a binary is compiled with -pie, all the modules are
+    //   mapped high at address space (in particular, higher than
+    //   shadow memory of the tool), so the module can't be the
+    //   first entry.
+    uptr base_address = (i ? segment.start : 0) - segment.offset;
+    LoadedModule cur_module;
+    cur_module.set(cur_name, base_address);
+    segment.AddAddressRanges(&cur_module);
+    modules->push_back(cur_module);
+  }
+}
+
+void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}
+
+}  // namespace __sanitizer
+
+#endif
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp
index 6a8e82e2e213c..3f6901a2e7f1b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp
@@ -12,7 +12,7 @@
 
 #include "sanitizer_platform.h"
 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_SOLARIS || SANITIZER_HAIKU
 #include "sanitizer_common.h"
 #include "sanitizer_stacktrace.h"
 
@@ -171,4 +171,4 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
 }  // namespace __sanitizer
 
 #endif  // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_SOLARIS || SANITIZER_HAIKU
diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
index fef8bb772e0e0..55c7d665e639f 100644
--- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
+++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
@@ -134,6 +134,9 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SANITIZER_TEST_LINK_FLAGS_COM
 if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
   list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON "-lc++ -lm")
 endif()
+if(CMAKE_SYSTEM MATCHES "Haiku")
+  list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON "-lbsd")
+endif()
 
 include_directories(..)
 include_directories(../..)
diff --git a/compiler-rt/lib/ubsan/ubsan_platform.h b/compiler-rt/lib/ubsan/ubsan_platform.h
index d2cc2e10bd2f0..c7eb1a967e53f 100644
--- a/compiler-rt/lib/ubsan/ubsan_platform.h
+++ b/compiler-rt/lib/ubsan/ubsan_platform.h
@@ -16,7 +16,7 @@
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ||        \
     defined(__NetBSD__) || defined(__DragonFly__) ||                           \
     (defined(__sun__) && defined(__svr4__)) || defined(_WIN32) ||              \
-    defined(__Fuchsia__)
+    defined(__Fuchsia__) || defined(__HAIKU__)
 #define CAN_SANITIZE_UB 1
 #else
 # define CAN_SANITIZE_UB 0
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index a4c6c61e57998..c1dba77c3532b 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -501,6 +501,7 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
   bool IsFuchsia = TargetTriple.isOSFuchsia();
   bool IsEmscripten = TargetTriple.isOSEmscripten();
   bool IsAMDGPU = TargetTriple.isAMDGPU();
+  bool IsHaiku = TargetTriple.isOSHaiku();
 
   ShadowMapping Mapping;
 
@@ -574,6 +575,9 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
     else if (IsAMDGPU)
       Mapping.Offset = (kSmallX86_64ShadowOffsetBase &
                         (kSmallX86_64ShadowOffsetAlignMask << Mapping.Scale));
+    else if (IsHaiku && IsX86_64)
+      Mapping.Offset = (kSmallX86_64ShadowOffsetBase &
+                        (kSmallX86_64ShadowOffsetAlignMask << Mapping.Scale));
     else
       Mapping.Offset = kDefaultShadowOffset64;
   }

>From ee801cdd6e0ba497939cdc1e4dd34b98b4df3675 Mon Sep 17 00:00:00 2001
From: Jan Korous <jkorous at apple.com>
Date: Fri, 11 Apr 2025 13:28:18 -0700
Subject: [PATCH 41/76] [-Wunsafe-buffer-usage] Add findUnsafePointers
 (#135421)

---
 .../Analysis/Analyses/UnsafeBufferUsage.h     |  3 +
 clang/lib/Analysis/UnsafeBufferUsage.cpp      | 75 +++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
index 267cde64f8f23..9b53f1dc1d759 100644
--- a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
+++ b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
@@ -19,6 +19,7 @@
 #include "clang/AST/Stmt.h"
 #include "clang/Basic/SourceLocation.h"
 #include "llvm/Support/Debug.h"
+#include <set>
 
 namespace clang {
 
@@ -186,6 +187,8 @@ namespace internal {
 bool anyConflict(const llvm::SmallVectorImpl<FixItHint> &FixIts,
                  const SourceManager &SM);
 } // namespace internal
+
+std::set<const Expr *> findUnsafePointers(const FunctionDecl *FD);
 } // end namespace clang
 
 #endif /* LLVM_CLANG_ANALYSIS_ANALYSES_UNSAFEBUFFERUSAGE_H */
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index 0dbb683729427..4eaf8ba61eaec 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1163,6 +1163,8 @@ class WarningGadget : public Gadget {
   virtual void handleUnsafeOperation(UnsafeBufferUsageHandler &Handler,
                                      bool IsRelatedToDecl,
                                      ASTContext &Ctx) const = 0;
+
+  virtual SmallVector<const Expr *, 1> getUnsafePtrs() const = 0;
 };
 
 /// Fixable gadgets correspond to code patterns that aren't always unsafe but
@@ -1245,6 +1247,10 @@ class IncrementGadget : public WarningGadget {
 
     return std::move(Uses);
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override {
+    return {Op->getSubExpr()->IgnoreParenImpCasts()};
+  }
 };
 
 /// A decrement of a pointer-type value is unsafe as it may run the pointer
@@ -1288,6 +1294,10 @@ class DecrementGadget : public WarningGadget {
 
     return {};
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override {
+    return {Op->getSubExpr()->IgnoreParenImpCasts()};
+  }
 };
 
 /// Array subscript expressions on raw pointers as if they're arrays. Unsafe as
@@ -1337,6 +1347,10 @@ class ArraySubscriptGadget : public WarningGadget {
 
     return {};
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override {
+    return {ASE->getBase()->IgnoreParenImpCasts()};
+  }
 };
 
 /// A pointer arithmetic expression of one of the forms:
@@ -1400,6 +1414,11 @@ class PointerArithmeticGadget : public WarningGadget {
 
     return {};
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override {
+    return {Ptr->IgnoreParenImpCasts()};
+  }
+
   // FIXME: pointer adding zero should be fine
   // FIXME: this gadge will need a fix-it
 };
@@ -1457,6 +1476,8 @@ class SpanTwoParamConstructorGadget : public WarningGadget {
     }
     return {};
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override { return {}; }
 };
 
 /// A pointer initialization expression of the form:
@@ -1689,6 +1710,8 @@ class UnsafeBufferUsageAttrGadget : public WarningGadget {
   SourceLocation getSourceLoc() const override { return Op->getBeginLoc(); }
 
   DeclUseList getClaimedVarUseSites() const override { return {}; }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override { return {}; }
 };
 
 /// A call of a constructor that performs unchecked buffer operations
@@ -1727,6 +1750,8 @@ class UnsafeBufferUsageCtorAttrGadget : public WarningGadget {
   SourceLocation getSourceLoc() const override { return Op->getBeginLoc(); }
 
   DeclUseList getClaimedVarUseSites() const override { return {}; }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override { return {}; }
 };
 
 // Warning gadget for unsafe invocation of span::data method.
@@ -1793,6 +1818,8 @@ class DataInvocationGadget : public WarningGadget {
       return true;
     return false;
   }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override { return {}; }
 };
 
 class UnsafeLibcFunctionCallGadget : public WarningGadget {
@@ -1896,6 +1923,8 @@ class UnsafeLibcFunctionCallGadget : public WarningGadget {
   }
 
   DeclUseList getClaimedVarUseSites() const override { return {}; }
+
+  SmallVector<const Expr *, 1> getUnsafePtrs() const override { return {}; }
 };
 
 // Represents expressions of the form `DRE[*]` in the Unspecified Lvalue
@@ -2467,6 +2496,52 @@ template <typename NodeTy> struct CompareNode {
   }
 };
 
+std::set<const Expr *> clang::findUnsafePointers(const FunctionDecl *FD) {
+  class MockReporter : public UnsafeBufferUsageHandler {
+  public:
+    MockReporter() {}
+    void handleUnsafeOperation(const Stmt *, bool, ASTContext &) override {}
+    void handleUnsafeLibcCall(const CallExpr *, unsigned, ASTContext &,
+                              const Expr *UnsafeArg = nullptr) override {}
+    void handleUnsafeOperationInContainer(const Stmt *, bool,
+                                          ASTContext &) override {}
+    void handleUnsafeVariableGroup(const VarDecl *,
+                                   const VariableGroupsManager &, FixItList &&,
+                                   const Decl *,
+                                   const FixitStrategy &) override {}
+    bool isSafeBufferOptOut(const SourceLocation &) const override {
+      return false;
+    }
+    bool ignoreUnsafeBufferInContainer(const SourceLocation &) const override {
+      return false;
+    }
+    bool ignoreUnsafeBufferInLibcCall(const SourceLocation &) const override {
+      return false;
+    }
+    std::string getUnsafeBufferUsageAttributeTextAt(
+        SourceLocation, StringRef WSSuffix = "") const override {
+      return "";
+    }
+  };
+
+  FixableGadgetList FixableGadgets;
+  WarningGadgetList WarningGadgets;
+  DeclUseTracker Tracker;
+  MockReporter IgnoreHandler;
+
+  findGadgets(FD->getBody(), FD->getASTContext(), IgnoreHandler, false,
+              FixableGadgets, WarningGadgets, Tracker);
+
+  std::set<const Expr *> Result;
+  for (auto &G : WarningGadgets) {
+    for (const Expr *E : G->getUnsafePtrs()) {
+      Result.insert(E);
+    }
+  }
+
+  return Result;
+}
+
 struct WarningGadgetSets {
   std::map<const VarDecl *, std::set<const WarningGadget *>,
            // To keep keys sorted by their locations in the map so that the

>From a8da4834f70b4cea0ba8e703a76ccbcd26f88923 Mon Sep 17 00:00:00 2001
From: vdonaldson <37090318+vdonaldson at users.noreply.github.com>
Date: Fri, 11 Apr 2025 16:38:45 -0400
Subject: [PATCH 42/76] [flang] IEEE_SCALB and SCALE - kind=2, kind=3 (#135374)

Implement the kind=2,3 variants of language intrinsic SCALE and
intrinsic module procedure IEEE_SCALB, including exception signaling.
---
 flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 44 ++++++++++++++++---
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index 16cbdf076e659..1ac0627da9524 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -7593,12 +7593,46 @@ IntrinsicLibrary::genSameTypeAs(mlir::Type resultType,
 mlir::Value IntrinsicLibrary::genScale(mlir::Type resultType,
                                        llvm::ArrayRef<mlir::Value> args) {
   assert(args.size() == 2);
+  mlir::FloatType floatTy = mlir::dyn_cast<mlir::FloatType>(resultType);
+  if (!floatTy.isF16() && !floatTy.isBF16()) // kind=4,8,10,16
+    return builder.createConvert(
+        loc, resultType,
+        fir::runtime::genScale(builder, loc, args[0], args[1]));
 
-  mlir::Value realX = fir::getBase(args[0]);
-  mlir::Value intI = fir::getBase(args[1]);
-
-  return builder.createConvert(
-      loc, resultType, fir::runtime::genScale(builder, loc, realX, intI));
+  // Convert kind=2,3 arg X to kind=4. Convert kind=4 result back to kind=2,3.
+  mlir::Type i1Ty = builder.getI1Type();
+  mlir::Type f32Ty = mlir::Float32Type::get(builder.getContext());
+  mlir::Value result = builder.createConvert(
+      loc, resultType,
+      fir::runtime::genScale(
+          builder, loc, builder.createConvert(loc, f32Ty, args[0]), args[1]));
+
+  // kind=4 runtime::genScale call may not signal kind=2,3 exceptions.
+  // If X is finite and result is infinite, signal IEEE_OVERFLOW
+  // If X is finite and scale(result, -I) != X, signal IEEE_UNDERFLOW
+  fir::IfOp outerIfOp =
+      builder.create<fir::IfOp>(loc, genIsFPClass(i1Ty, args[0], finiteTest),
+                                /*withElseRegion=*/false);
+  builder.setInsertionPointToStart(&outerIfOp.getThenRegion().front());
+  fir::IfOp innerIfOp =
+      builder.create<fir::IfOp>(loc, genIsFPClass(i1Ty, result, infiniteTest),
+                                /*withElseRegion=*/true);
+  builder.setInsertionPointToStart(&innerIfOp.getThenRegion().front());
+  genRaiseExcept(_FORTRAN_RUNTIME_IEEE_OVERFLOW |
+                 _FORTRAN_RUNTIME_IEEE_INEXACT);
+  builder.setInsertionPointToStart(&innerIfOp.getElseRegion().front());
+  mlir::Value minusI = builder.create<mlir::arith::MulIOp>(
+      loc, args[1], builder.createAllOnesInteger(loc, args[1].getType()));
+  mlir::Value reverseResult = builder.createConvert(
+      loc, resultType,
+      fir::runtime::genScale(
+          builder, loc, builder.createConvert(loc, f32Ty, result), minusI));
+  genRaiseExcept(
+      _FORTRAN_RUNTIME_IEEE_UNDERFLOW | _FORTRAN_RUNTIME_IEEE_INEXACT,
+      builder.create<mlir::arith::CmpFOp>(loc, mlir::arith::CmpFPredicate::ONE,
+                                          args[0], reverseResult));
+  builder.setInsertionPointAfter(outerIfOp);
+  return result;
 }
 
 // SCAN

>From 609361ab39226a866211286a2ae4f19ab8bb444c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valentin=20Clement=20=28=E3=83=90=E3=83=AC=E3=83=B3?=
 =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=B3=20=E3=82=AF=E3=83=AC=E3=83=A1?=
 =?UTF-8?q?=E3=83=B3=29?= <clementval at gmail.com>
Date: Fri, 11 Apr 2025 13:54:48 -0700
Subject: [PATCH 43/76] [flang][openacc] Allow finalize clause on exit data
 more than once (#135415)

The spec has not strict restriction to allow a single `finalize` clause
on the `exit data` directive. Allowing this clause multiple times does
not change the semantic of it. This patch relax the rules in `ACC.td`
since there is no restriction in the standard.

The OpenACC dialect represent the finalize clause with a UnitAttr so the
attribute will be set if the is one or more `finalize` clause.
---
 flang/test/Lower/OpenACC/acc-exit-data.f90 |  5 +++++
 flang/test/Semantics/OpenACC/acc-data.f90  |  2 +-
 llvm/include/llvm/Frontend/OpenACC/ACC.td  | 12 ++++--------
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/flang/test/Lower/OpenACC/acc-exit-data.f90 b/flang/test/Lower/OpenACC/acc-exit-data.f90
index fbd1edfb6afe4..bf5f7094913a1 100644
--- a/flang/test/Lower/OpenACC/acc-exit-data.f90
+++ b/flang/test/Lower/OpenACC/acc-exit-data.f90
@@ -102,4 +102,9 @@ subroutine acc_exit_data
 !CHECK: acc.exit_data wait_devnum(%[[WAIT6]] : i32) wait(%[[WAIT4]], %[[WAIT5]] : i32, i32) dataOperands(%[[DEVPTR]] : !fir.ref<!fir.array<10x10xf32>>)
 !CHECK: acc.delete accPtr(%[[DEVPTR]] : !fir.ref<!fir.array<10x10xf32>>) {name = "a", structured = false}
 
+  !$acc exit data delete(a) finalize
+!CHECK: acc.exit_data dataOperands(%{{.*}} : !fir.ref<!fir.array<10x10xf32>>) attributes {finalize}
+
+  !$acc exit data delete(a) finalize finalize
+!CHECK: acc.exit_data dataOperands(%{{.*}} : !fir.ref<!fir.array<10x10xf32>>) attributes {finalize}
 end subroutine acc_exit_data
diff --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90
index 84eb72825b34c..ac49532c495d5 100644
--- a/flang/test/Semantics/OpenACC/acc-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-data.f90
@@ -86,7 +86,7 @@ program openacc_data_validity
 
   !$acc exit data delete(aa) finalize
 
-  !ERROR: At most one FINALIZE clause can appear on the EXIT DATA directive
+  ! OK
   !$acc exit data delete(aa) finalize finalize
 
   !ERROR: Argument `cc` on the DETACH clause must be a variable or array with the POINTER or ALLOCATABLE attribute
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index 8729d4505205b..cee0d53458a08 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -535,14 +535,10 @@ def ACC_EnterData : Directive<"enter data"> {
 
 // 2.14.7
 def ACC_ExitData : Directive<"exit data"> {
-  let allowedClauses = [
-    VersionedClause<ACCC_Wait>
-  ];
-  let allowedOnceClauses = [
-    VersionedClause<ACCC_Async>,
-    VersionedClause<ACCC_If>,
-    VersionedClause<ACCC_Finalize>
-  ];
+  let allowedClauses = [VersionedClause<ACCC_Finalize>,
+                        VersionedClause<ACCC_Wait>];
+  let allowedOnceClauses = [VersionedClause<ACCC_Async>,
+                            VersionedClause<ACCC_If>];
   let requiredClauses = [
     VersionedClause<ACCC_Copyout>,
     VersionedClause<ACCC_Delete>,

>From 2837fd7e5ad521d977fbca85a639ce7afbacdc56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valentin=20Clement=20=28=E3=83=90=E3=83=AC=E3=83=B3?=
 =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=B3=20=E3=82=AF=E3=83=AC=E3=83=A1?=
 =?UTF-8?q?=E3=83=B3=29?= <clementval at gmail.com>
Date: Fri, 11 Apr 2025 14:01:03 -0700
Subject: [PATCH 44/76] [flang][openacc] Allow if_present multiple times on
 host_data and update (#135422)

Similar to #135415.

The spec has not strict restriction to allow a single `if_present`
clause on the host_data and update directives. Allowing this clause
multiple times does not change the semantic of it. This patch relax the
rules in ACC.td since there is no restriction in the standard.

The OpenACC dialect represents the `if_present` clause with a `UnitAttr`
so the attribute will be set if the is one or more `if_present` clause.
---
 flang/test/Lower/OpenACC/acc-host-data.f90    |  5 +++++
 flang/test/Lower/OpenACC/acc-update.f90       |  3 +++
 .../test/Semantics/OpenACC/acc-host-data.f90  |  2 +-
 .../Semantics/OpenACC/acc-update-validity.f90 |  2 +-
 llvm/include/llvm/Frontend/OpenACC/ACC.td     | 20 +++++++------------
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/flang/test/Lower/OpenACC/acc-host-data.f90 b/flang/test/Lower/OpenACC/acc-host-data.f90
index 7e06ebbc0ea04..871eabd256ca6 100644
--- a/flang/test/Lower/OpenACC/acc-host-data.f90
+++ b/flang/test/Lower/OpenACC/acc-host-data.f90
@@ -22,6 +22,11 @@ subroutine acc_host_data()
 
 ! CHECK: %[[DA:.*]] = acc.use_device varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
 ! CHECK: acc.host_data dataOperands(%[[DA]] : !fir.ref<!fir.array<10xf32>>) {
+! CHECK: } attributes {ifPresent}
+
+  !$acc host_data use_device(a) if_present if_present
+  !$acc end host_data
+! CHECK: acc.host_data dataOperands(%{{.*}} : !fir.ref<!fir.array<10xf32>>) {
 ! CHECK: } attributes {ifPresent}
 
   !$acc host_data use_device(a) if(ifCondition)
diff --git a/flang/test/Lower/OpenACC/acc-update.f90 b/flang/test/Lower/OpenACC/acc-update.f90
index 1ae06a8c1d0e8..f96b105ed93bd 100644
--- a/flang/test/Lower/OpenACC/acc-update.f90
+++ b/flang/test/Lower/OpenACC/acc-update.f90
@@ -24,6 +24,9 @@ subroutine acc_update
 ! CHECK: acc.update dataOperands(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) attributes {ifPresent}{{$}}
 ! CHECK: acc.update_host accPtr(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) {name = "a", structured = false}
 
+  !$acc update host(a) if_present if_present
+! CHECK: acc.update dataOperands(%{{.*}} : !fir.ref<!fir.array<10x10xf32>>) attributes {ifPresent}{{$}}
+
   !$acc update self(a)
 ! CHECK: %[[DEVPTR_A:.*]] = acc.getdeviceptr varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_update_self>, name = "a", structured = false}
 ! CHECK: acc.update dataOperands(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>){{$}}
diff --git a/flang/test/Semantics/OpenACC/acc-host-data.f90 b/flang/test/Semantics/OpenACC/acc-host-data.f90
index 4e9167722a228..f5aa4d7f320ff 100644
--- a/flang/test/Semantics/OpenACC/acc-host-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-host-data.f90
@@ -27,7 +27,7 @@ program openacc_host_data_validity
   !$acc host_data use_device(aa, bb) if_present
   !$acc end host_data
 
-  !ERROR: At most one IF_PRESENT clause can appear on the HOST_DATA directive
+  ! OK
   !$acc host_data use_device(aa, bb) if_present if_present
   !$acc end host_data
 
diff --git a/flang/test/Semantics/OpenACC/acc-update-validity.f90 b/flang/test/Semantics/OpenACC/acc-update-validity.f90
index 1e75742e63e97..8add56e81cf9e 100644
--- a/flang/test/Semantics/OpenACC/acc-update-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-update-validity.f90
@@ -58,7 +58,7 @@ program openacc_update_validity
   !ERROR: At most one IF clause can appear on the UPDATE directive
   !$acc update device(aa) if(.true.) if(ifCondition)
 
-  !ERROR: At most one IF_PRESENT clause can appear on the UPDATE directive
+  ! OK
   !$acc update device(bb) if_present if_present
 
   !ERROR: Clause IF is not allowed after clause DEVICE_TYPE on the UPDATE directive
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index cee0d53458a08..2acee9bcc7195 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -487,15 +487,11 @@ def ACC_Shutdown : Directive<"shutdown"> {
 
 // 2.14.4
 def ACC_Update : Directive<"update"> {
-  let allowedClauses = [
-    VersionedClause<ACCC_DeviceType>,
-    VersionedClause<ACCC_Wait>
-  ];
-  let allowedOnceClauses = [
-    VersionedClause<ACCC_Async>,
-    VersionedClause<ACCC_If>,
-    VersionedClause<ACCC_IfPresent>
-  ];
+  let allowedClauses = [VersionedClause<ACCC_DeviceType>,
+                        VersionedClause<ACCC_IfPresent>,
+                        VersionedClause<ACCC_Wait>];
+  let allowedOnceClauses = [VersionedClause<ACCC_Async>,
+                            VersionedClause<ACCC_If>];
   let requiredClauses = [
     VersionedClause<ACCC_Device>,
     VersionedClause<ACCC_Host>,
@@ -550,10 +546,8 @@ def ACC_ExitData : Directive<"exit data"> {
 
 // 2.8
 def ACC_HostData : Directive<"host_data"> {
-  let allowedOnceClauses = [
-    VersionedClause<ACCC_If>,
-    VersionedClause<ACCC_IfPresent>
-  ];
+  let allowedClauses = [VersionedClause<ACCC_IfPresent>];
+  let allowedOnceClauses = [VersionedClause<ACCC_If>];
   let requiredClauses = [
     VersionedClause<ACCC_UseDevice>
   ];

>From 4530922cfdacc5be25dbe499fc106cc3b009bf79 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Fri, 11 Apr 2025 18:04:18 -0300
Subject: [PATCH 45/76] [clang] fix serialization for
 SubstNonTypeTemplateParmPackExpr (#135428)

This fixes a PCM non-determinism regression reported here:
https://github.com/llvm/llvm-project/pull/134560#issuecomment-2797744370

There was a bit in `SubstNonTypeTemplateParmPackExpr` which we missed to
serialize, and that bit eventually propagates to
`SubstNonTypeTemplateParmExpr`.

As a drive by, improve serialization for PackIndex on
SubstNonTypeTemplateParmExpr by using the newly introduced
UnsignedOrNone helpers.

There are no release notes since this regression was never released.
---
 clang/lib/Serialization/ASTReaderStmt.cpp | 6 ++----
 clang/lib/Serialization/ASTWriterStmt.cpp | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 715aaf6452264..f41cfcc53a35d 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -2226,10 +2226,7 @@ void ASTStmtReader::VisitSubstNonTypeTemplateParmExpr(
   E->AssociatedDeclAndRef.setPointer(readDeclAs<Decl>());
   E->AssociatedDeclAndRef.setInt(CurrentUnpackingBits->getNextBit());
   E->Index = CurrentUnpackingBits->getNextBits(/*Width=*/12);
-  if (CurrentUnpackingBits->getNextBit())
-    E->PackIndex = Record.readInt();
-  else
-    E->PackIndex = 0;
+  E->PackIndex = Record.readUnsignedOrNone().toInternalRepresentation();
   E->Final = CurrentUnpackingBits->getNextBit();
   E->SubstNonTypeTemplateParmExprBits.NameLoc = readSourceLocation();
   E->Replacement = Record.readSubExpr();
@@ -2239,6 +2236,7 @@ void ASTStmtReader::VisitSubstNonTypeTemplateParmPackExpr(
                                           SubstNonTypeTemplateParmPackExpr *E) {
   VisitExpr(E);
   E->AssociatedDecl = readDeclAs<Decl>();
+  E->Final = CurrentUnpackingBits->getNextBit();
   E->Index = Record.readInt();
   TemplateArgument ArgPack = Record.readTemplateArgument();
   if (ArgPack.getKind() != TemplateArgument::Pack)
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index 939b37c547349..b9eabd5ddb64c 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -2228,9 +2228,7 @@ void ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr(
   Record.AddDeclRef(E->getAssociatedDecl());
   CurrentPackingBits.addBit(E->isReferenceParameter());
   CurrentPackingBits.addBits(E->getIndex(), /*Width=*/12);
-  CurrentPackingBits.addBit((bool)E->getPackIndex());
-  if (auto PackIndex = E->getPackIndex())
-    Record.push_back(*PackIndex + 1);
+  Record.writeUnsignedOrNone(E->getPackIndex());
   CurrentPackingBits.addBit(E->getFinal());
 
   Record.AddSourceLocation(E->getNameLoc());
@@ -2242,6 +2240,7 @@ void ASTStmtWriter::VisitSubstNonTypeTemplateParmPackExpr(
                                           SubstNonTypeTemplateParmPackExpr *E) {
   VisitExpr(E);
   Record.AddDeclRef(E->getAssociatedDecl());
+  CurrentPackingBits.addBit(E->getFinal());
   Record.push_back(E->getIndex());
   Record.AddTemplateArgument(E->getArgumentPack());
   Record.AddSourceLocation(E->getParameterPackLocation());

>From de67293c093efddb9f9444b3a614695ad243355d Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Fri, 11 Apr 2025 17:10:09 -0400
Subject: [PATCH 46/76] [mlir][SMT] upstream `SMT` dialect (#131480)

This PR upstreams the `SMT` dialect from the CIRCT project. Here we only
check in the dialect/op/types/attributes and lit tests. Follow up PRs
will add conversions in and out and etc.

Co-authored-by: Bea Healy <beahealy22 at gmail.com>
Co-authored-by: Martin Erhart <maerhart at outlook.com>
Co-authored-by: Mike Urbach <mikeurbach at gmail.com>
Co-authored-by: Will Dietz <will.dietz at sifive.com>
Co-authored-by: fzi-hielscher <hielscher at fzi.de>
Co-authored-by: Fehr Mathieu <mathieu.fehr at gmail.com>
---
 mlir/include/mlir/Dialect/CMakeLists.txt      |   1 +
 mlir/include/mlir/Dialect/SMT/CMakeLists.txt  |   1 +
 .../mlir/Dialect/SMT/IR/CMakeLists.txt        |  15 +
 mlir/include/mlir/Dialect/SMT/IR/SMT.td       |  22 +
 .../mlir/Dialect/SMT/IR/SMTArrayOps.td        |  99 ++++
 .../mlir/Dialect/SMT/IR/SMTAttributes.h       |  29 +
 .../mlir/Dialect/SMT/IR/SMTAttributes.td      |  74 +++
 .../mlir/Dialect/SMT/IR/SMTBitVectorOps.td    | 255 +++++++++
 mlir/include/mlir/Dialect/SMT/IR/SMTDialect.h |  20 +
 .../include/mlir/Dialect/SMT/IR/SMTDialect.td |  30 ++
 mlir/include/mlir/Dialect/SMT/IR/SMTIntOps.td | 137 +++++
 mlir/include/mlir/Dialect/SMT/IR/SMTOps.h     |  25 +
 mlir/include/mlir/Dialect/SMT/IR/SMTOps.td    | 475 +++++++++++++++++
 mlir/include/mlir/Dialect/SMT/IR/SMTTypes.h   |  30 ++
 mlir/include/mlir/Dialect/SMT/IR/SMTTypes.td  | 145 +++++
 .../include/mlir/Dialect/SMT/IR/SMTVisitors.h | 201 +++++++
 mlir/include/mlir/InitAllDialects.h           |   2 +
 mlir/lib/Dialect/CMakeLists.txt               |   1 +
 mlir/lib/Dialect/SMT/CMakeLists.txt           |   1 +
 mlir/lib/Dialect/SMT/IR/CMakeLists.txt        |  27 +
 mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp     | 201 +++++++
 mlir/lib/Dialect/SMT/IR/SMTDialect.cpp        |  47 ++
 mlir/lib/Dialect/SMT/IR/SMTOps.cpp            | 472 +++++++++++++++++
 mlir/lib/Dialect/SMT/IR/SMTTypes.cpp          |  92 ++++
 mlir/test/Dialect/SMT/array-errors.mlir       |  13 +
 mlir/test/Dialect/SMT/array.mlir              |  14 +
 mlir/test/Dialect/SMT/basic.mlir              | 200 +++++++
 mlir/test/Dialect/SMT/bitvector-errors.mlir   | 112 ++++
 mlir/test/Dialect/SMT/bitvectors.mlir         |  81 +++
 mlir/test/Dialect/SMT/core-errors.mlir        | 497 ++++++++++++++++++
 mlir/test/Dialect/SMT/cse-test.mlir           |  12 +
 mlir/test/Dialect/SMT/integers.mlir           |  36 ++
 mlir/unittests/Dialect/CMakeLists.txt         |   1 +
 mlir/unittests/Dialect/SMT/AttributeTest.cpp  | 118 +++++
 mlir/unittests/Dialect/SMT/CMakeLists.txt     |  10 +
 mlir/unittests/Dialect/SMT/QuantifierTest.cpp | 187 +++++++
 mlir/unittests/Dialect/SMT/TypeTest.cpp       |  31 ++
 37 files changed, 3714 insertions(+)
 create mode 100644 mlir/include/mlir/Dialect/SMT/CMakeLists.txt
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/CMakeLists.txt
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMT.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTArrayOps.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.h
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTBitVectorOps.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTDialect.h
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTDialect.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTIntOps.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTOps.h
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTTypes.h
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTTypes.td
 create mode 100644 mlir/include/mlir/Dialect/SMT/IR/SMTVisitors.h
 create mode 100644 mlir/lib/Dialect/SMT/CMakeLists.txt
 create mode 100644 mlir/lib/Dialect/SMT/IR/CMakeLists.txt
 create mode 100644 mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp
 create mode 100644 mlir/lib/Dialect/SMT/IR/SMTDialect.cpp
 create mode 100644 mlir/lib/Dialect/SMT/IR/SMTOps.cpp
 create mode 100644 mlir/lib/Dialect/SMT/IR/SMTTypes.cpp
 create mode 100644 mlir/test/Dialect/SMT/array-errors.mlir
 create mode 100644 mlir/test/Dialect/SMT/array.mlir
 create mode 100644 mlir/test/Dialect/SMT/basic.mlir
 create mode 100644 mlir/test/Dialect/SMT/bitvector-errors.mlir
 create mode 100644 mlir/test/Dialect/SMT/bitvectors.mlir
 create mode 100644 mlir/test/Dialect/SMT/core-errors.mlir
 create mode 100644 mlir/test/Dialect/SMT/cse-test.mlir
 create mode 100644 mlir/test/Dialect/SMT/integers.mlir
 create mode 100644 mlir/unittests/Dialect/SMT/AttributeTest.cpp
 create mode 100644 mlir/unittests/Dialect/SMT/CMakeLists.txt
 create mode 100644 mlir/unittests/Dialect/SMT/QuantifierTest.cpp
 create mode 100644 mlir/unittests/Dialect/SMT/TypeTest.cpp

diff --git a/mlir/include/mlir/Dialect/CMakeLists.txt b/mlir/include/mlir/Dialect/CMakeLists.txt
index f710235197334..9d1a840d6644b 100644
--- a/mlir/include/mlir/Dialect/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/CMakeLists.txt
@@ -33,6 +33,7 @@ add_subdirectory(Ptr)
 add_subdirectory(Quant)
 add_subdirectory(SCF)
 add_subdirectory(Shape)
+add_subdirectory(SMT)
 add_subdirectory(SparseTensor)
 add_subdirectory(SPIRV)
 add_subdirectory(Tensor)
diff --git a/mlir/include/mlir/Dialect/SMT/CMakeLists.txt b/mlir/include/mlir/Dialect/SMT/CMakeLists.txt
new file mode 100644
index 0000000000000..f33061b2d87cf
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(IR)
diff --git a/mlir/include/mlir/Dialect/SMT/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/SMT/IR/CMakeLists.txt
new file mode 100644
index 0000000000000..1455551f93fb2
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/CMakeLists.txt
@@ -0,0 +1,15 @@
+add_mlir_dialect(SMT smt)
+
+set(LLVM_TARGET_DEFINITIONS SMT.td)
+
+mlir_tablegen(SMTAttributes.h.inc -gen-attrdef-decls)
+mlir_tablegen(SMTAttributes.cpp.inc -gen-attrdef-defs)
+add_public_tablegen_target(MLIRSMTAttrIncGen)
+add_dependencies(mlir-headers MLIRSMTAttrIncGen)
+
+mlir_tablegen(SMTEnums.h.inc -gen-enum-decls)
+mlir_tablegen(SMTEnums.cpp.inc -gen-enum-defs)
+add_public_tablegen_target(MLIRSMTEnumsIncGen)
+add_dependencies(mlir-headers MLIRSMTEnumsIncGen)
+
+add_mlir_doc(SMT SMT Dialects/ -gen-dialect-doc)
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMT.td b/mlir/include/mlir/Dialect/SMT/IR/SMT.td
new file mode 100644
index 0000000000000..6d0e0532ebe24
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMT.td
@@ -0,0 +1,22 @@
+//===- SMT.td - SMT dialect definition ---------------------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMT_TD
+#define MLIR_DIALECT_SMT_IR_SMT_TD
+
+include "mlir/IR/OpBase.td"
+
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/Dialect/SMT/IR/SMTOps.td"
+include "mlir/Dialect/SMT/IR/SMTArrayOps.td"
+include "mlir/Dialect/SMT/IR/SMTBitVectorOps.td"
+include "mlir/Dialect/SMT/IR/SMTIntOps.td"
+
+#endif // MLIR_DIALECT_SMT_IR_SMT_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTArrayOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTArrayOps.td
new file mode 100644
index 0000000000000..1869f4ae81595
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTArrayOps.td
@@ -0,0 +1,99 @@
+//===- SMTArrayOps.td - SMT array operations ---------------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTARRAYOPS_TD
+#define MLIR_DIALECT_SMT_IR_SMTARRAYOPS_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+
+class SMTArrayOp<string mnemonic, list<Trait> traits = []> :
+  SMTOp<"array." # mnemonic, traits>;
+
+def ArrayStoreOp : SMTArrayOp<"store", [
+  Pure,
+  TypesMatchWith<"summary", "array", "index", 
+                 "cast<ArrayType>($_self).getDomainType()">,
+  TypesMatchWith<"summary", "array", "value",
+                 "cast<ArrayType>($_self).getRangeType()">,
+  AllTypesMatch<["array", "result"]>,
+]> {
+  let summary = "stores a value at a given index and returns the new array";
+  let description = [{
+    This operation returns a new array which is the same as the 'array' operand
+    except that the value at the given 'index' is changed to the given 'value'.
+    The semantics are equivalent to the 'store' operator described in the
+    [SMT ArrayEx theory](https://smtlib.cs.uiowa.edu/Theories/ArraysEx.smt2) of
+    the SMT-LIB standard 2.7.
+  }];
+
+  let arguments = (ins ArrayType:$array, AnySMTType:$index, AnySMTType:$value);
+  let results = (outs ArrayType:$result);
+
+  let assemblyFormat = [{
+    $array `[` $index `]` `,` $value attr-dict `:` qualified(type($array))
+  }];
+}
+
+def ArraySelectOp : SMTArrayOp<"select", [
+  Pure,
+  TypesMatchWith<"summary", "array", "index",
+                 "cast<ArrayType>($_self).getDomainType()">,
+  TypesMatchWith<"summary", "array", "result",
+                 "cast<ArrayType>($_self).getRangeType()">,
+]> {
+  let summary = "get the value stored in the array at the given index";
+  let description = [{
+    This operation is retuns the value stored in the given array at the given
+    index. The semantics are equivalent to the `select` operator defined in the
+    [SMT ArrayEx theory](https://smtlib.cs.uiowa.edu/Theories/ArraysEx.smt2) of
+    the SMT-LIB standard 2.7.
+  }];
+
+  let arguments = (ins ArrayType:$array, AnySMTType:$index);
+  let results = (outs AnySMTType:$result);
+
+  let assemblyFormat = [{
+    $array `[` $index `]` attr-dict `:` qualified(type($array))
+  }];
+}
+
+def ArrayBroadcastOp : SMTArrayOp<"broadcast", [
+  Pure,
+  TypesMatchWith<"summary", "result", "value",
+                 "cast<ArrayType>($_self).getRangeType()">,
+]> {
+  let summary = "construct an array with the given value stored at every index";
+  let description = [{
+    This operation represents a broadcast of the 'value' operand to all indices
+    of the array. It is equivalent to
+    ```
+    %0 = smt.declare "array" : !smt.array<[!smt.int -> !smt.bool]>
+    %1 = smt.forall ["idx"] {
+    ^bb0(%idx: !smt.int):
+      %2 = smt.array.select %0[%idx] : !smt.array<[!smt.int -> !smt.bool]>
+      %3 = smt.eq %value, %2 : !smt.bool
+      smt.yield %3 : !smt.bool
+    }
+    smt.assert %1
+    // return %0
+    ```
+
+    In SMT-LIB, this is frequently written as
+    `((as const (Array Int Bool)) value)`.
+  }];
+
+  let arguments = (ins AnySMTType:$value);
+  let results = (outs ArrayType:$result);
+
+  let assemblyFormat = "$value attr-dict `:` qualified(type($result))";
+}
+
+#endif // MLIR_DIALECT_SMT_IR_SMTARRAYOPS_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.h b/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.h
new file mode 100644
index 0000000000000..8db8a1f198cf9
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.h
@@ -0,0 +1,29 @@
+//===- SMTAttributes.h - Declare SMT dialect attributes ----------*- C++-*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_H
+#define MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_H
+
+#include "mlir/IR/Attributes.h"
+#include "mlir/IR/BuiltinAttributeInterfaces.h"
+#include "mlir/IR/BuiltinAttributes.h"
+
+namespace mlir {
+namespace smt {
+namespace detail {
+
+struct BitVectorAttrStorage;
+
+} // namespace detail
+} // namespace smt
+} // namespace mlir
+
+#define GET_ATTRDEF_CLASSES
+#include "mlir/Dialect/SMT/IR/SMTAttributes.h.inc"
+
+#endif // MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_H
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.td b/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.td
new file mode 100644
index 0000000000000..0909c9abad951
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.td
@@ -0,0 +1,74 @@
+//===- SMTAttributes.td - Attributes for SMT dialect -------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines SMT dialect specific attributes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_TD
+#define MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/BuiltinAttributeInterfaces.td"
+
+def BitVectorAttr : AttrDef<SMTDialect, "BitVector", [
+  DeclareAttrInterfaceMethods<TypedAttrInterface>
+]> {
+  let mnemonic = "bv";
+  let description = [{
+    This attribute represents a constant value of the `(_ BitVec width)` sort as
+    described in the [SMT bit-vector
+    theory](https://smtlib.cs.uiowa.edu/theories-FixedSizeBitVectors.shtml).
+
+    The constant is as #bX (binary) or #xX (hexadecimal) in SMT-LIB
+    where X is the value in the corresponding format without any further
+    prefixing. Here, the bit-vector constant is given as a regular non-negative
+    integer literal and the associated bit-vector type indicating the bit-width.
+
+    Examples:
+    ```mlir
+    #smt.bv<5> : !smt.bv<4>
+    #smt.bv<92> : !smt.bv<8>
+    ```
+
+    The explicit type-suffix is mandatory to uniquely represent the attribute,
+    i.e., this attribute should always be used in the extended form (using the
+    `quantified` keyword in the operation assembly format string).
+
+    The bit-width must be greater than zero (i.e., at least one digit has to be
+    present).
+  }];
+
+  let parameters = (ins "llvm::APInt":$value);
+
+  let hasCustomAssemblyFormat = true;
+  let genVerifyDecl = true;
+
+  // We need to manually define the storage class because the generated one is
+  // buggy (because the APInt asserts matching bitwidth in the `==` operator and
+  // the generated storage uses that directly.
+  // Alternatively: add a type parameter to redundantly store the bitwidth of
+  // of the attribute type, it it's in the order before the 'value' it will be
+  // checked before the APInt equality (this is the reason it works for the
+  // builtin integer attribute), but would be more fragile (and we'd store
+  // duplicate data).
+  let genStorageClass = false;
+
+  let builders = [
+    AttrBuilder<(ins "llvm::StringRef":$value)>,
+    AttrBuilder<(ins "uint64_t":$value, "unsigned":$width)>,
+  ];
+
+  let extraClassDeclaration = [{
+    /// Return the bit-vector constant as a SMT-LIB formatted string.
+    std::string getValueAsString(bool prefix = true) const;
+  }];
+}
+
+#endif // MLIR_DIALECT_SMT_IR_SMTATTRIBUTES_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTBitVectorOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTBitVectorOps.td
new file mode 100644
index 0000000000000..c7422dd11f634
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTBitVectorOps.td
@@ -0,0 +1,255 @@
+//===- SMTBitVectorOps.td - SMT bit-vector dialect ops -----*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTBITVECTOROPS_TD
+#define MLIR_DIALECT_SMT_IR_SMTBITVECTOROPS_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/OpAsmInterface.td"
+include "mlir/Interfaces/InferTypeOpInterface.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+
+class SMTBVOp<string mnemonic, list<Trait> traits = []> :
+  Op<SMTDialect, "bv." # mnemonic, traits>;
+
+def BVConstantOp : SMTBVOp<"constant", [
+  Pure,
+  ConstantLike,
+  FirstAttrDerivedResultType,
+  DeclareOpInterfaceMethods<InferTypeOpInterface, ["inferReturnTypes"]>,
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+]> {
+  let summary = "produce a constant bit-vector";
+  let description = [{
+    This operation produces an SSA value equal to the bit-vector constant
+    specified by the 'value' attribute.
+    Refer to the `BitVectorAttr` documentation for more information about
+    the semantics of bit-vector constants, their format, and associated sort.
+    The result type always matches the attribute's type.
+
+    Examples:
+    ```mlir
+    %c92_bv8 = smt.bv.constant #smt.bv<92> : !smt.bv<8>
+    %c5_bv4 = smt.bv.constant #smt.bv<5> : !smt.bv<4>
+    ```
+  }];
+
+  let arguments = (ins BitVectorAttr:$value);
+  let results = (outs BitVectorType:$result);
+
+  let assemblyFormat = "qualified($value) attr-dict";
+
+  let builders = [
+    OpBuilder<(ins "const llvm::APInt &":$value), [{
+      build($_builder, $_state,
+            BitVectorAttr::get($_builder.getContext(), value));
+    }]>,
+    OpBuilder<(ins "uint64_t":$value, "unsigned":$width), [{
+      build($_builder, $_state,
+            BitVectorAttr::get($_builder.getContext(), value, width));
+    }]>,
+  ];
+
+  let hasFolder = true;
+}
+
+class BVArithmeticOrBitwiseOp<string mnemonic, string desc> :
+    SMTBVOp<mnemonic, [Pure, SameOperandsAndResultType]> {
+  let summary = "equivalent to bv" # mnemonic # " in SMT-LIB";
+  let description = "This operation performs " # desc # [{. The semantics are
+    equivalent to the `bv}] # mnemonic # [{` operator defined in the SMT-LIB 2.7
+    standard. More precisely in the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)
+    and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)
+    describing closed quantifier-free formulas over the theory of fixed-size
+    bit-vectors.
+  }];
+
+  let results = (outs BitVectorType:$result);
+}
+
+class BinaryBVOp<string mnemonic, string desc> :
+     BVArithmeticOrBitwiseOp<mnemonic, desc> {
+  let arguments = (ins BitVectorType:$lhs, BitVectorType:$rhs);
+  let assemblyFormat = "$lhs `,` $rhs attr-dict `:` qualified(type($result))";
+}
+
+class UnaryBVOp<string mnemonic, string desc> :
+    BVArithmeticOrBitwiseOp<mnemonic, desc> {
+  let arguments = (ins BitVectorType:$input);
+  let assemblyFormat = "$input attr-dict `:` qualified(type($result))";
+}
+
+def BVNotOp  : UnaryBVOp<"not", "bitwise negation">;
+def BVNegOp  : UnaryBVOp<"neg", "two's complement unary minus">;
+
+def BVAndOp  : BinaryBVOp<"and", "bitwise AND">;
+def BVOrOp   : BinaryBVOp<"or", "bitwise OR">;
+def BVXOrOp  : BinaryBVOp<"xor", "bitwise exclusive OR">;
+
+def BVAddOp  : BinaryBVOp<"add", "addition">;
+def BVMulOp  : BinaryBVOp<"mul", "multiplication">;
+def BVUDivOp : BinaryBVOp<"udiv", "unsigned division (rounded towards zero)">;
+def BVSDivOp : BinaryBVOp<"sdiv", "two's complement signed division">;
+def BVURemOp : BinaryBVOp<"urem", "unsigned remainder">;
+def BVSRemOp : BinaryBVOp<"srem",
+  "two's complement signed remainder (sign follows dividend)">;
+def BVSModOp : BinaryBVOp<"smod",
+  "two's complement signed remainder (sign follows divisor)">;
+def BVShlOp  : BinaryBVOp<"shl", "shift left">;
+def BVLShrOp : BinaryBVOp<"lshr", "logical shift right">;
+def BVAShrOp : BinaryBVOp<"ashr", "arithmetic shift right">;
+
+def PredicateSLT : I64EnumAttrCase<"slt", 0>;
+def PredicateSLE : I64EnumAttrCase<"sle", 1>;
+def PredicateSGT : I64EnumAttrCase<"sgt", 2>;
+def PredicateSGE : I64EnumAttrCase<"sge", 3>;
+def PredicateULT : I64EnumAttrCase<"ult", 4>;
+def PredicateULE : I64EnumAttrCase<"ule", 5>;
+def PredicateUGT : I64EnumAttrCase<"ugt", 6>;
+def PredicateUGE : I64EnumAttrCase<"uge", 7>;
+let cppNamespace = "mlir::smt" in
+def BVCmpPredicate : I64EnumAttr<
+    "BVCmpPredicate",
+    "smt bit-vector comparison predicate",
+    [PredicateSLT, PredicateSLE, PredicateSGT, PredicateSGE,
+     PredicateULT, PredicateULE, PredicateUGT, PredicateUGE]>;
+
+def BVCmpOp : SMTBVOp<"cmp", [Pure, SameTypeOperands]> {
+  let summary = "compare bit-vectors interpreted as signed or unsigned";
+  let description = [{
+    This operation compares bit-vector values, interpreting them as signed or
+    unsigned values depending on the predicate. The semantics are equivalent to
+    the `bvslt`, `bvsle`, `bvsgt`, `bvsge`, `bvult`, `bvule`, `bvugt`, or
+    `bvuge` operator defined in the SMT-LIB 2.7 standard depending on the
+    specified predicate. More precisely in the
+    [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)
+    and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)
+    describing closed quantifier-free formulas over the theory of fixed-size
+    bit-vectors.
+  }];
+
+  let arguments = (ins BVCmpPredicate:$pred,
+                       BitVectorType:$lhs,
+                       BitVectorType:$rhs);
+  let results = (outs BoolType:$result);
+
+  let assemblyFormat = [{
+    $pred $lhs `,` $rhs attr-dict `:` qualified(type($lhs))
+  }];
+}
+
+def ConcatOp : SMTBVOp<"concat", [
+  Pure,
+  DeclareOpInterfaceMethods<InferTypeOpInterface, ["inferReturnTypes"]>
+]> {
+  let summary = "bit-vector concatenation";
+  let description = [{
+    This operation concatenates bit-vector values with semantics equivalent to
+    the `concat` operator defined in the SMT-LIB 2.7 standard. More precisely in
+    the [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)
+    and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)
+    describing closed quantifier-free formulas over the theory of fixed-size
+    bit-vectors.
+
+    Note that the following equivalences hold:
+    * `smt.bv.concat %a, %b : !smt.bv<4>, !smt.bv<4>` is equivalent to
+      `(concat a b)` in SMT-LIB
+    * `(= (concat #xf #x0) #xf0)`
+  }];
+
+  let arguments = (ins BitVectorType:$lhs, BitVectorType:$rhs);
+  let results = (outs BitVectorType:$result);
+
+  let assemblyFormat = "$lhs `,` $rhs attr-dict `:` qualified(type(operands))";
+}
+
+def ExtractOp : SMTBVOp<"extract", [Pure]> {
+  let summary = "bit-vector extraction";
+  let description = [{
+    This operation extracts the range of bits starting at the 'lowBit' index
+    (inclusive) up to the 'lowBit' + result-width index (exclusive). The
+    semantics are equivalent to the `extract` operator defined in the SMT-LIB
+    2.7 standard. More precisely in the
+    [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)
+    and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)
+    describing closed quantifier-free formulas over the theory of fixed-size
+    bit-vectors.
+
+    Note that `smt.bv.extract %bv from 2 : (!smt.bv<32>) -> !smt.bv<16>` is
+    equivalent to `((_ extract 17 2) bv)`, i.e., the SMT-LIB operator takes the
+    low and high indices where both are inclusive. The following equivalence
+    holds: `(= ((_ extract 3 0) #x0f) #xf)`
+  }];
+
+  let arguments = (ins I32Attr:$lowBit, BitVectorType:$input);
+  let results = (outs BitVectorType:$result);
+
+  let assemblyFormat = [{
+    $input `from` $lowBit attr-dict `:` functional-type($input, $result)
+  }];
+
+  let hasVerifier = true;
+}
+
+def RepeatOp : SMTBVOp<"repeat", [Pure]> {
+  let summary = "repeated bit-vector concatenation of one value";
+  let description = [{
+    This operation is a shorthand for repeated concatenation of the same
+    bit-vector value, i.e.,
+    ```mlir
+    smt.bv.repeat 5 times %a : !smt.bv<4>
+    // is the same as
+    %0 = smt.bv.repeat 4 times %a : !smt.bv<4>
+    smt.bv.concat %a, %0 : !smt.bv<4>, !smt.bv<16>
+    // or also 
+    %0 = smt.bv.repeat 4 times %a : !smt.bv<4>
+    smt.bv.concat %0, %a : !smt.bv<16>, !smt.bv<4>
+    ```
+    
+    The semantics are equivalent to the `repeat` operator defined in the SMT-LIB
+    2.7 standard. More precisely in the
+    [theory of FixedSizeBitVectors](https://smtlib.cs.uiowa.edu/Theories/FixedSizeBitVectors.smt2)
+    and the [QF_BV logic](https://smtlib.cs.uiowa.edu/Logics/QF_BV.smt2)
+    describing closed quantifier-free formulas over the theory of fixed-size
+    bit-vectors.
+  }];
+
+  let arguments = (ins BitVectorType:$input);
+  let results = (outs BitVectorType:$result);
+
+  let hasCustomAssemblyFormat = true;
+  let hasVerifier = true;
+
+  let builders = [
+    OpBuilder<(ins "unsigned":$count, "mlir::Value":$input)>,
+  ];
+
+  let extraClassDeclaration = [{
+    /// Get the number of times the input operand is repeated.
+    unsigned getCount();
+  }];
+}
+
+def BV2IntOp : SMTOp<"bv2int", [Pure]> {
+  let summary = "Convert an SMT bit-vector to an SMT integer.";
+  let description = [{
+    Create an integer from the bit-vector argument `input`. If `is_signed` is
+    present, the bit-vector is treated as two's complement signed.  Otherwise,
+    it is treated as an unsigned integer in the range [0..2^N-1], where N is
+    the number of bits in `input`.
+  }];
+  let arguments = (ins BitVectorType:$input, UnitAttr:$is_signed);
+  let results = (outs IntType:$result);
+  let assemblyFormat = [{$input (`signed` $is_signed^)? attr-dict `:`
+    qualified(type($input))}];
+}
+
+#endif // MLIR_DIALECT_SMT_IR_SMTBITVECTOROPS_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.h b/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.h
new file mode 100644
index 0000000000000..2c44ca802a2d5
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.h
@@ -0,0 +1,20 @@
+//===- SMTDialect.h - SMT dialect definition --------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTDIALECT_H
+#define MLIR_DIALECT_SMT_IR_SMTDIALECT_H
+
+#include "mlir/IR/BuiltinOps.h"
+#include "mlir/IR/Dialect.h"
+#include "mlir/Support/LLVM.h"
+
+// Pull in the dialect definition.
+#include "mlir/Dialect/SMT/IR/SMTDialect.h.inc"
+#include "mlir/Dialect/SMT/IR/SMTEnums.h.inc"
+
+#endif // MLIR_DIALECT_SMT_IR_SMTDIALECT_H
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.td b/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.td
new file mode 100644
index 0000000000000..00f170659946e
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTDialect.td
@@ -0,0 +1,30 @@
+//===- SMTDialect.td - SMT dialect definition --------------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTDIALECT_TD
+#define MLIR_DIALECT_SMT_IR_SMTDIALECT_TD
+
+include "mlir/IR/DialectBase.td"
+
+def SMTDialect : Dialect {
+  let name = "smt";
+  let summary = "a dialect that models satisfiability modulo theories";
+  let cppNamespace = "mlir::smt";
+
+  let useDefaultAttributePrinterParser = 1;
+  let useDefaultTypePrinterParser = 1;
+
+  let hasConstantMaterializer = 1;
+
+  let extraClassDeclaration = [{
+    void registerAttributes();
+    void registerTypes();
+  }];
+}
+
+#endif // MLIR_DIALECT_SMT_IR_SMTDIALECT_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTIntOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTIntOps.td
new file mode 100644
index 0000000000000..ea94dfd8fbd2a
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTIntOps.td
@@ -0,0 +1,137 @@
+//===- SMTIntOps.td - SMT dialect int theory operations ----*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTINTOPS_TD
+#define MLIR_DIALECT_SMT_IR_SMTINTOPS_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/OpAsmInterface.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+
+class SMTIntOp<string mnemonic, list<Trait> traits = []> :
+  SMTOp<"int." # mnemonic, traits>;
+
+def IntConstantOp : SMTIntOp<"constant", [
+  Pure,
+  ConstantLike,
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
+]> {
+  let summary = "produce a constant (infinite-precision) integer";
+  let description = [{
+    This operation represents (infinite-precision) integer literals of the `Int`
+    sort. The set of values for the sort `Int` consists of all numerals and
+    all terms of the form `-n`where n is a numeral other than 0. For more
+    information refer to the 
+    [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+
+  let arguments = (ins APIntAttr:$value);
+  let results = (outs IntType:$result);
+
+  let hasCustomAssemblyFormat = true;
+  let hasFolder = true;
+}
+
+class VariadicIntOp<string mnemonic> : SMTIntOp<mnemonic, [Pure, Commutative]> {
+  let description = [{
+    This operation represents (infinite-precision) }] # summary # [{.
+    The semantics are equivalent to the corresponding operator described in
+    the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+
+  let arguments = (ins Variadic<IntType>:$inputs);
+  let results = (outs IntType:$result);
+  let assemblyFormat = "$inputs attr-dict";
+
+  let builders = [
+    OpBuilder<(ins "mlir::ValueRange":$inputs), [{
+      build($_builder, $_state, $_builder.getType<smt::IntType>(), inputs);
+    }]>,
+  ];
+}
+
+class BinaryIntOp<string mnemonic> : SMTIntOp<mnemonic, [Pure]> {
+  let description = [{
+    This operation represents (infinite-precision) }] # summary # [{.
+    The semantics are equivalent to the corresponding operator described in
+    the [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+
+  let arguments = (ins IntType:$lhs, IntType:$rhs);
+  let results = (outs IntType:$result);
+  let assemblyFormat = "$lhs `,` $rhs attr-dict";
+}
+
+def IntAbsOp : SMTIntOp<"abs", [Pure]> {
+  let summary = "the absolute value of an Int";
+  let description = [{
+    This operation represents the absolute value function for the `Int` sort.
+    The semantics are equivalent to the `abs` operator as described in the
+    [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+
+  let arguments = (ins IntType:$input);
+  let results = (outs IntType:$result);
+  let assemblyFormat = "$input attr-dict";
+}
+
+def IntAddOp : VariadicIntOp<"add"> { let summary = "integer addition"; }
+def IntMulOp : VariadicIntOp<"mul"> { let summary = "integer multiplication"; }
+def IntSubOp : BinaryIntOp<"sub"> { let summary = "integer subtraction"; }
+def IntDivOp : BinaryIntOp<"div"> { let summary = "integer division"; }
+def IntModOp : BinaryIntOp<"mod"> { let summary = "integer remainder"; }
+
+def IntPredicateLT : I64EnumAttrCase<"lt", 0>;
+def IntPredicateLE : I64EnumAttrCase<"le", 1>;
+def IntPredicateGT : I64EnumAttrCase<"gt", 2>;
+def IntPredicateGE : I64EnumAttrCase<"ge", 3>;
+let cppNamespace = "mlir::smt" in
+def IntPredicate : I64EnumAttr<
+    "IntPredicate",
+    "smt comparison predicate for integers",
+    [IntPredicateLT, IntPredicateLE, IntPredicateGT, IntPredicateGE]>;
+
+def IntCmpOp : SMTIntOp<"cmp", [Pure]> {
+  let summary = "integer comparison";
+  let description = [{
+    This operation represents the comparison of (infinite-precision) integers.
+    The semantics are equivalent to the `<= (le)`, `< (lt)`, `>= (ge)`, or
+    `> (gt)` operator depending on the predicate (indicated in parentheses) as
+    described in the
+    [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+
+  let arguments = (ins IntPredicate:$pred, IntType:$lhs, IntType:$rhs);
+  let results = (outs BoolType:$result);
+  let assemblyFormat = "$pred $lhs `,` $rhs attr-dict";
+}
+
+def Int2BVOp : SMTOp<"int2bv", [Pure]> {
+  let summary = "Convert an integer to an inferred-width bitvector.";
+  let description = [{
+    Designed to lower directly to an operation of the same name in Z3. The Z3
+    C API describes the semantics as follows:
+    Create an n bit bit-vector from the integer argument t1.
+    The resulting bit-vector has n bits, where the i'th bit (counting from 0
+    to n-1) is 1 if (t1 div 2^i) mod 2 is 1.
+    The node t1 must have integer sort.
+  }];
+  let arguments = (ins IntType:$input);
+  let results = (outs BitVectorType:$result);
+  let assemblyFormat = "$input attr-dict `:` qualified(type($result))";
+}
+
+#endif // MLIR_DIALECT_SMT_IR_SMTINTOPS_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.h b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.h
new file mode 100644
index 0000000000000..1be7db605d911
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.h
@@ -0,0 +1,25 @@
+//===- SMTOps.h - SMT dialect operations ------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTOPS_H
+#define MLIR_DIALECT_SMT_IR_SMTOPS_H
+
+#include "mlir/IR/OpImplementation.h"
+#include "mlir/IR/SymbolTable.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
+#include "mlir/Interfaces/InferTypeOpInterface.h"
+#include "mlir/Interfaces/SideEffectInterfaces.h"
+
+#include "mlir/Dialect/SMT/IR/SMTAttributes.h"
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+
+#define GET_OP_CLASSES
+#include "mlir/Dialect/SMT/IR/SMT.h.inc"
+
+#endif // MLIR_DIALECT_SMT_IR_SMTOPS_H
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
new file mode 100644
index 0000000000000..1872c00b74f1a
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
@@ -0,0 +1,475 @@
+//===- SMTOps.td - SMT dialect operations ------------------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTOPS_TD
+#define MLIR_DIALECT_SMT_IR_SMTOPS_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/Dialect/SMT/IR/SMTAttributes.td"
+include "mlir/Dialect/SMT/IR/SMTTypes.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/OpAsmInterface.td"
+include "mlir/Interfaces/InferTypeOpInterface.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
+
+class SMTOp<string mnemonic, list<Trait> traits = []> :
+  Op<SMTDialect, mnemonic, traits>;
+
+def DeclareFunOp : SMTOp<"declare_fun", [
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+]> {
+  let summary = "declare a symbolic value of a given sort";
+  let description = [{
+    This operation declares a symbolic value just as the `declare-const` and
+    `declare-fun` statements in SMT-LIB 2.7. The result type determines the SMT
+    sort of the symbolic value. The returned value can then be used to refer to
+    the symbolic value instead of using the identifier like in SMT-LIB.
+
+    The optionally provided string will be used as a prefix for the newly
+    generated identifier (useful for easier readability when exporting to
+    SMT-LIB). Each `declare` will always provide a unique new symbolic value
+    even if the identifier strings are the same.
+
+    Note that there does not exist a separate operation equivalent to
+    SMT-LIBs `define-fun` since
+    ```
+    (define-fun f (a Int) Int (-a))
+    ```
+    is only syntactic sugar for
+    ```
+    %f = smt.declare_fun : !smt.func<(!smt.int) !smt.int>
+    %0 = smt.forall {
+    ^bb0(%arg0: !smt.int):
+      %1 = smt.apply_func %f(%arg0) : !smt.func<(!smt.int) !smt.int>
+      %2 = smt.int.neg %arg0
+      %3 = smt.eq %1, %2 : !smt.int
+      smt.yield %3 : !smt.bool
+    }
+    smt.assert %0
+    ```
+
+    Note that this operation cannot be marked as Pure since two operations (even
+    with the same identifier string) could then be CSEd, leading to incorrect
+    behavior.
+  }];
+
+  let arguments = (ins OptionalAttr<StrAttr>:$namePrefix);
+  let results = (outs Res<AnySMTType, "a symbolic value", [MemAlloc]>:$result);
+
+  let assemblyFormat = [{
+    ($namePrefix^)? attr-dict `:` qualified(type($result))
+  }];
+
+  let builders = [
+    OpBuilder<(ins "mlir::Type":$type), [{
+      build($_builder, $_state, type, nullptr);
+    }]>
+  ];
+}
+
+def BoolConstantOp : SMTOp<"constant", [
+  Pure,
+  ConstantLike,
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
+]> {
+  let summary = "Produce a constant boolean";
+  let description = [{
+    Produces the constant expressions 'true' and 'false' as described in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB
+    Standard 2.7.
+  }];
+
+  let arguments = (ins BoolAttr:$value);
+  let results = (outs BoolType:$result);
+  let assemblyFormat = "$value attr-dict";
+
+  let hasFolder = true;
+}
+
+def SolverOp : SMTOp<"solver", [
+  IsolatedFromAbove,
+  SingleBlockImplicitTerminator<"smt::YieldOp">,
+]> {
+  let summary = "create a solver instance within a lifespan";
+  let description = [{
+    This operation defines an SMT context with a solver instance. SMT operations
+    are only valid when being executed between the start and end of the region
+    of this operation. Any invocation outside is undefined. However, they do not
+    have to be direct children of this operation. For example, it is allowed to
+    have SMT operations in a `func.func` which is only called from within this
+    region. No SMT value may enter or exit the lifespan of this region (such
+    that no value created from another SMT context can be used in this scope and
+    the solver can deallocate all state required to keep track of SMT values at
+    the end).
+
+    As a result, the region is comparable to an entire SMT-LIB script, but
+    allows for concrete operations and control-flow. Concrete values may be
+    passed in and returned to influence the computations after the `smt.solver`
+    operation.
+
+    Example:
+    ```mlir
+    %0:2 = smt.solver (%in) {smt.some_attr} : (i8) -> (i8, i32) {
+    ^bb0(%arg0: i8):
+      %c = smt.declare_fun "c" : !smt.bool
+      smt.assert %c
+      %1 = smt.check sat {
+        %c1_i32 = arith.constant 1 : i32
+        smt.yield %c1_i32 : i32
+      } unknown {
+        %c0_i32 = arith.constant 0 : i32
+        smt.yield %c0_i32 : i32
+      } unsat {
+        %c-1_i32 = arith.constant -1 : i32
+        smt.yield %c-1_i32 : i32
+      } -> i32
+      smt.yield %arg0, %1 : i8, i32
+    }
+    ```
+  }];
+
+  let arguments = (ins Variadic<AnyNonSMTType>:$inputs);
+  let regions = (region SizedRegion<1>:$bodyRegion);
+  let results = (outs Variadic<AnyNonSMTType>:$results);
+
+  let assemblyFormat = [{
+    `(` $inputs `)` attr-dict `:` functional-type($inputs, $results) $bodyRegion
+  }];
+
+  let hasRegionVerifier = true;
+}
+
+def SetLogicOp : SMTOp<"set_logic", [
+  HasParent<"smt::SolverOp">,
+]> {
+  let summary = "set the logic for the SMT solver";
+  let arguments = (ins StrAttr:$logic);
+  let assemblyFormat = "$logic attr-dict";
+}
+
+def AssertOp : SMTOp<"assert", []> {
+  let summary = "assert that a boolean expression holds";
+  let arguments = (ins BoolType:$input);
+  let assemblyFormat = "$input attr-dict";
+}
+
+def ResetOp : SMTOp<"reset", []> {
+  let summary = "reset the solver";
+  let assemblyFormat = "attr-dict";
+}
+
+def PushOp : SMTOp<"push", []> {
+  let summary = "push a given number of levels onto the assertion stack";
+  let arguments = (ins ConfinedAttr<I32Attr, [IntNonNegative]>:$count);
+  let assemblyFormat = "$count attr-dict";
+}
+
+def PopOp : SMTOp<"pop", []> {
+  let summary = "pop a given number of levels from the assertion stack";
+  let arguments = (ins ConfinedAttr<I32Attr, [IntNonNegative]>:$count);
+  let assemblyFormat = "$count attr-dict";
+}
+
+def CheckOp : SMTOp<"check", [
+  NoRegionArguments,
+  SingleBlockImplicitTerminator<"smt::YieldOp">,
+]> {
+  let summary = "check if the current set of assertions is satisfiable";
+  let description = [{
+    This operation checks if all the assertions in the solver defined by the
+    nearest ancestor operation of type `smt.solver` are consistent. The outcome
+    an be 'satisfiable', 'unknown', or 'unsatisfiable' and the corresponding
+    region will be executed. It is the corresponding construct to the
+    `check-sat` in SMT-LIB.
+
+    Example:
+    ```mlir
+    %0 = smt.check sat {
+      %c1_i32 = arith.constant 1 : i32
+      smt.yield %c1_i32 : i32
+    } unknown {
+      %c0_i32 = arith.constant 0 : i32
+      smt.yield %c0_i32 : i32
+    } unsat {
+      %c-1_i32 = arith.constant -1 : i32
+      smt.yield %c-1_i32 : i32
+    } -> i32
+    ```
+  }];
+
+  let regions = (region SizedRegion<1>:$satRegion,
+                        SizedRegion<1>:$unknownRegion,
+                        SizedRegion<1>:$unsatRegion);
+  let results = (outs Variadic<AnyType>:$results);
+
+  let assemblyFormat = [{
+    attr-dict `sat` $satRegion `unknown` $unknownRegion `unsat` $unsatRegion
+    (`->` qualified(type($results))^ )?
+  }];
+
+  let hasRegionVerifier = true;
+}
+
+def YieldOp : SMTOp<"yield", [
+  Pure,
+  Terminator,
+  ReturnLike,
+  ParentOneOf<["smt::SolverOp", "smt::CheckOp",
+               "smt::ForallOp", "smt::ExistsOp"]>,
+]> {
+  let summary = "terminator operation for various regions of SMT operations";
+  let arguments = (ins Variadic<AnyType>:$values);
+  let assemblyFormat = "($values^ `:` qualified(type($values)))? attr-dict";
+  let builders = [OpBuilder<(ins), [{
+    build($_builder, $_state, std::nullopt);
+  }]>];
+}
+
+def ApplyFuncOp : SMTOp<"apply_func", [
+  Pure,
+  TypesMatchWith<"summary", "func", "result",
+                 "cast<SMTFuncType>($_self).getRangeType()">,
+  RangedTypesMatchWith<"summary", "func", "args",
+                       "cast<SMTFuncType>($_self).getDomainTypes()">
+]> {
+  let summary = "apply a function";
+  let description = [{
+    This operation performs a function application as described in the
+    [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).
+    It is part of the language itself rather than a theory or logic.
+  }];
+
+  let arguments = (ins SMTFuncType:$func,
+                       Variadic<AnyNonFuncSMTType>:$args);
+  let results = (outs AnyNonFuncSMTType:$result);
+
+  let assemblyFormat = [{
+    $func `(` $args `)` attr-dict `:` qualified(type($func))
+  }];
+}
+
+def EqOp : SMTOp<"eq", [Pure, SameTypeOperands]> {
+  let summary = "returns true iff all operands are identical";
+  let description = [{
+    This operation compares the operands and returns true iff all operands are
+    identical. The semantics are equivalent to the `=` operator defined in the
+    SMT-LIB Standard 2.7 in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).
+
+    Any SMT sort/type is allowed for the operands and it supports a variadic
+    number of operands, but requires at least two. This is because the `=`
+    operator is annotated with `:chainable` which means that `= a b c d` is
+    equivalent to `and (= a b) (= b c) (= c d)` where `and` is annotated
+    `:left-assoc`, i.e., it can be further rewritten to
+    `and (and (= a b) (= b c)) (= c d)`.
+  }];
+
+  let arguments = (ins Variadic<AnyNonFuncSMTType>:$inputs);
+  let results = (outs BoolType:$result);
+
+  let builders = [
+    OpBuilder<(ins "mlir::Value":$lhs, "mlir::Value":$rhs), [{
+      build($_builder, $_state, ValueRange{lhs, rhs});
+    }]>
+  ];
+
+  let hasCustomAssemblyFormat = true;
+  let hasVerifier = true;
+}
+
+def DistinctOp : SMTOp<"distinct", [Pure, SameTypeOperands]> {
+  let summary = "returns true iff all operands are not identical to any other";
+  let description = [{
+    This operation compares the operands and returns true iff all operands are
+    not identical to any of the other operands. The semantics are equivalent to
+    the `distinct` operator defined in the SMT-LIB Standard 2.7 in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).
+
+    Any SMT sort/type is allowed for the operands and it supports a variadic
+    number of operands, but requires at least two. This is because the
+    `distinct` operator is annotated with `:pairwise` which means that
+    `distinct a b c d` is equivalent to
+    ```
+    and (distinct a b) (distinct a c) (distinct a d)
+        (distinct b c) (distinct b d)
+        (distinct c d)
+    ```
+    where `and` is annotated `:left-assoc`, i.e., it can be further rewritten to
+    ```
+    (and (and (and (and (and (distinct a b)
+                             (distinct a c))
+                        (distinct a d))
+                   (distinct b c))
+              (distinct b d))
+         (distinct c d)
+    ```
+  }];
+
+  let arguments = (ins Variadic<AnyNonFuncSMTType>:$inputs);
+  let results = (outs BoolType:$result);
+
+  let builders = [
+    OpBuilder<(ins "mlir::Value":$lhs, "mlir::Value":$rhs), [{
+      build($_builder, $_state, ValueRange{lhs, rhs});
+    }]>
+  ];
+
+  let hasCustomAssemblyFormat = true;
+  let hasVerifier = true;
+}
+
+def IteOp : SMTOp<"ite", [
+  Pure,
+  AllTypesMatch<["thenValue", "elseValue", "result"]>
+]> {
+  let summary = "an if-then-else function";
+  let description = [{
+    This operation returns its second operand or its third operand depending on
+    whether its first operand is true or not. The semantics are equivalent to
+    the `ite` operator defined in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB
+    2.7 standard.
+  }];
+
+  let arguments = (ins BoolType:$cond,
+                       AnySMTType:$thenValue,
+                       AnySMTType:$elseValue);
+  let results = (outs AnySMTType:$result);
+
+  let assemblyFormat = [{
+    $cond `,` $thenValue `,` $elseValue attr-dict `:` qualified(type($result))
+  }];
+}
+
+def NotOp : SMTOp<"not", [Pure]> {
+  let summary = "a boolean negation";
+  let description = [{
+    This operation performs a boolean negation. The semantics are equivalent to
+    the 'not' operator in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB
+    Standard 2.7.
+  }];
+
+  let arguments = (ins BoolType:$input);
+  let results = (outs BoolType:$result);
+  let assemblyFormat = "$input attr-dict";
+}
+
+class VariadicBoolOp<string mnemonic, string desc> : SMTOp<mnemonic, [Pure]> {
+  let summary = desc;
+  let description = "This operation performs " # desc # [{.
+    The semantics are equivalent to the '}] # mnemonic # [{' operator in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2).
+    of the SMT-LIB Standard 2.7.
+
+    It supports a variadic number of operands, but requires at least two.
+    This is because the operator is annotated with the `:left-assoc` attribute
+    which means that `op a b c` is equivalent to `(op (op a b) c)`.
+  }];
+
+  let arguments = (ins Variadic<BoolType>:$inputs);
+  let results = (outs BoolType:$result);
+  let assemblyFormat = "$inputs attr-dict";
+
+  let builders = [
+    OpBuilder<(ins "mlir::Value":$lhs, "mlir::Value":$rhs), [{
+      build($_builder, $_state, ValueRange{lhs, rhs});
+    }]>
+  ];
+}
+
+def AndOp : VariadicBoolOp<"and", "a boolean conjunction">;
+def OrOp  : VariadicBoolOp<"or", "a boolean disjunction">;
+def XOrOp : VariadicBoolOp<"xor", "a boolean exclusive OR">;
+
+def ImpliesOp : SMTOp<"implies", [Pure]> {
+  let summary = "boolean implication";
+  let description = [{
+    This operation performs a boolean implication. The semantics are equivalent
+    to the '=>' operator in the
+    [Core theory](https://smtlib.cs.uiowa.edu/Theories/Core.smt2) of the SMT-LIB
+    Standard 2.7.
+  }];
+
+  let arguments = (ins BoolType:$lhs, BoolType:$rhs);
+  let results = (outs BoolType:$result);
+  let assemblyFormat = "$lhs `,` $rhs attr-dict";
+}
+
+class QuantifierOp<string mnemonic> : SMTOp<mnemonic, [
+  RecursivelySpeculatable,
+  RecursiveMemoryEffects,
+  SingleBlockImplicitTerminator<"smt::YieldOp">,
+]> {
+  let description = [{
+    This operation represents the }] # summary # [{ as described in the
+    [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).
+    It is part of the language itself rather than a theory or logic.
+
+    The operation specifies the name prefixes (as an optional attribute) and
+    types (as the types of the block arguments of the regions) of bound
+    variables that may be used in the 'body' of the operation. If a 'patterns'
+    region is specified, the block arguments must match the ones of the 'body'
+    region and (other than there) must be used at least once in the 'patterns'
+    region. It may also not contain any operations that bind variables, such as
+    quantifiers. While the 'body' region must always yield exactly one
+    `!smt.bool`-typed value, the 'patterns' region can yield an arbitrary number
+    (but at least one) of SMT values.
+
+    The bound variables can be any SMT type except of functions, since SMT only
+    supports first-order logic.
+
+    The 'no_patterns' attribute is only allowed when no 'patterns' region is
+    specified and forbids the solver to generate and use patterns for this
+    quantifier.
+
+    The 'weight' attribute indicates the importance of this quantifier being
+    instantiated compared to other quantifiers that may be present. The default
+    value is zero.
+
+    Both the 'no_patterns' and 'weight' attributes are annotations to the
+    quantifiers body term. Annotations and attributes are described in the
+    standard in sections 3.4, and 3.6 (specifically 3.6.5). SMT-LIB allows
+    adding custom attributes to provide solvers with additional metadata, e.g.,
+    hints such as above mentioned attributes. They are not part of the standard
+    themselves, but supported by common SMT solvers (e.g., Z3). 
+  }];
+
+  let arguments = (ins DefaultValuedAttr<I32Attr, "0">:$weight,
+                       UnitAttr:$noPattern,
+                       OptionalAttr<StrArrayAttr>:$boundVarNames);
+  let regions = (region SizedRegion<1>:$body,
+                        VariadicRegion<SizedRegion<1>>:$patterns);
+  let results = (outs BoolType:$result);
+
+  let builders = [
+    OpBuilder<(ins
+      "TypeRange":$boundVarTypes,
+      "function_ref<Value(OpBuilder &, Location, ValueRange)>":$bodyBuilder,
+      CArg<"std::optional<ArrayRef<StringRef>>", "std::nullopt">:$boundVarNames,
+      CArg<"function_ref<ValueRange(OpBuilder &, Location, ValueRange)>",
+           "{}">:$patternBuilder,
+      CArg<"uint32_t", "0">:$weight,
+      CArg<"bool", "false">:$noPattern)>
+  ];
+  let skipDefaultBuilders = true;
+
+  let assemblyFormat = [{
+    ($boundVarNames^)? (`no_pattern` $noPattern^)? (`weight` $weight^)?
+    attr-dict-with-keyword $body (`patterns` $patterns^)?
+  }];
+
+  let hasVerifier = true;
+  let hasRegionVerifier = true;
+}
+
+def ForallOp : QuantifierOp<"forall"> { let summary = "forall quantifier"; }
+def ExistsOp : QuantifierOp<"exists"> { let summary = "exists quantifier"; }
+
+#endif // MLIR_DIALECT_SMT_IR_SMTOPS_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.h b/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.h
new file mode 100644
index 0000000000000..7e50c8bb51f72
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.h
@@ -0,0 +1,30 @@
+//===- SMTTypes.h - SMT dialect types ---------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTTYPES_H
+#define MLIR_DIALECT_SMT_IR_SMTTYPES_H
+
+#include "mlir/IR/BuiltinTypes.h"
+#include "mlir/IR/Types.h"
+
+#define GET_TYPEDEF_CLASSES
+#include "mlir/Dialect/SMT/IR/SMTTypes.h.inc"
+
+namespace mlir {
+namespace smt {
+
+/// Returns whether the given type is an SMT value type.
+bool isAnySMTValueType(mlir::Type type);
+
+/// Returns whether the given type is an SMT value type (excluding functions).
+bool isAnyNonFuncSMTValueType(mlir::Type type);
+
+} // namespace smt
+} // namespace mlir
+
+#endif // MLIR_DIALECT_SMT_IR_SMTTYPES_H
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.td b/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.td
new file mode 100644
index 0000000000000..19fee9756e5f5
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTTypes.td
@@ -0,0 +1,145 @@
+//===- SMTTypes.td - SMT dialect types ---------------------*- tablegen -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTTYPES_TD
+#define MLIR_DIALECT_SMT_IR_SMTTYPES_TD
+
+include "mlir/Dialect/SMT/IR/SMTDialect.td"
+include "mlir/IR/AttrTypeBase.td"
+
+class SMTTypeDef<string name> : TypeDef<SMTDialect, name> { }
+
+def BoolType : SMTTypeDef<"Bool"> {
+  let mnemonic = "bool";
+  let assemblyFormat = "";
+}
+
+def IntType : SMTTypeDef<"Int"> {
+  let mnemonic = "int";
+  let description = [{
+    This type represents the `Int` sort as described in the
+    [SMT Ints theory](https://smtlib.cs.uiowa.edu/Theories/Ints.smt2) of the
+    SMT-LIB 2.7 standard.
+  }];
+  let assemblyFormat = "";
+}
+
+def BitVectorType : SMTTypeDef<"BitVector"> {
+  let mnemonic = "bv";
+  let description = [{
+    This type represents the `(_ BitVec width)` sort as described in the
+    [SMT bit-vector
+    theory](https://smtlib.cs.uiowa.edu/theories-FixedSizeBitVectors.shtml).
+
+    The bit-width must be strictly greater than zero.
+  }];
+
+  let parameters = (ins "int64_t":$width);
+  let assemblyFormat = "`<` $width `>`";
+
+  let genVerifyDecl = true;
+}
+
+def ArrayType : SMTTypeDef<"Array"> {
+  let mnemonic = "array";
+  let description = [{
+    This type represents the `(Array X Y)` sort, where X and Y are any
+    sort/type, as described in the
+    [SMT ArrayEx theory](https://smtlib.cs.uiowa.edu/Theories/ArraysEx.smt2) of
+    the SMT-LIB standard 2.7.
+  }];
+
+  let parameters = (ins "mlir::Type":$domainType, "mlir::Type":$rangeType);
+  let assemblyFormat = "`<` `[` $domainType `->` $rangeType `]` `>`";
+
+  let genVerifyDecl = true;
+}
+
+def SMTFuncType : SMTTypeDef<"SMTFunc"> {
+  let mnemonic = "func";
+  let description = [{
+    This type represents the SMT function sort as described in the
+    [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).
+    It is part of the language itself rather than a theory or logic.
+
+    A function in SMT can have an arbitrary domain size, but always has exactly
+    one range sort.
+
+    Since SMT only supports first-order logic, it is not possible to nest
+    function types.
+
+    Example: `!smt.func<(!smt.bool, !smt.int) !smt.bool>` is equivalent to
+    `((Bool Int) Bool)` in SMT-LIB.
+  }];
+
+  let parameters = (ins
+    ArrayRefParameter<"mlir::Type", "domain types">:$domainTypes,
+    "mlir::Type":$rangeType
+  );
+
+  // Note: We are not printing the parentheses when no domain type is present
+  // because the default MLIR parser thinks it is a builtin function type
+  // otherwise.
+  let assemblyFormat = "`<` `(` $domainTypes `)` ` ` $rangeType `>`";
+
+  let builders = [
+    TypeBuilderWithInferredContext<(ins
+      "llvm::ArrayRef<mlir::Type>":$domainTypes,
+      "mlir::Type":$rangeType), [{
+      return $_get(rangeType.getContext(), domainTypes, rangeType);
+    }]>,
+    TypeBuilderWithInferredContext<(ins "mlir::Type":$rangeType), [{
+      return $_get(rangeType.getContext(),
+                   llvm::ArrayRef<mlir::Type>{}, rangeType);
+    }]>
+  ];
+
+  let genVerifyDecl = true;
+}
+
+def SortType : SMTTypeDef<"Sort"> {
+  let mnemonic = "sort";
+  let description = [{
+    This type represents uninterpreted sorts. The usage of a type like
+    `!smt.sort<"sort_name"[!smt.bool, !smt.sort<"other_sort">]>` implies a
+    `declare-sort sort_name 2` and a `declare-sort other_sort 0` in SMT-LIB.
+    This type represents concrete use-sites of such declared sorts, in this
+    particular case it would be equivalent to `(sort_name Bool other_sort)` in
+    SMT-LIB. More details about the semantics can be found in the
+    [SMT-LIB 2.7 standard](https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-02-05.pdf).
+  }];
+
+  let parameters = (ins
+    "mlir::StringAttr":$identifier,
+    OptionalArrayRefParameter<"mlir::Type", "sort parameters">:$sortParams
+  );
+
+  let assemblyFormat = "`<` $identifier (`[` $sortParams^ `]`)? `>`";
+
+  let builders = [
+    TypeBuilder<(ins "llvm::StringRef":$identifier,
+                     "llvm::ArrayRef<mlir::Type>":$sortParams), [{
+      return $_get($_ctxt, mlir::StringAttr::get($_ctxt, identifier),
+                           sortParams);
+    }]>,
+    TypeBuilder<(ins "llvm::StringRef":$identifier), [{
+      return $_get($_ctxt, mlir::StringAttr::get($_ctxt, identifier),
+                    llvm::ArrayRef<mlir::Type>{});
+    }]>,
+  ];
+
+  let genVerifyDecl = true;
+}
+
+def AnySMTType : Type<CPred<"smt::isAnySMTValueType($_self)">,
+                      "any SMT value type">;
+def AnyNonFuncSMTType : Type<CPred<"smt::isAnyNonFuncSMTValueType($_self)">,
+                             "any non-function SMT value type">;
+def AnyNonSMTType : Type<Neg<AnySMTType.predicate>, "any non-smt type">;
+
+#endif // MLIR_DIALECT_SMT_IR_SMTTYPES_TD
diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTVisitors.h b/mlir/include/mlir/Dialect/SMT/IR/SMTVisitors.h
new file mode 100644
index 0000000000000..e6b1fe8e71a20
--- /dev/null
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTVisitors.h
@@ -0,0 +1,201 @@
+//===- SMTVisitors.h - SMT Dialect Visitors ---------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines visitors that make it easier to work with the SMT IR.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_SMT_IR_SMTVISITORS_H
+#define MLIR_DIALECT_SMT_IR_SMTVISITORS_H
+
+#include "mlir/Dialect/SMT/IR/SMTOps.h"
+#include "llvm/ADT/TypeSwitch.h"
+
+namespace mlir {
+namespace smt {
+
+/// This helps visit SMT nodes.
+template <typename ConcreteType, typename ResultType = void,
+          typename... ExtraArgs>
+class SMTOpVisitor {
+public:
+  ResultType dispatchSMTOpVisitor(Operation *op, ExtraArgs... args) {
+    auto *thisCast = static_cast<ConcreteType *>(this);
+    return TypeSwitch<Operation *, ResultType>(op)
+        .template Case<
+            // Constants
+            BoolConstantOp, IntConstantOp, BVConstantOp,
+            // Bit-vector arithmetic
+            BVNegOp, BVAddOp, BVMulOp, BVURemOp, BVSRemOp, BVSModOp, BVShlOp,
+            BVLShrOp, BVAShrOp, BVUDivOp, BVSDivOp,
+            // Bit-vector bitwise
+            BVNotOp, BVAndOp, BVOrOp, BVXOrOp,
+            // Other bit-vector ops
+            ConcatOp, ExtractOp, RepeatOp, BVCmpOp, BV2IntOp,
+            // Int arithmetic
+            IntAddOp, IntMulOp, IntSubOp, IntDivOp, IntModOp, IntCmpOp,
+            Int2BVOp,
+            // Core Ops
+            EqOp, DistinctOp, IteOp,
+            // Variable/symbol declaration
+            DeclareFunOp, ApplyFuncOp,
+            // solver interaction
+            SolverOp, AssertOp, ResetOp, PushOp, PopOp, CheckOp, SetLogicOp,
+            // Boolean logic
+            NotOp, AndOp, OrOp, XOrOp, ImpliesOp,
+            // Arrays
+            ArrayStoreOp, ArraySelectOp, ArrayBroadcastOp,
+            // Quantifiers
+            ForallOp, ExistsOp, YieldOp>([&](auto expr) -> ResultType {
+          return thisCast->visitSMTOp(expr, args...);
+        })
+        .Default([&](auto expr) -> ResultType {
+          return thisCast->visitInvalidSMTOp(op, args...);
+        });
+  }
+
+  /// This callback is invoked on any non-expression operations.
+  ResultType visitInvalidSMTOp(Operation *op, ExtraArgs... args) {
+    op->emitOpError("unknown SMT node");
+    abort();
+  }
+
+  /// This callback is invoked on any SMT operations that are not
+  /// handled by the concrete visitor.
+  ResultType visitUnhandledSMTOp(Operation *op, ExtraArgs... args) {
+    return ResultType();
+  }
+
+#define HANDLE(OPTYPE, OPKIND)                                                 \
+  ResultType visitSMTOp(OPTYPE op, ExtraArgs... args) {                        \
+    return static_cast<ConcreteType *>(this)->visit##OPKIND##SMTOp(op,         \
+                                                                   args...);   \
+  }
+
+  // Constants
+  HANDLE(BoolConstantOp, Unhandled);
+  HANDLE(IntConstantOp, Unhandled);
+  HANDLE(BVConstantOp, Unhandled);
+
+  // Bit-vector arithmetic
+  HANDLE(BVNegOp, Unhandled);
+  HANDLE(BVAddOp, Unhandled);
+  HANDLE(BVMulOp, Unhandled);
+  HANDLE(BVURemOp, Unhandled);
+  HANDLE(BVSRemOp, Unhandled);
+  HANDLE(BVSModOp, Unhandled);
+  HANDLE(BVShlOp, Unhandled);
+  HANDLE(BVLShrOp, Unhandled);
+  HANDLE(BVAShrOp, Unhandled);
+  HANDLE(BVUDivOp, Unhandled);
+  HANDLE(BVSDivOp, Unhandled);
+
+  // Bit-vector bitwise operations
+  HANDLE(BVNotOp, Unhandled);
+  HANDLE(BVAndOp, Unhandled);
+  HANDLE(BVOrOp, Unhandled);
+  HANDLE(BVXOrOp, Unhandled);
+
+  // Other bit-vector operations
+  HANDLE(ConcatOp, Unhandled);
+  HANDLE(ExtractOp, Unhandled);
+  HANDLE(RepeatOp, Unhandled);
+  HANDLE(BVCmpOp, Unhandled);
+  HANDLE(BV2IntOp, Unhandled);
+
+  // Int arithmetic
+  HANDLE(IntAddOp, Unhandled);
+  HANDLE(IntMulOp, Unhandled);
+  HANDLE(IntSubOp, Unhandled);
+  HANDLE(IntDivOp, Unhandled);
+  HANDLE(IntModOp, Unhandled);
+
+  HANDLE(IntCmpOp, Unhandled);
+  HANDLE(Int2BVOp, Unhandled);
+
+  HANDLE(EqOp, Unhandled);
+  HANDLE(DistinctOp, Unhandled);
+  HANDLE(IteOp, Unhandled);
+
+  HANDLE(DeclareFunOp, Unhandled);
+  HANDLE(ApplyFuncOp, Unhandled);
+
+  HANDLE(SolverOp, Unhandled);
+  HANDLE(AssertOp, Unhandled);
+  HANDLE(ResetOp, Unhandled);
+  HANDLE(PushOp, Unhandled);
+  HANDLE(PopOp, Unhandled);
+  HANDLE(CheckOp, Unhandled);
+  HANDLE(SetLogicOp, Unhandled);
+
+  // Boolean logic operations
+  HANDLE(NotOp, Unhandled);
+  HANDLE(AndOp, Unhandled);
+  HANDLE(OrOp, Unhandled);
+  HANDLE(XOrOp, Unhandled);
+  HANDLE(ImpliesOp, Unhandled);
+
+  // Array operations
+  HANDLE(ArrayStoreOp, Unhandled);
+  HANDLE(ArraySelectOp, Unhandled);
+  HANDLE(ArrayBroadcastOp, Unhandled);
+
+  // Quantifier operations
+  HANDLE(ForallOp, Unhandled);
+  HANDLE(ExistsOp, Unhandled);
+  HANDLE(YieldOp, Unhandled);
+
+#undef HANDLE
+};
+
+/// This helps visit SMT types.
+template <typename ConcreteType, typename ResultType = void,
+          typename... ExtraArgs>
+class SMTTypeVisitor {
+public:
+  ResultType dispatchSMTTypeVisitor(Type type, ExtraArgs... args) {
+    auto *thisCast = static_cast<ConcreteType *>(this);
+    return TypeSwitch<Type, ResultType>(type)
+        .template Case<BoolType, IntType, BitVectorType, ArrayType, SMTFuncType,
+                       SortType>([&](auto expr) -> ResultType {
+          return thisCast->visitSMTType(expr, args...);
+        })
+        .Default([&](auto expr) -> ResultType {
+          return thisCast->visitInvalidSMTType(type, args...);
+        });
+  }
+
+  /// This callback is invoked on any non-expression types.
+  ResultType visitInvalidSMTType(Type type, ExtraArgs... args) { abort(); }
+
+  /// This callback is invoked on any SMT type that are not
+  /// handled by the concrete visitor.
+  ResultType visitUnhandledSMTType(Type type, ExtraArgs... args) {
+    return ResultType();
+  }
+
+#define HANDLE(TYPE, KIND)                                                     \
+  ResultType visitSMTType(TYPE op, ExtraArgs... args) {                        \
+    return static_cast<ConcreteType *>(this)->visit##KIND##SMTType(op,         \
+                                                                   args...);   \
+  }
+
+  HANDLE(BoolType, Unhandled);
+  HANDLE(IntegerType, Unhandled);
+  HANDLE(BitVectorType, Unhandled);
+  HANDLE(ArrayType, Unhandled);
+  HANDLE(SMTFuncType, Unhandled);
+  HANDLE(SortType, Unhandled);
+
+#undef HANDLE
+};
+
+} // namespace smt
+} // namespace mlir
+
+#endif // MLIR_DIALECT_SMT_IR_SMTVISITORS_H
diff --git a/mlir/include/mlir/InitAllDialects.h b/mlir/include/mlir/InitAllDialects.h
index 33bc89279c08c..e83be7b40eded 100644
--- a/mlir/include/mlir/InitAllDialects.h
+++ b/mlir/include/mlir/InitAllDialects.h
@@ -73,6 +73,7 @@
 #include "mlir/Dialect/SCF/TransformOps/SCFTransformOps.h"
 #include "mlir/Dialect/SCF/Transforms/BufferDeallocationOpInterfaceImpl.h"
 #include "mlir/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.h"
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
 #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
 #include "mlir/Dialect/Shape/IR/Shape.h"
 #include "mlir/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.h"
@@ -143,6 +144,7 @@ inline void registerAllDialects(DialectRegistry &registry) {
                   ROCDL::ROCDLDialect,
                   scf::SCFDialect,
                   shape::ShapeDialect,
+                  smt::SMTDialect,
                   sparse_tensor::SparseTensorDialect,
                   spirv::SPIRVDialect,
                   tensor::TensorDialect,
diff --git a/mlir/lib/Dialect/CMakeLists.txt b/mlir/lib/Dialect/CMakeLists.txt
index 80b0ef068d96d..a473f2ff317c9 100644
--- a/mlir/lib/Dialect/CMakeLists.txt
+++ b/mlir/lib/Dialect/CMakeLists.txt
@@ -33,6 +33,7 @@ add_subdirectory(Ptr)
 add_subdirectory(Quant)
 add_subdirectory(SCF)
 add_subdirectory(Shape)
+add_subdirectory(SMT)
 add_subdirectory(SparseTensor)
 add_subdirectory(SPIRV)
 add_subdirectory(Tensor)
diff --git a/mlir/lib/Dialect/SMT/CMakeLists.txt b/mlir/lib/Dialect/SMT/CMakeLists.txt
new file mode 100644
index 0000000000000..f33061b2d87cf
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(IR)
diff --git a/mlir/lib/Dialect/SMT/IR/CMakeLists.txt b/mlir/lib/Dialect/SMT/IR/CMakeLists.txt
new file mode 100644
index 0000000000000..e287613da9fd0
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/IR/CMakeLists.txt
@@ -0,0 +1,27 @@
+add_mlir_dialect_library(MLIRSMT
+  SMTAttributes.cpp
+  SMTDialect.cpp
+  SMTOps.cpp
+  SMTTypes.cpp
+
+  ADDITIONAL_HEADER_DIRS
+  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SMT
+
+  DEPENDS
+  MLIRSMTAttrIncGen
+  MLIRSMTEnumsIncGen
+  MLIRSMTIncGen
+
+  LINK_COMPONENTS
+  Support
+
+  LINK_LIBS PUBLIC
+  MLIRIR
+  MLIRInferTypeOpInterface
+  MLIRSideEffectInterfaces
+  MLIRControlFlowInterfaces
+)
+
+add_dependencies(mlir-headers
+  MLIRSMTIncGen
+)
diff --git a/mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp b/mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp
new file mode 100644
index 0000000000000..c28f3558a02d2
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp
@@ -0,0 +1,201 @@
+//===- SMTAttributes.cpp - Implement SMT attributes -----------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTAttributes.h"
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+#include "mlir/IR/Builders.h"
+#include "mlir/IR/DialectImplementation.h"
+#include "llvm/ADT/TypeSwitch.h"
+#include "llvm/Support/Format.h"
+
+using namespace mlir;
+using namespace mlir::smt;
+
+//===----------------------------------------------------------------------===//
+// BitVectorAttr
+//===----------------------------------------------------------------------===//
+
+namespace mlir {
+namespace smt {
+namespace detail {
+struct BitVectorAttrStorage : public mlir::AttributeStorage {
+  using KeyTy = APInt;
+  BitVectorAttrStorage(APInt value) : value(std::move(value)) {}
+
+  KeyTy getAsKey() const { return value; }
+
+  // NOTE: the implementation of this operator is the reason we need to define
+  // the storage manually. The auto-generated version would just do the direct
+  // equality check of the APInt, but that asserts the bitwidth of both to be
+  // the same, leading to a crash. This implementation, therefore, checks for
+  // matching bit-width beforehand.
+  bool operator==(const KeyTy &key) const {
+    return (value.getBitWidth() == key.getBitWidth() && value == key);
+  }
+
+  static llvm::hash_code hashKey(const KeyTy &key) {
+    return llvm::hash_value(key);
+  }
+
+  static BitVectorAttrStorage *
+  construct(mlir::AttributeStorageAllocator &allocator, KeyTy &&key) {
+    return new (allocator.allocate<BitVectorAttrStorage>())
+        BitVectorAttrStorage(std::move(key));
+  }
+
+  APInt value;
+};
+} // namespace detail
+} // namespace smt
+} // namespace mlir
+
+APInt BitVectorAttr::getValue() const { return getImpl()->value; }
+
+LogicalResult BitVectorAttr::verify(
+    function_ref<InFlightDiagnostic()> emitError,
+    APInt value) { // NOLINT(performance-unnecessary-value-param)
+  if (value.getBitWidth() < 1)
+    return emitError() << "bit-width must be at least 1, but got "
+                       << value.getBitWidth();
+  return success();
+}
+
+std::string BitVectorAttr::getValueAsString(bool prefix) const {
+  unsigned width = getValue().getBitWidth();
+  SmallVector<char> toPrint;
+  StringRef pref = prefix ? "#" : "";
+  if (width % 4 == 0) {
+    getValue().toString(toPrint, 16, false, false, false);
+    // APInt's 'toString' omits leading zeros. However, those are critical here
+    // because they determine the bit-width of the bit-vector.
+    SmallVector<char> leadingZeros(width / 4 - toPrint.size(), '0');
+    return (pref + "x" + Twine(leadingZeros) + toPrint).str();
+  }
+
+  getValue().toString(toPrint, 2, false, false, false);
+  // APInt's 'toString' omits leading zeros
+  SmallVector<char> leadingZeros(width - toPrint.size(), '0');
+  return (pref + "b" + Twine(leadingZeros) + toPrint).str();
+}
+
+/// Parse an SMT-LIB formatted bit-vector string.
+static FailureOr<APInt>
+parseBitVectorString(function_ref<InFlightDiagnostic()> emitError,
+                     StringRef value) {
+  if (value[0] != '#')
+    return emitError() << "expected '#'";
+
+  if (value.size() < 3)
+    return emitError() << "expected at least one digit";
+
+  if (value[1] == 'b')
+    return APInt(value.size() - 2, std::string(value.begin() + 2, value.end()),
+                 2);
+
+  if (value[1] == 'x')
+    return APInt((value.size() - 2) * 4,
+                 std::string(value.begin() + 2, value.end()), 16);
+
+  return emitError() << "expected either 'b' or 'x'";
+}
+
+BitVectorAttr BitVectorAttr::get(MLIRContext *context, StringRef value) {
+  auto maybeValue = parseBitVectorString(nullptr, value);
+
+  assert(succeeded(maybeValue) && "string must have SMT-LIB format");
+  return Base::get(context, *maybeValue);
+}
+
+BitVectorAttr
+BitVectorAttr::getChecked(function_ref<InFlightDiagnostic()> emitError,
+                          MLIRContext *context, StringRef value) {
+  auto maybeValue = parseBitVectorString(emitError, value);
+  if (failed(maybeValue))
+    return {};
+
+  return Base::getChecked(emitError, context, *maybeValue);
+}
+
+BitVectorAttr BitVectorAttr::get(MLIRContext *context, uint64_t value,
+                                 unsigned width) {
+  return Base::get(context, APInt(width, value));
+}
+
+BitVectorAttr
+BitVectorAttr::getChecked(function_ref<InFlightDiagnostic()> emitError,
+                          MLIRContext *context, uint64_t value,
+                          unsigned width) {
+  if (width < 64 && value >= (UINT64_C(1) << width)) {
+    emitError() << "value does not fit in a bit-vector of desired width";
+    return {};
+  }
+  return Base::getChecked(emitError, context, APInt(width, value));
+}
+
+Attribute BitVectorAttr::parse(AsmParser &odsParser, Type odsType) {
+  llvm::SMLoc loc = odsParser.getCurrentLocation();
+
+  APInt val;
+  if (odsParser.parseLess() || odsParser.parseInteger(val) ||
+      odsParser.parseGreater())
+    return {};
+
+  // Requires the use of `quantified(<attr>)` in operation assembly formats.
+  if (!odsType || !llvm::isa<BitVectorType>(odsType)) {
+    odsParser.emitError(loc) << "explicit bit-vector type required";
+    return {};
+  }
+
+  unsigned width = llvm::cast<BitVectorType>(odsType).getWidth();
+
+  if (width > val.getBitWidth()) {
+    // sext is always safe here, even for unsigned values, because the
+    // parseOptionalInteger method will return something with a zero in the
+    // top bits if it is a positive number.
+    val = val.sext(width);
+  } else if (width < val.getBitWidth()) {
+    // The parser can return an unnecessarily wide result.
+    // This isn't a problem, but truncating off bits is bad.
+    unsigned neededBits =
+        val.isNegative() ? val.getSignificantBits() : val.getActiveBits();
+    if (width < neededBits) {
+      odsParser.emitError(loc)
+          << "integer value out of range for given bit-vector type " << odsType;
+      return {};
+    }
+    val = val.trunc(width);
+  }
+
+  return BitVectorAttr::get(odsParser.getContext(), val);
+}
+
+void BitVectorAttr::print(AsmPrinter &odsPrinter) const {
+  // This printer only works for the extended format where the MLIR
+  // infrastructure prints the type for us. This means, the attribute should
+  // never be used without `quantified` in an assembly format.
+  odsPrinter << "<" << getValue() << ">";
+}
+
+Type BitVectorAttr::getType() const {
+  return BitVectorType::get(getContext(), getValue().getBitWidth());
+}
+
+//===----------------------------------------------------------------------===//
+// ODS Boilerplate
+//===----------------------------------------------------------------------===//
+
+#define GET_ATTRDEF_CLASSES
+#include "mlir/Dialect/SMT/IR/SMTAttributes.cpp.inc"
+
+void SMTDialect::registerAttributes() {
+  addAttributes<
+#define GET_ATTRDEF_LIST
+#include "mlir/Dialect/SMT/IR/SMTAttributes.cpp.inc"
+      >();
+}
diff --git a/mlir/lib/Dialect/SMT/IR/SMTDialect.cpp b/mlir/lib/Dialect/SMT/IR/SMTDialect.cpp
new file mode 100644
index 0000000000000..66eed861b2bb7
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/IR/SMTDialect.cpp
@@ -0,0 +1,47 @@
+//===- SMTDialect.cpp - SMT dialect implementation ------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/Dialect/SMT/IR/SMTAttributes.h"
+#include "mlir/Dialect/SMT/IR/SMTOps.h"
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+
+using namespace mlir;
+using namespace smt;
+
+void SMTDialect::initialize() {
+  registerAttributes();
+  registerTypes();
+  addOperations<
+#define GET_OP_LIST
+#include "mlir/Dialect/SMT/IR/SMT.cpp.inc"
+      >();
+}
+
+Operation *SMTDialect::materializeConstant(OpBuilder &builder, Attribute value,
+                                           Type type, Location loc) {
+  // BitVectorType constants can materialize into smt.bv.constant
+  if (auto bvType = dyn_cast<BitVectorType>(type)) {
+    if (auto attrValue = dyn_cast<BitVectorAttr>(value)) {
+      assert(bvType == attrValue.getType() &&
+             "attribute and desired result types have to match");
+      return builder.create<BVConstantOp>(loc, attrValue);
+    }
+  }
+
+  // BoolType constants can materialize into smt.constant
+  if (auto boolType = dyn_cast<BoolType>(type)) {
+    if (auto attrValue = dyn_cast<BoolAttr>(value))
+      return builder.create<BoolConstantOp>(loc, attrValue);
+  }
+
+  return nullptr;
+}
+
+#include "mlir/Dialect/SMT/IR/SMTDialect.cpp.inc"
+#include "mlir/Dialect/SMT/IR/SMTEnums.cpp.inc"
diff --git a/mlir/lib/Dialect/SMT/IR/SMTOps.cpp b/mlir/lib/Dialect/SMT/IR/SMTOps.cpp
new file mode 100644
index 0000000000000..8977a3abc125d
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/IR/SMTOps.cpp
@@ -0,0 +1,472 @@
+//===- SMTOps.cpp ---------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTOps.h"
+#include "mlir/IR/Builders.h"
+#include "mlir/IR/OpImplementation.h"
+#include "llvm/ADT/APSInt.h"
+
+using namespace mlir;
+using namespace smt;
+using namespace mlir;
+
+//===----------------------------------------------------------------------===//
+// BVConstantOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult BVConstantOp::inferReturnTypes(
+    mlir::MLIRContext *context, std::optional<mlir::Location> location,
+    ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
+    ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
+    ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
+  inferredReturnTypes.push_back(
+      properties.as<Properties *>()->getValue().getType());
+  return success();
+}
+
+void BVConstantOp::getAsmResultNames(
+    function_ref<void(Value, StringRef)> setNameFn) {
+  SmallVector<char, 128> specialNameBuffer;
+  llvm::raw_svector_ostream specialName(specialNameBuffer);
+  specialName << "c" << getValue().getValue() << "_bv"
+              << getValue().getValue().getBitWidth();
+  setNameFn(getResult(), specialName.str());
+}
+
+OpFoldResult BVConstantOp::fold(FoldAdaptor adaptor) {
+  assert(adaptor.getOperands().empty() && "constant has no operands");
+  return getValueAttr();
+}
+
+//===----------------------------------------------------------------------===//
+// DeclareFunOp
+//===----------------------------------------------------------------------===//
+
+void DeclareFunOp::getAsmResultNames(
+    function_ref<void(Value, StringRef)> setNameFn) {
+  setNameFn(getResult(), getNamePrefix().has_value() ? *getNamePrefix() : "");
+}
+
+//===----------------------------------------------------------------------===//
+// SolverOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult SolverOp::verifyRegions() {
+  if (getBody()->getTerminator()->getOperands().getTypes() != getResultTypes())
+    return emitOpError() << "types of yielded values must match return values";
+  if (getBody()->getArgumentTypes() != getInputs().getTypes())
+    return emitOpError()
+           << "block argument types must match the types of the 'inputs'";
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// CheckOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult CheckOp::verifyRegions() {
+  if (getSatRegion().front().getTerminator()->getOperands().getTypes() !=
+      getResultTypes())
+    return emitOpError() << "types of yielded values in 'sat' region must "
+                            "match return values";
+  if (getUnknownRegion().front().getTerminator()->getOperands().getTypes() !=
+      getResultTypes())
+    return emitOpError() << "types of yielded values in 'unknown' region must "
+                            "match return values";
+  if (getUnsatRegion().front().getTerminator()->getOperands().getTypes() !=
+      getResultTypes())
+    return emitOpError() << "types of yielded values in 'unsat' region must "
+                            "match return values";
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// EqOp
+//===----------------------------------------------------------------------===//
+
+static LogicalResult
+parseSameOperandTypeVariadicToBoolOp(OpAsmParser &parser,
+                                     OperationState &result) {
+  SmallVector<OpAsmParser::UnresolvedOperand, 4> inputs;
+  SMLoc loc = parser.getCurrentLocation();
+  Type type;
+
+  if (parser.parseOperandList(inputs) ||
+      parser.parseOptionalAttrDict(result.attributes) || parser.parseColon() ||
+      parser.parseType(type))
+    return failure();
+
+  result.addTypes(BoolType::get(parser.getContext()));
+  if (parser.resolveOperands(inputs, SmallVector<Type>(inputs.size(), type),
+                             loc, result.operands))
+    return failure();
+
+  return success();
+}
+
+ParseResult EqOp::parse(OpAsmParser &parser, OperationState &result) {
+  return parseSameOperandTypeVariadicToBoolOp(parser, result);
+}
+
+void EqOp::print(OpAsmPrinter &printer) {
+  printer << ' ' << getInputs();
+  printer.printOptionalAttrDict(getOperation()->getAttrs());
+  printer << " : " << getInputs().front().getType();
+}
+
+LogicalResult EqOp::verify() {
+  if (getInputs().size() < 2)
+    return emitOpError() << "'inputs' must have at least size 2, but got "
+                         << getInputs().size();
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// DistinctOp
+//===----------------------------------------------------------------------===//
+
+ParseResult DistinctOp::parse(OpAsmParser &parser, OperationState &result) {
+  return parseSameOperandTypeVariadicToBoolOp(parser, result);
+}
+
+void DistinctOp::print(OpAsmPrinter &printer) {
+  printer << ' ' << getInputs();
+  printer.printOptionalAttrDict(getOperation()->getAttrs());
+  printer << " : " << getInputs().front().getType();
+}
+
+LogicalResult DistinctOp::verify() {
+  if (getInputs().size() < 2)
+    return emitOpError() << "'inputs' must have at least size 2, but got "
+                         << getInputs().size();
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// ExtractOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult ExtractOp::verify() {
+  unsigned rangeWidth = getType().getWidth();
+  unsigned inputWidth = cast<BitVectorType>(getInput().getType()).getWidth();
+  if (getLowBit() + rangeWidth > inputWidth)
+    return emitOpError("range to be extracted is too big, expected range "
+                       "starting at index ")
+           << getLowBit() << " of length " << rangeWidth
+           << " requires input width of at least " << (getLowBit() + rangeWidth)
+           << ", but the input width is only " << inputWidth;
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// ConcatOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult ConcatOp::inferReturnTypes(
+    MLIRContext *context, std::optional<Location> location, ValueRange operands,
+    DictionaryAttr attributes, OpaqueProperties properties, RegionRange regions,
+    SmallVectorImpl<Type> &inferredReturnTypes) {
+  inferredReturnTypes.push_back(BitVectorType::get(
+      context, cast<BitVectorType>(operands[0].getType()).getWidth() +
+                   cast<BitVectorType>(operands[1].getType()).getWidth()));
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// RepeatOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult RepeatOp::verify() {
+  unsigned inputWidth = cast<BitVectorType>(getInput().getType()).getWidth();
+  unsigned resultWidth = getType().getWidth();
+  if (resultWidth % inputWidth != 0)
+    return emitOpError() << "result bit-vector width must be a multiple of the "
+                            "input bit-vector width";
+
+  return success();
+}
+
+unsigned RepeatOp::getCount() {
+  unsigned inputWidth = cast<BitVectorType>(getInput().getType()).getWidth();
+  unsigned resultWidth = getType().getWidth();
+  return resultWidth / inputWidth;
+}
+
+void RepeatOp::build(OpBuilder &builder, OperationState &state, unsigned count,
+                     Value input) {
+  unsigned inputWidth = cast<BitVectorType>(input.getType()).getWidth();
+  Type resultTy = BitVectorType::get(builder.getContext(), inputWidth * count);
+  build(builder, state, resultTy, input);
+}
+
+ParseResult RepeatOp::parse(OpAsmParser &parser, OperationState &result) {
+  OpAsmParser::UnresolvedOperand input;
+  Type inputType;
+  llvm::SMLoc countLoc = parser.getCurrentLocation();
+
+  APInt count;
+  if (parser.parseInteger(count) || parser.parseKeyword("times"))
+    return failure();
+
+  if (count.isNonPositive())
+    return parser.emitError(countLoc) << "integer must be positive";
+
+  llvm::SMLoc inputLoc = parser.getCurrentLocation();
+  if (parser.parseOperand(input) ||
+      parser.parseOptionalAttrDict(result.attributes) || parser.parseColon() ||
+      parser.parseType(inputType))
+    return failure();
+
+  if (parser.resolveOperand(input, inputType, result.operands))
+    return failure();
+
+  auto bvInputTy = dyn_cast<BitVectorType>(inputType);
+  if (!bvInputTy)
+    return parser.emitError(inputLoc) << "input must have bit-vector type";
+
+  // Make sure no assertions can trigger and no silent overflows can happen
+  // Bit-width is stored as 'int64_t' parameter in 'BitVectorType'
+  const unsigned maxBw = 63;
+  if (count.getActiveBits() > maxBw)
+    return parser.emitError(countLoc)
+           << "integer must fit into " << maxBw << " bits";
+
+  // Store multiplication in an APInt twice the size to not have any overflow
+  // and check if it can be truncated to 'maxBw' bits without cutting of
+  // important bits.
+  APInt resultBw = bvInputTy.getWidth() * count.zext(2 * maxBw);
+  if (resultBw.getActiveBits() > maxBw)
+    return parser.emitError(countLoc)
+           << "result bit-width (provided integer times bit-width of the input "
+              "type) must fit into "
+           << maxBw << " bits";
+
+  Type resultTy =
+      BitVectorType::get(parser.getContext(), resultBw.getZExtValue());
+  result.addTypes(resultTy);
+  return success();
+}
+
+void RepeatOp::print(OpAsmPrinter &printer) {
+  printer << " " << getCount() << " times " << getInput();
+  printer.printOptionalAttrDict((*this)->getAttrs());
+  printer << " : " << getInput().getType();
+}
+
+//===----------------------------------------------------------------------===//
+// BoolConstantOp
+//===----------------------------------------------------------------------===//
+
+void BoolConstantOp::getAsmResultNames(
+    function_ref<void(Value, StringRef)> setNameFn) {
+  setNameFn(getResult(), getValue() ? "true" : "false");
+}
+
+OpFoldResult BoolConstantOp::fold(FoldAdaptor adaptor) {
+  assert(adaptor.getOperands().empty() && "constant has no operands");
+  return getValueAttr();
+}
+
+//===----------------------------------------------------------------------===//
+// IntConstantOp
+//===----------------------------------------------------------------------===//
+
+void IntConstantOp::getAsmResultNames(
+    function_ref<void(Value, StringRef)> setNameFn) {
+  SmallVector<char, 32> specialNameBuffer;
+  llvm::raw_svector_ostream specialName(specialNameBuffer);
+  specialName << "c" << getValue();
+  setNameFn(getResult(), specialName.str());
+}
+
+OpFoldResult IntConstantOp::fold(FoldAdaptor adaptor) {
+  assert(adaptor.getOperands().empty() && "constant has no operands");
+  return getValueAttr();
+}
+
+void IntConstantOp::print(OpAsmPrinter &p) {
+  p << " " << getValue();
+  p.printOptionalAttrDict((*this)->getAttrs(), /*elidedAttrs=*/{"value"});
+}
+
+ParseResult IntConstantOp::parse(OpAsmParser &parser, OperationState &result) {
+  APInt value;
+  if (parser.parseInteger(value))
+    return failure();
+
+  result.getOrAddProperties<Properties>().setValue(
+      IntegerAttr::get(parser.getContext(), APSInt(value)));
+
+  if (parser.parseOptionalAttrDict(result.attributes))
+    return failure();
+
+  result.addTypes(smt::IntType::get(parser.getContext()));
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// ForallOp
+//===----------------------------------------------------------------------===//
+
+template <typename QuantifierOp>
+static LogicalResult verifyQuantifierRegions(QuantifierOp op) {
+  if (op.getBoundVarNames() &&
+      op.getBody().getNumArguments() != op.getBoundVarNames()->size())
+    return op.emitOpError(
+        "number of bound variable names must match number of block arguments");
+  if (!llvm::all_of(op.getBody().getArgumentTypes(), isAnyNonFuncSMTValueType))
+    return op.emitOpError()
+           << "bound variables must by any non-function SMT value";
+
+  if (op.getBody().front().getTerminator()->getNumOperands() != 1)
+    return op.emitOpError("must have exactly one yielded value");
+  if (!isa<BoolType>(
+          op.getBody().front().getTerminator()->getOperand(0).getType()))
+    return op.emitOpError("yielded value must be of '!smt.bool' type");
+
+  for (auto regionWithIndex : llvm::enumerate(op.getPatterns())) {
+    unsigned i = regionWithIndex.index();
+    Region &region = regionWithIndex.value();
+
+    if (op.getBody().getArgumentTypes() != region.getArgumentTypes())
+      return op.emitOpError()
+             << "block argument number and types of the 'body' "
+                "and 'patterns' region #"
+             << i << " must match";
+    if (region.front().getTerminator()->getNumOperands() < 1)
+      return op.emitOpError() << "'patterns' region #" << i
+                              << " must have at least one yielded value";
+
+    // All operations in the 'patterns' region must be SMT operations.
+    auto result = region.walk([&](Operation *childOp) {
+      if (!isa<SMTDialect>(childOp->getDialect())) {
+        auto diag = op.emitOpError()
+                    << "the 'patterns' region #" << i
+                    << " may only contain SMT dialect operations";
+        diag.attachNote(childOp->getLoc()) << "first non-SMT operation here";
+        return WalkResult::interrupt();
+      }
+
+      // There may be no quantifier (or other variable binding) operations in
+      // the 'patterns' region.
+      if (isa<ForallOp, ExistsOp>(childOp)) {
+        auto diag = op.emitOpError() << "the 'patterns' region #" << i
+                                     << " must not contain "
+                                        "any variable binding operations";
+        diag.attachNote(childOp->getLoc()) << "first violating operation here";
+        return WalkResult::interrupt();
+      }
+
+      return WalkResult::advance();
+    });
+    if (result.wasInterrupted())
+      return failure();
+  }
+
+  return success();
+}
+
+template <typename Properties>
+static void buildQuantifier(
+    OpBuilder &odsBuilder, OperationState &odsState, TypeRange boundVarTypes,
+    function_ref<Value(OpBuilder &, Location, ValueRange)> bodyBuilder,
+    std::optional<ArrayRef<StringRef>> boundVarNames,
+    function_ref<ValueRange(OpBuilder &, Location, ValueRange)> patternBuilder,
+    uint32_t weight, bool noPattern) {
+  odsState.addTypes(BoolType::get(odsBuilder.getContext()));
+  if (weight != 0)
+    odsState.getOrAddProperties<Properties>().weight =
+        odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), weight);
+  if (noPattern)
+    odsState.getOrAddProperties<Properties>().noPattern =
+        odsBuilder.getUnitAttr();
+  if (boundVarNames.has_value()) {
+    SmallVector<Attribute> boundVarNamesList;
+    for (StringRef str : *boundVarNames)
+      boundVarNamesList.emplace_back(odsBuilder.getStringAttr(str));
+    odsState.getOrAddProperties<Properties>().boundVarNames =
+        odsBuilder.getArrayAttr(boundVarNamesList);
+  }
+  {
+    OpBuilder::InsertionGuard guard(odsBuilder);
+    Region *region = odsState.addRegion();
+    Block *block = odsBuilder.createBlock(region);
+    block->addArguments(
+        boundVarTypes,
+        SmallVector<Location>(boundVarTypes.size(), odsState.location));
+    Value returnVal =
+        bodyBuilder(odsBuilder, odsState.location, block->getArguments());
+    odsBuilder.create<smt::YieldOp>(odsState.location, returnVal);
+  }
+  if (patternBuilder) {
+    Region *region = odsState.addRegion();
+    OpBuilder::InsertionGuard guard(odsBuilder);
+    Block *block = odsBuilder.createBlock(region);
+    block->addArguments(
+        boundVarTypes,
+        SmallVector<Location>(boundVarTypes.size(), odsState.location));
+    ValueRange returnVals =
+        patternBuilder(odsBuilder, odsState.location, block->getArguments());
+    odsBuilder.create<smt::YieldOp>(odsState.location, returnVals);
+  }
+}
+
+LogicalResult ForallOp::verify() {
+  if (!getPatterns().empty() && getNoPattern())
+    return emitOpError() << "patterns and the no_pattern attribute must not be "
+                            "specified at the same time";
+
+  return success();
+}
+
+LogicalResult ForallOp::verifyRegions() {
+  return verifyQuantifierRegions(*this);
+}
+
+void ForallOp::build(
+    OpBuilder &odsBuilder, OperationState &odsState, TypeRange boundVarTypes,
+    function_ref<Value(OpBuilder &, Location, ValueRange)> bodyBuilder,
+    std::optional<ArrayRef<StringRef>> boundVarNames,
+    function_ref<ValueRange(OpBuilder &, Location, ValueRange)> patternBuilder,
+    uint32_t weight, bool noPattern) {
+  buildQuantifier<Properties>(odsBuilder, odsState, boundVarTypes, bodyBuilder,
+                              boundVarNames, patternBuilder, weight, noPattern);
+}
+
+//===----------------------------------------------------------------------===//
+// ExistsOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult ExistsOp::verify() {
+  if (!getPatterns().empty() && getNoPattern())
+    return emitOpError() << "patterns and the no_pattern attribute must not be "
+                            "specified at the same time";
+
+  return success();
+}
+
+LogicalResult ExistsOp::verifyRegions() {
+  return verifyQuantifierRegions(*this);
+}
+
+void ExistsOp::build(
+    OpBuilder &odsBuilder, OperationState &odsState, TypeRange boundVarTypes,
+    function_ref<Value(OpBuilder &, Location, ValueRange)> bodyBuilder,
+    std::optional<ArrayRef<StringRef>> boundVarNames,
+    function_ref<ValueRange(OpBuilder &, Location, ValueRange)> patternBuilder,
+    uint32_t weight, bool noPattern) {
+  buildQuantifier<Properties>(odsBuilder, odsState, boundVarTypes, bodyBuilder,
+                              boundVarNames, patternBuilder, weight, noPattern);
+}
+
+#define GET_OP_CLASSES
+#include "mlir/Dialect/SMT/IR/SMT.cpp.inc"
diff --git a/mlir/lib/Dialect/SMT/IR/SMTTypes.cpp b/mlir/lib/Dialect/SMT/IR/SMTTypes.cpp
new file mode 100644
index 0000000000000..6188719bb1ab5
--- /dev/null
+++ b/mlir/lib/Dialect/SMT/IR/SMTTypes.cpp
@@ -0,0 +1,92 @@
+//===- SMTTypes.cpp -------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/IR/Builders.h"
+#include "mlir/IR/DialectImplementation.h"
+#include "llvm/ADT/TypeSwitch.h"
+
+using namespace mlir;
+using namespace smt;
+using namespace mlir;
+
+#define GET_TYPEDEF_CLASSES
+#include "mlir/Dialect/SMT/IR/SMTTypes.cpp.inc"
+
+void SMTDialect::registerTypes() {
+  addTypes<
+#define GET_TYPEDEF_LIST
+#include "mlir/Dialect/SMT/IR/SMTTypes.cpp.inc"
+      >();
+}
+
+bool smt::isAnyNonFuncSMTValueType(Type type) {
+  return isAnySMTValueType(type) && !isa<SMTFuncType>(type);
+}
+
+bool smt::isAnySMTValueType(Type type) {
+  return isa<BoolType, BitVectorType, ArrayType, IntType, SortType,
+             SMTFuncType>(type);
+}
+
+//===----------------------------------------------------------------------===//
+// BitVectorType
+//===----------------------------------------------------------------------===//
+
+LogicalResult
+BitVectorType::verify(function_ref<InFlightDiagnostic()> emitError,
+                      int64_t width) {
+  if (width <= 0U)
+    return emitError() << "bit-vector must have at least a width of one";
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// ArrayType
+//===----------------------------------------------------------------------===//
+
+LogicalResult ArrayType::verify(function_ref<InFlightDiagnostic()> emitError,
+                                Type domainType, Type rangeType) {
+  if (!isAnySMTValueType(domainType))
+    return emitError() << "domain must be any SMT value type";
+  if (!isAnySMTValueType(rangeType))
+    return emitError() << "range must be any SMT value type";
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// SMTFuncType
+//===----------------------------------------------------------------------===//
+
+LogicalResult SMTFuncType::verify(function_ref<InFlightDiagnostic()> emitError,
+                                  ArrayRef<Type> domainTypes, Type rangeType) {
+  if (domainTypes.empty())
+    return emitError() << "domain must not be empty";
+  if (!llvm::all_of(domainTypes, isAnyNonFuncSMTValueType))
+    return emitError() << "domain types must be any non-function SMT type";
+  if (!isAnyNonFuncSMTValueType(rangeType))
+    return emitError() << "range type must be any non-function SMT type";
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// SortType
+//===----------------------------------------------------------------------===//
+
+LogicalResult SortType::verify(function_ref<InFlightDiagnostic()> emitError,
+                               StringAttr identifier,
+                               ArrayRef<Type> sortParams) {
+  if (!llvm::all_of(sortParams, isAnyNonFuncSMTValueType))
+    return emitError()
+           << "sort parameter types must be any non-function SMT type";
+
+  return success();
+}
diff --git a/mlir/test/Dialect/SMT/array-errors.mlir b/mlir/test/Dialect/SMT/array-errors.mlir
new file mode 100644
index 0000000000000..4e90948eed848
--- /dev/null
+++ b/mlir/test/Dialect/SMT/array-errors.mlir
@@ -0,0 +1,13 @@
+// RUN: mlir-opt %s --split-input-file --verify-diagnostics
+
+// expected-error @below {{domain must be any SMT value type}}
+func.func @array_domain_no_smt_type(%arg0: !smt.array<[i32 -> !smt.bool]>) {
+  return
+}
+
+// -----
+
+// expected-error @below {{range must be any SMT value type}}
+func.func @array_range_no_smt_type(%arg0: !smt.array<[!smt.bool -> i32]>) {
+  return
+}
diff --git a/mlir/test/Dialect/SMT/array.mlir b/mlir/test/Dialect/SMT/array.mlir
new file mode 100644
index 0000000000000..bbfe58cac1bfa
--- /dev/null
+++ b/mlir/test/Dialect/SMT/array.mlir
@@ -0,0 +1,14 @@
+// RUN: mlir-opt %s --verify-roundtrip | FileCheck %s
+
+// CHECK-LABEL: func @arrayOperations
+// CHECK-SAME:  ([[A0:%.+]]: !smt.bool)
+func.func @arrayOperations(%arg0: !smt.bool) {
+  // CHECK-NEXT: [[V0:%.+]] = smt.array.broadcast [[A0]] {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+  %0 = smt.array.broadcast %arg0 {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+  // CHECK-NEXT: [[V1:%.+]] = smt.array.select [[V0]][[[A0]]] {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+  %1 = smt.array.select %0[%arg0] {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+  // CHECK-NEXT: [[V2:%.+]] = smt.array.store [[V0]][[[A0]]], [[A0]] {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+  %2 = smt.array.store %0[%arg0], %arg0 {smt.some_attr} : !smt.array<[!smt.bool -> !smt.bool]>
+
+  return
+}
diff --git a/mlir/test/Dialect/SMT/basic.mlir b/mlir/test/Dialect/SMT/basic.mlir
new file mode 100644
index 0000000000000..44bf0d6faa00d
--- /dev/null
+++ b/mlir/test/Dialect/SMT/basic.mlir
@@ -0,0 +1,200 @@
+// RUN: mlir-opt %s --verify-roundtrip | FileCheck %s
+
+// CHECK-LABEL: func @types
+// CHECK-SAME:  (%{{.*}}: !smt.bool, %{{.*}}: !smt.bv<32>, %{{.*}}: !smt.int, %{{.*}}: !smt.sort<"uninterpreted_sort">, %{{.*}}: !smt.sort<"uninterpreted_sort"[!smt.bool, !smt.int]>, %{{.*}}: !smt.func<(!smt.bool, !smt.bool) !smt.bool>)
+func.func @types(%arg0: !smt.bool, %arg1: !smt.bv<32>, %arg2: !smt.int, %arg3: !smt.sort<"uninterpreted_sort">, %arg4: !smt.sort<"uninterpreted_sort"[!smt.bool, !smt.int]>, %arg5: !smt.func<(!smt.bool, !smt.bool) !smt.bool>) {
+  return
+}
+
+func.func @core(%in: i8) {
+  // CHECK: %a = smt.declare_fun "a" {smt.some_attr} : !smt.bool
+  %a = smt.declare_fun "a" {smt.some_attr} : !smt.bool
+  // CHECK: smt.declare_fun {smt.some_attr} : !smt.bv<32>
+  %b = smt.declare_fun {smt.some_attr} : !smt.bv<32>
+  // CHECK: smt.declare_fun {smt.some_attr} : !smt.int
+  %c = smt.declare_fun {smt.some_attr} : !smt.int
+  // CHECK: smt.declare_fun {smt.some_attr} : !smt.sort<"uninterpreted_sort">
+  %d = smt.declare_fun {smt.some_attr} : !smt.sort<"uninterpreted_sort">
+  // CHECK: smt.declare_fun {smt.some_attr} : !smt.func<(!smt.int, !smt.bool) !smt.bool>
+  %e = smt.declare_fun {smt.some_attr} : !smt.func<(!smt.int, !smt.bool) !smt.bool>
+
+  // CHECK: smt.constant true {smt.some_attr}
+  %true = smt.constant true {smt.some_attr}
+  // CHECK: smt.constant false {smt.some_attr}
+  %false = smt.constant false {smt.some_attr}
+
+  // CHECK: smt.assert %a {smt.some_attr}
+  smt.assert %a {smt.some_attr}
+
+  // CHECK: smt.reset {smt.some_attr}
+  smt.reset {smt.some_attr}
+
+  // CHECK: smt.push 1 {smt.some_attr}
+  smt.push 1 {smt.some_attr}
+
+  // CHECK: smt.pop 1 {smt.some_attr}
+  smt.pop 1 {smt.some_attr}
+
+  // CHECK: %{{.*}} = smt.solver(%{{.*}}) {smt.some_attr} : (i8) -> (i8, i32) {
+  // CHECK: ^bb0(%{{.*}}: i8)
+  // CHECK:   %{{.*}} = smt.check {smt.some_attr} sat {
+  // CHECK:     smt.yield %{{.*}} : i32
+  // CHECK:   } unknown {
+  // CHECK:     smt.yield %{{.*}} : i32
+  // CHECK:   } unsat {
+  // CHECK:     smt.yield %{{.*}} : i32
+  // CHECK:   } -> i32
+  // CHECK:   smt.yield %{{.*}}, %{{.*}} : i8, i32
+  // CHECK: }
+  %0:2 = smt.solver(%in) {smt.some_attr} : (i8) -> (i8, i32) {
+  ^bb0(%arg0: i8):
+    %1 = smt.check {smt.some_attr} sat {
+      %c1_i32 = arith.constant 1 : i32
+      smt.yield %c1_i32 : i32
+    } unknown {
+      %c0_i32 = arith.constant 0 : i32
+      smt.yield %c0_i32 : i32
+    } unsat {
+      %c-1_i32 = arith.constant -1 : i32
+      smt.yield %c-1_i32 : i32
+    } -> i32
+    smt.yield %arg0, %1 : i8, i32
+  }
+
+  // CHECK: smt.solver() : () -> () {
+  // CHECK-NEXT: }
+  smt.solver() : () -> () { }
+
+  // CHECK: smt.solver() : () -> () {
+  // CHECK-NEXT: smt.set_logic "AUFLIA"
+  // CHECK-NEXT: }
+  smt.solver() : () -> () {
+    smt.set_logic "AUFLIA"
+  }
+
+  //      CHECK: smt.check sat {
+  // CHECK-NEXT: } unknown {
+  // CHECK-NEXT: } unsat {
+  // CHECK-NEXT: }
+  smt.check sat { } unknown { } unsat { }
+
+  // CHECK: %{{.*}} = smt.eq %{{.*}}, %{{.*}} {smt.some_attr} : !smt.bv<32>
+  %1 = smt.eq %b, %b {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.distinct %{{.*}}, %{{.*}} {smt.some_attr} : !smt.bv<32>
+  %2 = smt.distinct %b, %b {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.eq %{{.*}}, %{{.*}}, %{{.*}} : !smt.bool
+  %3 = smt.eq %a, %a, %a : !smt.bool
+  // CHECK: %{{.*}} = smt.distinct %{{.*}}, %{{.*}}, %{{.*}} : !smt.bool
+  %4 = smt.distinct %a, %a, %a : !smt.bool
+
+  // CHECK: %{{.*}} = smt.ite %{{.*}}, %{{.*}}, %{{.*}} {smt.some_attr} : !smt.bv<32>
+  %5 = smt.ite %a, %b, %b {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.not %{{.*}} {smt.some_attr}
+  %6 = smt.not %a {smt.some_attr}
+  // CHECK: %{{.*}} = smt.and %{{.*}}, %{{.*}}, %{{.*}} {smt.some_attr}
+  %7 = smt.and %a, %a, %a {smt.some_attr}
+  // CHECK: %{{.*}} = smt.or %{{.*}}, %{{.*}}, %{{.*}} {smt.some_attr}
+  %8 = smt.or %a, %a, %a {smt.some_attr}
+  // CHECK: %{{.*}} = smt.xor %{{.*}}, %{{.*}}, %{{.*}} {smt.some_attr}
+  %9 = smt.xor %a, %a, %a {smt.some_attr}
+  // CHECK: %{{.*}} = smt.implies %{{.*}}, %{{.*}} {smt.some_attr}
+  %10 = smt.implies %a, %a {smt.some_attr}
+
+  // CHECK: smt.apply_func %{{.*}}(%{{.*}}, %{{.*}}) {smt.some_attr} : !smt.func<(!smt.int, !smt.bool) !smt.bool>
+  %11 = smt.apply_func %e(%c, %a) {smt.some_attr} : !smt.func<(!smt.int, !smt.bool) !smt.bool>
+
+  return
+}
+
+// CHECK-LABEL: func @quantifiers
+func.func @quantifiers() {
+  // CHECK-NEXT: smt.forall ["a", "b"] weight 2 attributes {smt.some_attr} {
+  // CHECK-NEXT: ^bb0({{.*}}: !smt.bool, {{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.eq
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: } patterns {
+  // CHECK-NEXT: ^bb0(%{{.*}}: !smt.bool, %{{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }, {
+  // CHECK-NEXT: ^bb0(%{{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %0 = smt.forall ["a", "b"] weight 2 attributes {smt.some_attr} {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    %1 = smt.eq %arg2, %arg3 : !smt.bool
+    smt.yield %1 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }, {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }
+
+  // CHECK-NEXT: smt.forall ["a", "b"] no_pattern attributes {smt.some_attr} {
+  // CHECK-NEXT: ^bb0({{.*}}: !smt.bool, {{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.eq
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %1 = smt.forall ["a", "b"] no_pattern attributes {smt.some_attr} {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    %2 = smt.eq %arg2, %arg3 : !smt.bool
+    smt.yield %2 : !smt.bool
+  }
+
+  // CHECK-NEXT: smt.forall {
+  // CHECK-NEXT:   smt.constant
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %2 = smt.forall {
+    %3 = smt.constant true
+    smt.yield %3 : !smt.bool
+  }
+
+  // CHECK-NEXT: smt.exists ["a", "b"] weight 2 attributes {smt.some_attr} {
+  // CHECK-NEXT: ^bb0({{.*}}: !smt.bool, {{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.eq
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: } patterns {
+  // CHECK-NEXT: ^bb0(%{{.*}}: !smt.bool, %{{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }, {
+  // CHECK-NEXT: ^bb0(%{{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %3 = smt.exists ["a", "b"] weight 2 attributes {smt.some_attr} {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    %4 = smt.eq %arg2, %arg3 : !smt.bool
+    smt.yield %4 : !smt.bool {smt.some_attr}
+  } patterns {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }, {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }
+
+  // CHECK-NEXT: smt.exists no_pattern attributes {smt.some_attr} {
+  // CHECK-NEXT: ^bb0({{.*}}: !smt.bool, {{.*}}: !smt.bool):
+  // CHECK-NEXT:   smt.eq
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %4 = smt.exists no_pattern attributes {smt.some_attr} {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    %5 = smt.eq %arg2, %arg3 : !smt.bool
+    smt.yield %5 : !smt.bool {smt.some_attr}
+  }
+
+  // CHECK-NEXT: smt.exists [] {
+  // CHECK-NEXT:   smt.constant
+  // CHECK-NEXT:   smt.yield %{{.*}}
+  // CHECK-NEXT: }
+  %5 = smt.exists [] {
+    %6 = smt.constant true
+    smt.yield %6 : !smt.bool
+  }
+
+  return
+}
diff --git a/mlir/test/Dialect/SMT/bitvector-errors.mlir b/mlir/test/Dialect/SMT/bitvector-errors.mlir
new file mode 100644
index 0000000000000..58226f4d55f62
--- /dev/null
+++ b/mlir/test/Dialect/SMT/bitvector-errors.mlir
@@ -0,0 +1,112 @@
+// RUN: mlir-opt %s --split-input-file --verify-diagnostics
+
+// expected-error @below {{bit-vector must have at least a width of one}}
+func.func @at_least_size_one(%arg0: !smt.bv<0>) {
+  return
+}
+
+// -----
+
+// expected-error @below {{bit-vector must have at least a width of one}}
+func.func @positive_width(%arg0: !smt.bv<-1>) {
+  return
+}
+
+// -----
+
+func.func @attr_type_and_return_type_match() {
+  // expected-error @below {{inferred type(s) '!smt.bv<1>' are incompatible with return type(s) of operation '!smt.bv<32>'}}
+  // expected-error @below {{failed to infer returned types}}
+  %c0_bv32 = "smt.bv.constant"() <{value = #smt.bv<0> : !smt.bv<1>}> : () -> !smt.bv<32>
+  return
+}
+
+// -----
+
+func.func @invalid_bitvector_attr() {
+  // expected-error @below {{explicit bit-vector type required}}
+  smt.bv.constant #smt.bv<5>
+}
+
+// -----
+
+func.func @invalid_bitvector_attr() {
+  // expected-error @below {{integer value out of range for given bit-vector type}}
+  smt.bv.constant #smt.bv<32> : !smt.bv<2>
+}
+
+// -----
+
+func.func @invalid_bitvector_attr() {
+  // expected-error @below {{integer value out of range for given bit-vector type}}
+  smt.bv.constant #smt.bv<-4> : !smt.bv<2>
+}
+
+// -----
+
+func.func @extraction(%arg0: !smt.bv<32>) {
+  // expected-error @below {{range to be extracted is too big, expected range starting at index 20 of length 16 requires input width of at least 36, but the input width is only 32}}
+  smt.bv.extract %arg0 from 20 : (!smt.bv<32>) -> !smt.bv<16>
+  return
+}
+
+// -----
+
+func.func @concat(%arg0: !smt.bv<32>) {
+  // expected-error @below {{inferred type(s) '!smt.bv<64>' are incompatible with return type(s) of operation '!smt.bv<33>'}}
+  // expected-error @below {{failed to infer returned types}}
+  "smt.bv.concat"(%arg0, %arg0) {} : (!smt.bv<32>, !smt.bv<32>) -> !smt.bv<33>
+  return
+}
+
+// -----
+
+func.func @repeat_result_type_no_multiple_of_input_type(%arg0: !smt.bv<32>) {
+  // expected-error @below {{result bit-vector width must be a multiple of the input bit-vector width}}
+  "smt.bv.repeat"(%arg0) : (!smt.bv<32>) -> !smt.bv<65>
+  return
+}
+
+// -----
+
+func.func @repeat_negative_count(%arg0: !smt.bv<32>) {
+  // expected-error @below {{integer must be positive}}
+  smt.bv.repeat -2 times %arg0 : !smt.bv<32>
+  return
+}
+
+// -----
+
+// The parser has to extract the bit-width of the input and thus we need to
+// test that this is handled correctly in the parser, we cannot just rely on the
+// verifier.
+func.func @repeat_wrong_input_type(%arg0: !smt.bool) {
+  // expected-error @below {{input must have bit-vector type}}
+  smt.bv.repeat 2 times %arg0 : !smt.bool
+  return
+}
+
+// -----
+
+func.func @repeat_count_too_large(%arg0: !smt.bv<32>) {
+  // expected-error @below {{integer must fit into 63 bits}}
+  smt.bv.repeat 18446744073709551617 times %arg0 : !smt.bv<32>
+  return
+}
+
+// -----
+
+func.func @repeat_result_type_bitwidth_too_large(%arg0: !smt.bv<9223372036854775807>) {
+  // expected-error @below {{result bit-width (provided integer times bit-width of the input type) must fit into 63 bits}}
+  smt.bv.repeat 2 times %arg0 : !smt.bv<9223372036854775807>
+  return
+}
+
+// -----
+
+func.func @invalid_bv2int_signedness() {
+  %c5_bv32 = smt.bv.constant #smt.bv<5> : !smt.bv<32>
+  // expected-error @below {{expected ':'}}
+  %bv2int = smt.bv2int %c5_bv32 unsigned : !smt.bv<32>
+  return
+}
diff --git a/mlir/test/Dialect/SMT/bitvectors.mlir b/mlir/test/Dialect/SMT/bitvectors.mlir
new file mode 100644
index 0000000000000..c6b8fb097404b
--- /dev/null
+++ b/mlir/test/Dialect/SMT/bitvectors.mlir
@@ -0,0 +1,81 @@
+// RUN: mlir-opt %s --verify-roundtrip | FileCheck %s
+
+// CHECK-LABEL: func @bitvectors
+func.func @bitvectors() {
+  // CHECK: %c5_bv32 = smt.bv.constant #smt.bv<5> : !smt.bv<32> {smt.some_attr}
+  %c5_bv32 = smt.bv.constant #smt.bv<5> : !smt.bv<32> {smt.some_attr}
+  // CHECK: %c92_bv8 = smt.bv.constant #smt.bv<92> : !smt.bv<8> {smt.some_attr}
+  %c92_bv8 = smt.bv.constant #smt.bv<0x5c> : !smt.bv<8> {smt.some_attr}
+  // CHECK: %c-1_bv8 = smt.bv.constant #smt.bv<-1> : !smt.bv<8>
+  %c-1_bv8 = smt.bv.constant #smt.bv<-1> : !smt.bv<8>
+  // CHECK: %c-1_bv1{{(_[0-9]+)?}} = smt.bv.constant #smt.bv<-1> : !smt.bv<1>
+  %c-1_bv1_neg = smt.bv.constant #smt.bv<-1> : !smt.bv<1>
+  // CHECK: %c-1_bv1{{(_[0-9]+)?}} = smt.bv.constant #smt.bv<-1> : !smt.bv<1>
+  %c-1_bv1_pos = smt.bv.constant #smt.bv<1> : !smt.bv<1>
+
+  // CHECK: [[C0:%.+]] = smt.bv.constant #smt.bv<0> : !smt.bv<32>
+  %c = smt.bv.constant #smt.bv<0> : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.bv.neg [[C0]] {smt.some_attr} : !smt.bv<32>
+  %0 = smt.bv.neg %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.add [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %1 = smt.bv.add %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.mul [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %3 = smt.bv.mul %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.urem [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %4 = smt.bv.urem %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.srem [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %5 = smt.bv.srem %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.smod [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %7 = smt.bv.smod %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.shl [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %8 = smt.bv.shl %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.lshr [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %9 = smt.bv.lshr %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.ashr [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %10 = smt.bv.ashr %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.udiv [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %11 = smt.bv.udiv %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.sdiv [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %12 = smt.bv.sdiv %c, %c {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.bv.not [[C0]] {smt.some_attr} : !smt.bv<32>
+  %13 = smt.bv.not %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.and [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %14 = smt.bv.and %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.or [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %15 = smt.bv.or %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.xor [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %16 = smt.bv.xor %c, %c {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.bv.cmp slt [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %17 = smt.bv.cmp slt %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp sle [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %18 = smt.bv.cmp sle %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp sgt [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %19 = smt.bv.cmp sgt %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp sge [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %20 = smt.bv.cmp sge %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp ult [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %21 = smt.bv.cmp ult %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp ule [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %22 = smt.bv.cmp ule %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp ugt [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %23 = smt.bv.cmp ugt %c, %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.cmp uge [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>
+  %24 = smt.bv.cmp uge %c, %c {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.bv.concat [[C0]], [[C0]] {smt.some_attr} : !smt.bv<32>, !smt.bv<32>
+  %25 = smt.bv.concat %c, %c {smt.some_attr} : !smt.bv<32>, !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv.extract [[C0]] from 8 {smt.some_attr} : (!smt.bv<32>) -> !smt.bv<16>
+  %26 = smt.bv.extract %c from 8 {smt.some_attr} : (!smt.bv<32>) -> !smt.bv<16>
+  // CHECK: %{{.*}} = smt.bv.repeat 2 times [[C0]] {smt.some_attr} : !smt.bv<32>
+  %27 = smt.bv.repeat 2 times %c {smt.some_attr} : !smt.bv<32>
+
+  // CHECK: %{{.*}} = smt.bv2int [[C0]] {smt.some_attr} : !smt.bv<32>
+  %29 = smt.bv2int %c {smt.some_attr} : !smt.bv<32>
+  // CHECK: %{{.*}} = smt.bv2int [[C0]] signed {smt.some_attr} : !smt.bv<32>
+  %28 = smt.bv2int %c signed {smt.some_attr} : !smt.bv<32>
+
+  return
+}
diff --git a/mlir/test/Dialect/SMT/core-errors.mlir b/mlir/test/Dialect/SMT/core-errors.mlir
new file mode 100644
index 0000000000000..67bebda56b68e
--- /dev/null
+++ b/mlir/test/Dialect/SMT/core-errors.mlir
@@ -0,0 +1,497 @@
+// RUN: mlir-opt %s --split-input-file --verify-diagnostics
+
+func.func @solver_isolated_from_above(%arg0: !smt.bool) {
+  // expected-note @below {{required by region isolation constraints}}
+  smt.solver() : () -> () {
+    // expected-error @below {{using value defined outside the region}}
+    smt.assert %arg0
+  }
+  return
+}
+
+// -----
+
+func.func @no_smt_value_enters_solver(%arg0: !smt.bool) {
+  // expected-error @below {{operand #0 must be variadic of any non-smt type, but got '!smt.bool'}}
+  smt.solver(%arg0) : (!smt.bool) -> () {
+  ^bb0(%arg1: !smt.bool):
+    smt.assert %arg1
+  }
+  return
+}
+
+// -----
+
+func.func @no_smt_value_exits_solver() {
+  // expected-error @below {{result #0 must be variadic of any non-smt type, but got '!smt.bool'}}
+  %0 = smt.solver() : () -> !smt.bool {
+    %a = smt.declare_fun "a" : !smt.bool
+    smt.yield %a : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @block_args_and_inputs_match() {
+  // expected-error @below {{block argument types must match the types of the 'inputs'}}
+  smt.solver() : () -> () {
+    ^bb0(%arg0: i32):
+  }
+  return
+}
+
+// -----
+
+func.func @solver_yield_operands_and_results_match() {
+  // expected-error @below {{types of yielded values must match return values}}
+  smt.solver() : () -> () {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  }
+  return
+}
+
+// -----
+
+func.func @check_yield_operands_and_results_match() {
+  // expected-error @below {{types of yielded values in 'unsat' region must match return values}}
+  %0 = smt.check sat {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } unknown {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } unsat { } -> i32
+  return
+}
+
+// -----
+
+func.func @check_yield_operands_and_results_match() {
+  // expected-error @below {{types of yielded values in 'unknown' region must match return values}}
+  %0 = smt.check sat {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } unknown {
+  } unsat {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } -> i32
+  return
+}
+
+// -----
+
+func.func @check_yield_operands_and_results_match() {
+  // expected-error @below {{types of yielded values in 'sat' region must match return values}}
+  %0 = smt.check sat {
+  } unknown {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } unsat {
+    %1 = arith.constant 0 : i32
+    smt.yield %1 : i32
+  } -> i32
+  return
+}
+
+// -----
+
+func.func @check_no_block_arguments() {
+  // expected-error @below {{region #0 should have no arguments}}
+  smt.check sat {
+  ^bb0(%arg0: i32):
+  } unknown {
+  } unsat {
+  }
+  return
+}
+
+// -----
+
+func.func @check_no_block_arguments() {
+  // expected-error @below {{region #1 should have no arguments}}
+  smt.check sat {
+  } unknown {
+  ^bb0(%arg0: i32):
+  } unsat {
+  }
+  return
+}
+
+// -----
+
+func.func @check_no_block_arguments() {
+  // expected-error @below {{region #2 should have no arguments}}
+  smt.check sat {
+  } unknown {
+  } unsat {
+  ^bb0(%arg0: i32):
+  }
+  return
+}
+
+// -----
+
+func.func @too_few_operands() {
+  // expected-error @below {{'inputs' must have at least size 2, but got 0}}
+  smt.eq : !smt.bool
+  return
+}
+
+// -----
+
+func.func @too_few_operands(%a: !smt.bool) {
+  // expected-error @below {{'inputs' must have at least size 2, but got 1}}
+  smt.distinct %a : !smt.bool
+  return
+}
+
+// -----
+
+func.func @ite_type_mismatch(%a: !smt.bool, %b: !smt.bv<32>) {
+  // expected-error @below {{failed to verify that all of {thenValue, elseValue, result} have same type}}
+  "smt.ite"(%a, %a, %b) {} : (!smt.bool, !smt.bool, !smt.bv<32>) -> !smt.bool
+  return
+}
+
+// -----
+
+func.func @forall_number_of_decl_names_must_match_num_args() {
+  // expected-error @below {{number of bound variable names must match number of block arguments}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    %2 = smt.eq %arg2, %arg3 : !smt.int
+    smt.yield %2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @exists_number_of_decl_names_must_match_num_args() {
+  // expected-error @below {{number of bound variable names must match number of block arguments}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    %2 = smt.eq %arg2, %arg3 : !smt.int
+    smt.yield %2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_yield_must_have_exactly_one_bool_value() {
+  // expected-error @below {{yielded value must be of '!smt.bool' type}}
+  %1 = smt.forall ["a", "b"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    %2 = smt.int.add %arg2, %arg3
+    smt.yield %2 : !smt.int
+  }
+  return
+}
+
+// -----
+
+func.func @forall_yield_must_have_exactly_one_bool_value() {
+  // expected-error @below {{must have exactly one yielded value}}
+  %1 = smt.forall ["a", "b"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @exists_yield_must_have_exactly_one_bool_value() {
+  // expected-error @below {{yielded value must be of '!smt.bool' type}}
+  %1 = smt.exists ["a", "b"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    %2 = smt.int.add %arg2, %arg3
+    smt.yield %2 : !smt.int
+  }
+  return
+}
+
+// -----
+
+func.func @exists_yield_must_have_exactly_one_bool_value() {
+  // expected-error @below {{must have exactly one yielded value}}
+  %1 = smt.exists ["a", "b"] {
+  ^bb0(%arg2: !smt.int, %arg3: !smt.int):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @exists_patterns_region_and_no_patterns_attr_are_mutually_exclusive() {
+  // expected-error @below {{patterns and the no_pattern attribute must not be specified at the same time}}
+  %1 = smt.exists ["a"] no_pattern {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_patterns_region_and_no_patterns_attr_are_mutually_exclusive() {
+  // expected-error @below {{patterns and the no_pattern attribute must not be specified at the same time}}
+  %1 = smt.forall ["a"] no_pattern {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @exists_patterns_region_num_args() {
+  // expected-error @below {{block argument number and types of the 'body' and 'patterns' region #0 must match}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_patterns_region_num_args() {
+  // expected-error @below {{block argument number and types of the 'body' and 'patterns' region #0 must match}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool, %arg3: !smt.bool):
+    smt.yield %arg2, %arg3 : !smt.bool, !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @exists_patterns_region_at_least_one_yielded_value() {
+  // expected-error @below {{'patterns' region #0 must have at least one yielded value}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @forall_patterns_region_at_least_one_yielded_value() {
+  // expected-error @below {{'patterns' region #0 must have at least one yielded value}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @exists_all_pattern_regions_tested() {
+  // expected-error @below {{'patterns' region #1 must have at least one yielded value}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  }, {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @forall_all_pattern_regions_tested() {
+  // expected-error @below {{'patterns' region #1 must have at least one yielded value}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  }, {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield
+  }
+  return
+}
+
+// -----
+
+func.func @exists_patterns_region_no_non_smt_operations() {
+  // expected-error @below {{'patterns' region #0 may only contain SMT dialect operations}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    // expected-note @below {{first non-SMT operation here}}
+    arith.constant 0 : i32
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_patterns_region_no_non_smt_operations() {
+  // expected-error @below {{'patterns' region #0 may only contain SMT dialect operations}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    // expected-note @below {{first non-SMT operation here}}
+    arith.constant 0 : i32
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @exists_patterns_region_no_var_binding_operations() {
+  // expected-error @below {{'patterns' region #0 must not contain any variable binding operations}}
+  %1 = smt.exists ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    // expected-note @below {{first violating operation here}}
+    smt.exists ["b"] {
+    ^bb0(%arg3: !smt.bool):
+      smt.yield %arg3 : !smt.bool
+    }
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_patterns_region_no_var_binding_operations() {
+  // expected-error @below {{'patterns' region #0 must not contain any variable binding operations}}
+  %1 = smt.forall ["a"] {
+  ^bb0(%arg2: !smt.bool):
+    smt.yield %arg2 : !smt.bool
+  } patterns {
+  ^bb0(%arg2: !smt.bool):
+    // expected-note @below {{first violating operation here}}
+    smt.forall ["b"] {
+    ^bb0(%arg3: !smt.bool):
+      smt.yield %arg3 : !smt.bool
+    }
+    smt.yield %arg2 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @exists_bound_variable_type_invalid() {
+  // expected-error @below {{bound variables must by any non-function SMT value}}
+  %1 = smt.exists ["a", "b"] {
+  ^bb0(%arg2: !smt.func<(!smt.int) !smt.int>, %arg3: !smt.bool):
+    smt.yield %arg3 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+func.func @forall_bound_variable_type_invalid() {
+  // expected-error @below {{bound variables must by any non-function SMT value}}
+  %1 = smt.forall ["a", "b"] {
+  ^bb0(%arg2: !smt.func<(!smt.int) !smt.int>, %arg3: !smt.bool):
+    smt.yield %arg3 : !smt.bool
+  }
+  return
+}
+
+// -----
+
+// expected-error @below {{domain types must be any non-function SMT type}}
+func.func @func_domain_no_smt_type(%arg0: !smt.func<(i32) !smt.bool>) {
+  return
+}
+
+// -----
+
+// expected-error @below {{range type must be any non-function SMT type}}
+func.func @func_range_no_smt_type(%arg0: !smt.func<(!smt.bool) i32>) {
+  return
+}
+
+// -----
+
+// expected-error @below {{range type must be any non-function SMT type}}
+func.func @func_range_no_smt_type(%arg0: !smt.func<(!smt.bool) !smt.func<(!smt.bool) !smt.bool>>) {
+  return
+}
+
+// -----
+
+func.func @func_range_no_smt_type(%arg0: !smt.func<(!smt.bool) !smt.bool>) {
+  // expected-error @below {{got 0 operands and 1 types}}
+  smt.apply_func %arg0() : !smt.func<(!smt.bool) !smt.bool>
+  return
+}
+
+// -----
+
+// expected-error @below {{sort parameter types must be any non-function SMT type}}
+func.func @sort_type_no_smt_type(%arg0: !smt.sort<"sortname"[i32]>) {
+  return
+}
+
+// -----
+
+func.func @negative_push() {
+  // expected-error @below {{smt.push' op attribute 'count' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative}}
+  smt.push -1
+  return
+}
+
+// -----
+
+func.func @negative_pop() {
+  // expected-error @below {{smt.pop' op attribute 'count' failed to satisfy constraint: 32-bit signless integer attribute whose value is non-negative}}
+  smt.pop -1
+  return
+}
+
+// -----
+
+func.func @set_logic_outside_solver() {
+  // expected-error @below {{'smt.set_logic' op expects parent op 'smt.solver'}}
+  smt.set_logic "AUFLIA"
+  return
+}
diff --git a/mlir/test/Dialect/SMT/cse-test.mlir b/mlir/test/Dialect/SMT/cse-test.mlir
new file mode 100644
index 0000000000000..ff254857f3b33
--- /dev/null
+++ b/mlir/test/Dialect/SMT/cse-test.mlir
@@ -0,0 +1,12 @@
+// RUN: mlir-opt %s --cse | FileCheck %s
+
+func.func @declare_const_cse(%in: i8) -> (!smt.bool, !smt.bool){
+  // CHECK: smt.declare_fun "a" : !smt.bool
+  %a = smt.declare_fun "a" : !smt.bool
+  // CHECK-NEXT: smt.declare_fun "a" : !smt.bool
+  %b = smt.declare_fun "a" : !smt.bool
+  // CHECK-NEXT: return
+  %c = smt.declare_fun "a" : !smt.bool
+
+  return %a, %b : !smt.bool, !smt.bool
+}
diff --git a/mlir/test/Dialect/SMT/integers.mlir b/mlir/test/Dialect/SMT/integers.mlir
new file mode 100644
index 0000000000000..8e1a355278eb0
--- /dev/null
+++ b/mlir/test/Dialect/SMT/integers.mlir
@@ -0,0 +1,36 @@
+// RUN: mlir-opt %s --verify-roundtrip | FileCheck %s
+
+// CHECK-LABEL: func @integer_operations
+func.func @integer_operations() {
+  // CHECK-NEXT: [[V0:%.+]] = smt.int.constant -123 {smt.some_attr}
+  %0 = smt.int.constant -123 {smt.some_attr}
+  // CHECK-NEXT: %c184467440737095516152 = smt.int.constant 184467440737095516152 {smt.some_attr}
+  %1 = smt.int.constant 184467440737095516152 {smt.some_attr}
+
+
+  // CHECK-NEXT: smt.int.add [[V0]], [[V0]], [[V0]] {smt.some_attr}
+  %2 = smt.int.add %0, %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.mul [[V0]], [[V0]], [[V0]] {smt.some_attr}
+  %3 = smt.int.mul %0, %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.sub [[V0]], [[V0]] {smt.some_attr}
+  %4 = smt.int.sub %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.div [[V0]], [[V0]] {smt.some_attr}
+  %5 = smt.int.div %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.mod [[V0]], [[V0]] {smt.some_attr}
+  %6 = smt.int.mod %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.abs [[V0]] {smt.some_attr}
+  %7 = smt.int.abs %0 {smt.some_attr}
+
+  // CHECK-NEXT: smt.int.cmp le [[V0]], [[V0]] {smt.some_attr}
+  %9 = smt.int.cmp le %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.cmp lt [[V0]], [[V0]] {smt.some_attr}
+  %10 = smt.int.cmp lt %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.cmp ge [[V0]], [[V0]] {smt.some_attr}
+  %11 = smt.int.cmp ge %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int.cmp gt [[V0]], [[V0]] {smt.some_attr}
+  %12 = smt.int.cmp gt %0, %0 {smt.some_attr}
+  // CHECK-NEXT: smt.int2bv [[V0]] {smt.some_attr} : !smt.bv<4>
+  %13 = smt.int2bv %0 {smt.some_attr} : !smt.bv<4>
+
+  return
+}
diff --git a/mlir/unittests/Dialect/CMakeLists.txt b/mlir/unittests/Dialect/CMakeLists.txt
index 73904ceabb710..a88dc98c034e4 100644
--- a/mlir/unittests/Dialect/CMakeLists.txt
+++ b/mlir/unittests/Dialect/CMakeLists.txt
@@ -16,5 +16,6 @@ add_subdirectory(Polynomial)
 add_subdirectory(SCF)
 add_subdirectory(SparseTensor)
 add_subdirectory(SPIRV)
+add_subdirectory(SMT)
 add_subdirectory(Transform)
 add_subdirectory(Utils)
diff --git a/mlir/unittests/Dialect/SMT/AttributeTest.cpp b/mlir/unittests/Dialect/SMT/AttributeTest.cpp
new file mode 100644
index 0000000000000..4b4aada36bed5
--- /dev/null
+++ b/mlir/unittests/Dialect/SMT/AttributeTest.cpp
@@ -0,0 +1,118 @@
+//===- AttributeTest.cpp - SMT attribute unit tests -----------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTAttributes.h"
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace smt;
+
+namespace {
+
+TEST(BitVectorAttrTest, MinBitWidth) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto attr = BitVectorAttr::getChecked(loc, &context, UINT64_C(0), 0U);
+  ASSERT_EQ(attr, BitVectorAttr());
+  context.getDiagEngine().registerHandler([&](Diagnostic &diag) {
+    ASSERT_EQ(diag.str(), "bit-width must be at least 1, but got 0");
+  });
+}
+
+TEST(BitVectorAttrTest, ParserAndPrinterCorrect) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+
+  auto attr = BitVectorAttr::get(&context, "#b1010");
+  ASSERT_EQ(attr.getValue(), APInt(4, 10));
+  ASSERT_EQ(attr.getType(), BitVectorType::get(&context, 4));
+
+  // A bit-width divisible by 4 is always printed in hex
+  attr = BitVectorAttr::get(&context, "#b01011010");
+  ASSERT_EQ(attr.getValueAsString(), "#x5a");
+
+  // A bit-width not divisible by 4 is always printed in binary
+  // Also, make sure leading zeros are printed
+  attr = BitVectorAttr::get(&context, "#b0101101");
+  ASSERT_EQ(attr.getValueAsString(), "#b0101101");
+
+  attr = BitVectorAttr::get(&context, "#x3c");
+  ASSERT_EQ(attr.getValueAsString(), "#x3c");
+
+  attr = BitVectorAttr::get(&context, "#x03c");
+  ASSERT_EQ(attr.getValueAsString(), "#x03c");
+}
+
+TEST(BitVectorAttrTest, ExpectedOneDigit) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto attr =
+      BitVectorAttr::getChecked(loc, &context, static_cast<StringRef>("#b"));
+  ASSERT_EQ(attr, BitVectorAttr());
+  context.getDiagEngine().registerHandler([&](Diagnostic &diag) {
+    ASSERT_EQ(diag.str(), "expected at least one digit");
+  });
+}
+
+TEST(BitVectorAttrTest, ExpectedBOrX) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto attr =
+      BitVectorAttr::getChecked(loc, &context, static_cast<StringRef>("#c0"));
+  ASSERT_EQ(attr, BitVectorAttr());
+  context.getDiagEngine().registerHandler([&](Diagnostic &diag) {
+    ASSERT_EQ(diag.str(), "expected either 'b' or 'x'");
+  });
+}
+
+TEST(BitVectorAttrTest, ExpectedHashtag) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto attr =
+      BitVectorAttr::getChecked(loc, &context, static_cast<StringRef>("b0"));
+  ASSERT_EQ(attr, BitVectorAttr());
+  context.getDiagEngine().registerHandler(
+      [&](Diagnostic &diag) { ASSERT_EQ(diag.str(), "expected '#'"); });
+}
+
+TEST(BitVectorAttrTest, OutOfRange) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto attr1 = BitVectorAttr::getChecked(loc, &context, UINT64_C(2), 1U);
+  auto attr63 =
+      BitVectorAttr::getChecked(loc, &context, UINT64_C(3) << 62, 63U);
+  ASSERT_EQ(attr1, BitVectorAttr());
+  ASSERT_EQ(attr63, BitVectorAttr());
+  context.getDiagEngine().registerHandler([&](Diagnostic &diag) {
+    ASSERT_EQ(diag.str(),
+              "value does not fit in a bit-vector of desired width");
+  });
+}
+
+TEST(BitVectorAttrTest, GetUInt64Max) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  auto attr64 = BitVectorAttr::get(&context, UINT64_MAX, 64);
+  auto attr65 = BitVectorAttr::get(&context, UINT64_MAX, 65);
+  ASSERT_EQ(attr64.getValue(), APInt::getAllOnes(64));
+  ASSERT_EQ(attr65.getValue(), APInt::getAllOnes(64).zext(65));
+}
+
+} // namespace
diff --git a/mlir/unittests/Dialect/SMT/CMakeLists.txt b/mlir/unittests/Dialect/SMT/CMakeLists.txt
new file mode 100644
index 0000000000000..a1331467febaa
--- /dev/null
+++ b/mlir/unittests/Dialect/SMT/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_mlir_unittest(MLIRSMTTests
+  AttributeTest.cpp
+  QuantifierTest.cpp
+  TypeTest.cpp
+)
+
+mlir_target_link_libraries(MLIRSMTTests
+  PRIVATE
+  MLIRSMT
+)
diff --git a/mlir/unittests/Dialect/SMT/QuantifierTest.cpp b/mlir/unittests/Dialect/SMT/QuantifierTest.cpp
new file mode 100644
index 0000000000000..7bb0c1808ca0a
--- /dev/null
+++ b/mlir/unittests/Dialect/SMT/QuantifierTest.cpp
@@ -0,0 +1,187 @@
+//===- QuantifierTest.cpp - SMT quantifier operation unit tests -----------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTOps.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace smt;
+
+namespace {
+
+//===----------------------------------------------------------------------===//
+// Test custom builders of ExistsOp
+//===----------------------------------------------------------------------===//
+
+TEST(QuantifierTest, ExistsBuilderWithPattern) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ExistsOp existsOp = builder.create<ExistsOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      std::nullopt,
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return boundVars;
+      },
+      /*weight=*/2);
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  existsOp.print(stream);
+
+  ASSERT_STREQ(
+      stream.str().str().c_str(),
+      "%0 = smt.exists weight 2 {\n^bb0(%arg0: !smt.bool, "
+      "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield %0 : "
+      "!smt.bool\n} patterns {\n^bb0(%arg0: !smt.bool, %arg1: !smt.bool):\n  "
+      "smt.yield %arg0, %arg1 : !smt.bool, !smt.bool\n}\n");
+}
+
+TEST(QuantifierTest, ExistsBuilderNoPattern) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ExistsOp existsOp = builder.create<ExistsOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      ArrayRef<StringRef>{"a", "b"}, nullptr, /*weight=*/0, /*noPattern=*/true);
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  existsOp.print(stream);
+
+  ASSERT_STREQ(stream.str().str().c_str(),
+               "%0 = smt.exists [\"a\", \"b\"] no_pattern {\n^bb0(%arg0: "
+               "!smt.bool, %arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  "
+               "smt.yield %0 : !smt.bool\n}\n");
+}
+
+TEST(QuantifierTest, ExistsBuilderDefault) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ExistsOp existsOp = builder.create<ExistsOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      ArrayRef<StringRef>{"a", "b"});
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  existsOp.print(stream);
+
+  ASSERT_STREQ(stream.str().str().c_str(),
+               "%0 = smt.exists [\"a\", \"b\"] {\n^bb0(%arg0: !smt.bool, "
+               "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield "
+               "%0 : !smt.bool\n}\n");
+}
+
+//===----------------------------------------------------------------------===//
+// Test custom builders of ForallOp
+//===----------------------------------------------------------------------===//
+
+TEST(QuantifierTest, ForallBuilderWithPattern) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ForallOp forallOp = builder.create<ForallOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      ArrayRef<StringRef>{"a", "b"},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return boundVars;
+      },
+      /*weight=*/2);
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  forallOp.print(stream);
+
+  ASSERT_STREQ(
+      stream.str().str().c_str(),
+      "%0 = smt.forall [\"a\", \"b\"] weight 2 {\n^bb0(%arg0: !smt.bool, "
+      "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield %0 : "
+      "!smt.bool\n} patterns {\n^bb0(%arg0: !smt.bool, %arg1: !smt.bool):\n  "
+      "smt.yield %arg0, %arg1 : !smt.bool, !smt.bool\n}\n");
+}
+
+TEST(QuantifierTest, ForallBuilderNoPattern) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ForallOp forallOp = builder.create<ForallOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      ArrayRef<StringRef>{"a", "b"}, nullptr, /*weight=*/0, /*noPattern=*/true);
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  forallOp.print(stream);
+
+  ASSERT_STREQ(stream.str().str().c_str(),
+               "%0 = smt.forall [\"a\", \"b\"] no_pattern {\n^bb0(%arg0: "
+               "!smt.bool, %arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  "
+               "smt.yield %0 : !smt.bool\n}\n");
+}
+
+TEST(QuantifierTest, ForallBuilderDefault) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  OpBuilder builder(&context);
+  auto boolTy = BoolType::get(&context);
+
+  ForallOp forallOp = builder.create<ForallOp>(
+      loc, TypeRange{boolTy, boolTy},
+      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
+        return builder.create<AndOp>(loc, boundVars);
+      },
+      std::nullopt);
+
+  SmallVector<char, 1024> buffer;
+  llvm::raw_svector_ostream stream(buffer);
+  forallOp.print(stream);
+
+  ASSERT_STREQ(stream.str().str().c_str(),
+               "%0 = smt.forall {\n^bb0(%arg0: !smt.bool, "
+               "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield "
+               "%0 : !smt.bool\n}\n");
+}
+
+} // namespace
diff --git a/mlir/unittests/Dialect/SMT/TypeTest.cpp b/mlir/unittests/Dialect/SMT/TypeTest.cpp
new file mode 100644
index 0000000000000..f3b06cd0f84e0
--- /dev/null
+++ b/mlir/unittests/Dialect/SMT/TypeTest.cpp
@@ -0,0 +1,31 @@
+//===- TypeTest.cpp - SMT type unit tests ---------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SMT/IR/SMTDialect.h"
+#include "mlir/Dialect/SMT/IR/SMTTypes.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace smt;
+
+namespace {
+
+TEST(SMTFuncTypeTest, NonEmptyDomain) {
+  MLIRContext context;
+  context.loadDialect<SMTDialect>();
+  Location loc(UnknownLoc::get(&context));
+
+  auto boolTy = BoolType::get(&context);
+  auto funcTy = SMTFuncType::getChecked(loc, ArrayRef<Type>{}, boolTy);
+  ASSERT_EQ(funcTy, Type());
+  context.getDiagEngine().registerHandler([&](Diagnostic &diag) {
+    ASSERT_STREQ(diag.str().c_str(), "domain must not be empty");
+  });
+}
+
+} // namespace

>From 93370c4ab3437432e488fac9e3a09b44dbe87449 Mon Sep 17 00:00:00 2001
From: Amr Hesham <amr96 at programmer.net>
Date: Fri, 11 Apr 2025 23:36:00 +0200
Subject: [PATCH 47/76] [CIR] Make LLVM & OGCG variables match the same pattern
 (#135427)

Follow-up patch to improve variable names in LLVM and OGCG in
https://github.com/llvm/llvm-project/pull/134536
---
 clang/test/CIR/CodeGen/array.cpp | 109 ++++++++++++++++---------------
 1 file changed, 55 insertions(+), 54 deletions(-)

diff --git a/clang/test/CIR/CodeGen/array.cpp b/clang/test/CIR/CodeGen/array.cpp
index 431164c797f76..5cda061cdbf12 100644
--- a/clang/test/CIR/CodeGen/array.cpp
+++ b/clang/test/CIR/CodeGen/array.cpp
@@ -94,26 +94,27 @@ void func() {
 // CIR" cir.store %[[TMP]], %[[INIT_2]] : !s32i, !cir.ptr<!s32i>
 
 // LLVM: define void @func()
-// LLVM-NEXT: %[[ARR_ALLOCA:.*]] = alloca [10 x i32], i64 1, align 16
+// LLVM-NEXT: %[[ARR:.*]] = alloca [10 x i32], i64 1, align 16
 // LLVM-NEXT: %[[INIT:.*]] = alloca i32, i64 1, align 4
 // LLVM-NEXT: %[[INIT_2:.*]] = alloca i32, i64 1, align 4
-// LLVM-NEXT: %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR_ALLOCA]], i32 0
+// LLVM-NEXT: %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR]], i32 0
 // LLVM-NEXT: %[[ELE_PTR:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i64 0
-// LLVM-NEXT: %[[TMP:.*]] = load i32, ptr %[[ELE_PTR]], align 4
-// LLVM-NEXT: store i32 %[[TMP]], ptr %[[INIT]], align 4
-// LLVM-NEXT: %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR_ALLOCA]], i32 0
+// LLVM-NEXT: %[[TMP_1:.*]] = load i32, ptr %[[ELE_PTR]], align 4
+// LLVM-NEXT: store i32 %[[TMP_1]], ptr %[[INIT]], align 4
+// LLVM-NEXT: %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR]], i32 0
 // LLVM-NEXT: %[[ELE_PTR:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i64 1
-// LLVM-NEXT: %[[TMP:.*]] = load i32, ptr %[[ELE_PTR]], align 4
-
-// OGCG: %arr = alloca [10 x i32], align 16
-// OGCG: %e = alloca i32, align 4
-// OGCG: %e2 = alloca i32, align 4
-// OGCG: %arrayidx = getelementptr inbounds [10 x i32], ptr %arr, i64 0, i64 0
-// OGCG: %0 = load i32, ptr %arrayidx, align 16
-// OGCG: store i32 %0, ptr %e, align 4
-// OGCG: %arrayidx1 = getelementptr inbounds [10 x i32], ptr %arr, i64 0, i64 1
-// OGCG: %1 = load i32, ptr %arrayidx1, align 4
-// OGCG: store i32 %1, ptr %e2, align 4
+// LLVM-NEXT: %[[TMP_2:.*]] = load i32, ptr %[[ELE_PTR]], align 4
+// LLVM-NEXT: store i32 %[[TMP_2]], ptr %[[INIT_2]], align 4
+
+// OGCG: %[[ARR:.*]] = alloca [10 x i32], align 16
+// OGCG: %[[INIT:.*]] = alloca i32, align 4
+// OGCG: %[[INIT_2:.*]] = alloca i32, align 4
+// OGCG: %[[ELE_PTR:.*]] = getelementptr inbounds [10 x i32], ptr %[[ARR]], i64 0, i64 0
+// OGCG: %[[TMP_1:.*]] = load i32, ptr %[[ELE_PTR]], align 16
+// OGCG: store i32 %[[TMP_1]], ptr %[[INIT]], align 4
+// OGCG: %[[ELE_PTR:.*]] = getelementptr inbounds [10 x i32], ptr %[[ARR]], i64 0, i64 1
+// OGCG: %[[TMP_2:.*]] = load i32, ptr %[[ELE_PTR]], align 4
+// OGCG: store i32 %[[TMP_2]], ptr %[[INIT_2]], align 4
 
 void func2() {
   int arr[2] = {5};
@@ -135,9 +136,9 @@ void func2() {
 // CIR: cir.store %[[ELE_1_PTR]], %[[ELE_ALLOCA]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
 
 // LLVM: define void @func2()
-// LLVM:  %[[ARR_ALLOCA:.*]] = alloca [2 x i32], i64 1, align 4
+// LLVM:  %[[ARR:.*]] = alloca [2 x i32], i64 1, align 4
 // LLVM:  %[[TMP:.*]] = alloca ptr, i64 1, align 8
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR]], i32 0
 // LLVM:  store i32 5, ptr %[[ARR_PTR]], align 4
 // LLVM:  %[[ELE_1_PTR:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i64 1
 // LLVM:  store ptr %[[ELE_1_PTR]], ptr %[[TMP]], align 8
@@ -146,8 +147,8 @@ void func2() {
 // LLVM:  %[[ELE_1:.*]] = getelementptr i32, ptr %[[TMP2]], i64 1
 // LLVM:  store ptr %[[ELE_1]], ptr %[[TMP]], align 8
 
-// OGCG: %arr = alloca [2 x i32], align 4
-// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arr, ptr align 4 @[[FUN2_ARR]], i64 8, i1 false)
+// OGCG: %[[ARR:.*]] = alloca [2 x i32], align 4
+// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[ARR]], ptr align 4 @[[FUN2_ARR]], i64 8, i1 false)
 
 void func3() {
   int arr[2] = {5, 6};
@@ -175,31 +176,31 @@ void func3() {
 // CIR: cir.store %[[ELE_TMP]], %[[INIT]] : !s32i, !cir.ptr<!s32i>
 
 // LLVM: define void @func3()
-// LLVM:  %[[ARR_ALLOCA:.*]] = alloca [2 x i32], i64 1, align 4
+// LLVM:  %[[ARR:.*]] = alloca [2 x i32], i64 1, align 4
 // LLVM:  %[[IDX:.*]] = alloca i32, i64 1, align 4
 // LLVM:  %[[INIT:.*]] = alloca i32, i64 1, align 4
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR]], i32 0
 // LLVM:  store i32 5, ptr %[[ARR_PTR]], align 4
 // LLVM:  %[[ELE_1_PTR:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i64 1
 // LLVM:  store i32 6, ptr %[[ELE_1_PTR]], align 4
 // LLVM:  store i32 1, ptr %[[IDX]], align 4
 // LLVM:  %[[TMP1:.*]] = load i32, ptr %[[IDX]], align 4
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr i32, ptr %[[ARR]], i32 0
 // LLVM:  %[[IDX_I64:.*]] = sext i32 %[[TMP1]] to i64
 // LLVM:  %[[ELE:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i64 %[[IDX_I64]]
 // LLVM:  %[[TMP2:.*]] = load i32, ptr %[[ELE]], align 4
 // LLVM:  store i32 %[[TMP2]], ptr %[[INIT]], align 4
 
-// OGCG:  %arr = alloca [2 x i32], align 4
-// OGCG:  %idx = alloca i32, align 4
-// OGCG:  %e = alloca i32, align 4
-// OGCG:  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arr, ptr align 4 @[[FUN3_ARR]], i64 8, i1 false)
-// OGCG:  store i32 1, ptr %idx, align 4
-// OGCG:  %0 = load i32, ptr %idx, align 4
-// OGCG:  %idxprom = sext i32 %0 to i64
-// OGCG:  %arrayidx = getelementptr inbounds [2 x i32], ptr %arr, i64 0, i64 %idxprom
-// OGCG:  %1 = load i32, ptr %arrayidx, align 4
-// OGCG:  store i32 %1, ptr %e, align 4
+// OGCG:  %[[ARR:.*]] = alloca [2 x i32], align 4
+// OGCG:  %[[IDX:.*]] = alloca i32, align 4
+// OGCG:  %[[INIT:.*]] = alloca i32, align 4
+// OGCG:  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[ARR]], ptr align 4 @[[FUN3_ARR]], i64 8, i1 false)
+// OGCG:  store i32 1, ptr %[[IDX]], align 4
+// OGCG:  %[[TMP:.*]] = load i32, ptr %[[IDX]], align 4
+// OGCG:  %[[IDX_I64:.*]] = sext i32 %[[TMP]] to i64
+// OGCG:  %[[ELE:.*]] = getelementptr inbounds [2 x i32], ptr %[[ARR]], i64 0, i64 %[[IDX_I64]]
+// OGCG:  %[[TMP_2:.*]] = load i32, ptr %[[ELE]], align 4
+// OGCG:  store i32 %[[TMP_2:.*]], ptr %[[INIT]], align 4
 
 void func4() {
   int arr[2][1] = {{5}, {6}};
@@ -227,28 +228,28 @@ void func4() {
 // CIR: cir.store %[[TMP]], %[[INIT]] : !s32i, !cir.ptr<!s32i>
 
 // LLVM: define void @func4()
-// LLVM:  %[[ARR_ALLOCA:.*]] = alloca [2 x [1 x i32]], i64 1, align 4
+// LLVM:  %[[ARR:.*]] = alloca [2 x [1 x i32]], i64 1, align 4
 // LLVM:  %[[INIT:.*]] = alloca i32, i64 1, align 4
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR]], i32 0
 // LLVM:  %[[ARR_0_0:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i32 0
 // LLVM:  store i32 5, ptr %[[ARR_0_0]], align 4
 // LLVM:  %[[ARR_1:.*]] = getelementptr [1 x i32], ptr %[[ARR_PTR]], i64 1
 // LLVM:  %[[ARR_1_0:.*]] = getelementptr i32, ptr %[[ARR_1]], i32 0
 // LLVM:  store i32 6, ptr %[[ARR_1_0]], align 4
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR]], i32 0
 // LLVM:  %[[ARR_1:.*]] = getelementptr [1 x i32], ptr %[[ARR_PTR]], i64 1
 // LLVM:  %[[ARR_1_0:.*]] = getelementptr i32, ptr %[[ARR_1]], i32 0
 // LLVM:  %[[ELE_PTR:.*]] = getelementptr i32, ptr %[[ARR_1_0]], i64 0
 // LLVM:  %[[TMP:.*]] = load i32, ptr %[[ELE_PTR]], align 4
 // LLVM:  store i32 %[[TMP]], ptr %[[INIT]], align 4
 
-// OGCG: %arr = alloca [2 x [1 x i32]], align 4
-// OGCG: %e = alloca i32, align 4
-// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arr, ptr align 4 @[[FUN4_ARR]], i64 8, i1 false)
-// OGCG: %arrayidx = getelementptr inbounds [2 x [1 x i32]], ptr %arr, i64 0, i64 1
-// OGCG: %arrayidx1 = getelementptr inbounds [1 x i32], ptr %arrayidx, i64 0, i64 0
-// OGCG: %0 = load i32, ptr %arrayidx1, align 4
-// OGCG: store i32 %0, ptr %e, align 4
+// OGCG: %[[ARR:.*]] = alloca [2 x [1 x i32]], align 4
+// OGCG: %[[INIT:.*]] = alloca i32, align 4
+// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[ARR]], ptr align 4 @[[FUN4_ARR]], i64 8, i1 false)
+// OGCG: %[[ARR_1:.*]] = getelementptr inbounds [2 x [1 x i32]], ptr %[[ARR]], i64 0, i64 1
+// OGCG: %[[ARR_1_0:.*]] = getelementptr inbounds [1 x i32], ptr %[[ARR_1]], i64 0, i64 0
+// OGCG: %[[TMP:.*]] = load i32, ptr %[[ARR_1_0]], align 4
+// OGCG: store i32 %[[TMP]], ptr %[[INIT]], align 4
 
 void func5() {
   int arr[2][1] = {{5}};
@@ -271,9 +272,9 @@ void func5() {
 // CIR: cir.store %10, %[[ARR_PTR]] : !cir.ptr<!cir.array<!s32i x 1>>, !cir.ptr<!cir.ptr<!cir.array<!s32i x 1>>>
 
 // LLVM: define void @func5()
-// LLVM:  %[[ARR_ALLOCA:.*]] = alloca [2 x [1 x i32]], i64 1, align 4
+// LLVM:  %[[ARR:.*]] = alloca [2 x [1 x i32]], i64 1, align 4
 // LLVM:  %[[TMP:.*]] = alloca ptr, i64 1, align 8
-// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR_ALLOCA]], i32 0
+// LLVM:  %[[ARR_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR]], i32 0
 // LLVM:  %[[ARR_0:.*]] = getelementptr i32, ptr %[[ARR_PTR]], i32 0
 // LLVM:  store i32 5, ptr %[[ARR_0]], align 4
 // LLVM:  %[[ARR_1:.*]] = getelementptr [1 x i32], ptr %[[ARR_PTR]], i64 1
@@ -283,8 +284,8 @@ void func5() {
 // LLVM:  %[[ARR_1_PTR:.*]] = getelementptr [1 x i32], ptr %[[ARR_1_VAL]], i64 1
 // LLVM:  store ptr %[[ARR_1_PTR]], ptr %[[TMP]], align 8
 
-// ORGC: %arr = alloca [2 x [1 x i32]], align 4
-// ORGC: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arr, ptr align 4 @[[FUN5_ARR]], i64 8, i1 false)
+// ORGC: %[[ARR:.*]] = alloca [2 x [1 x i32]], align 4
+// ORGC: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[ARR]], ptr align 4 @[[FUN5_ARR]], i64 8, i1 false)
 
 void func6() {
   int x = 4;
@@ -313,13 +314,13 @@ void func6() {
 // LLVM:  %[[ELE_1:.*]] = getelementptr i32, ptr %[[ELE_0]], i64 1
 // LLVM:  store i32 5, ptr %[[ELE_1]], align 4
 
-// OGCG:  %x = alloca i32, align 4
-// OGCG:  %arr = alloca [2 x i32], align 4
-// OGCG:  store i32 4, ptr %x, align 4
-// OGCG:  %0 = load i32, ptr %x, align 4
-// OGCG:  store i32 %0, ptr %arr, align 4
-// OGCG:  %arrayinit.element = getelementptr inbounds i32, ptr %arr, i64 1
-// OGCG:  store i32 5, ptr %arrayinit.element, align 4
+// OGCG:  %[[VAR:.*]] = alloca i32, align 4
+// OGCG:  %[[ARR:.*]] = alloca [2 x i32], align 4
+// OGCG:  store i32 4, ptr %[[VAR]], align 4
+// OGCG:  %[[ELE_0:.*]] = load i32, ptr %[[VAR]], align 4
+// OGCG:  store i32 %[[ELE_0]], ptr %[[ARR]], align 4
+// OGCG:  %[[ELE_1:.*]] = getelementptr inbounds i32, ptr %[[ARR]], i64 1
+// OGCG:  store i32 5, ptr %[[ELE_1:.*]], align 4
 
 void func7() {
   int* arr[1] = {};

>From 84ed81bc8a5359f33818c876e43f6450e98deb35 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Tue, 8 Apr 2025 20:29:56 -0400
Subject: [PATCH 48/76] [lldb] On Windows, silence warning when building with
 Clang ToT

Fixes:
```
[930/2017] Building CXX object tools\lldb\unittests\Thread\CMakeFiles\ThreadTests.dir\ThreadTest.cpp.obj
C:\git\llvm-project\lldb\unittests\Thread\ThreadTest.cpp(51,23): warning: cast from 'FARPROC' (aka 'long long (*)()') to 'SetThreadDescriptionFunctionPtr' (aka 'long (*)(void *, const wchar_t *)') converts to incompatible function type [-Wcast-function-type-mismatch]
   51 |       SetThreadName = reinterpret_cast<SetThreadDescriptionFunctionPtr>(
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |           ::GetProcAddress(hModule, "SetThreadDescription"));
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
```
---
 lldb/unittests/Thread/ThreadTest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/unittests/Thread/ThreadTest.cpp b/lldb/unittests/Thread/ThreadTest.cpp
index 542585969c07b..4e87b3eb435b2 100644
--- a/lldb/unittests/Thread/ThreadTest.cpp
+++ b/lldb/unittests/Thread/ThreadTest.cpp
@@ -49,7 +49,7 @@ class ThreadTest : public ::testing::Test {
     HMODULE hModule = ::LoadLibraryW(L"Kernel32.dll");
     if (hModule) {
       SetThreadName = reinterpret_cast<SetThreadDescriptionFunctionPtr>(
-          ::GetProcAddress(hModule, "SetThreadDescription"));
+          (void *)::GetProcAddress(hModule, "SetThreadDescription"));
     }
     PlatformWindows::Initialize();
 #endif

>From 12c4be1ba8513b4c0f43945c0f266d7f871a978a Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Fri, 11 Apr 2025 13:03:58 -0400
Subject: [PATCH 49/76] [clang][unittests] On Windows, silence warning when
 building with MSVC

Fixes:
```
[113/324] Building CXX object tools\clang\unittests\AST\ByteCode\CMakeFiles\InterpTests.dir\BitcastBuffer.cpp.obj
C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(52): warning C4309: 'initializing': truncation of constant value
C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(53): warning C4309: 'initializing': truncation of constant value
```
---
 clang/unittests/AST/ByteCode/BitcastBuffer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/unittests/AST/ByteCode/BitcastBuffer.cpp b/clang/unittests/AST/ByteCode/BitcastBuffer.cpp
index 02c38a2201363..f4abbcbb8e84f 100644
--- a/clang/unittests/AST/ByteCode/BitcastBuffer.cpp
+++ b/clang/unittests/AST/ByteCode/BitcastBuffer.cpp
@@ -49,8 +49,8 @@ TEST(BitcastBuffer, PushData) {
 
   BitcastBuffer Buff2(Bytes(sizeof(int)).toBits());
   {
-    short s1 = 0xCAFE;
-    short s2 = 0xBABE;
+    short s1 = (short)0xCAFE;
+    short s2 = (short)0xBABE;
     std::byte sdata[2];
 
     std::memcpy(sdata, &s1, sizeof(s1));

>From 78fbba992188c60f0f06267ca013e52db19b8c67 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Fri, 11 Apr 2025 13:05:33 -0400
Subject: [PATCH 50/76] [compiler-rt] On Windows, silence warning when building
 with Clang ToT

Fixes:
```
[6113/7139] Building CXX object projects\compiler-rt\lib\interception\CMakeFiles\RTInterception.x86_64.dir\interception_win.cpp.obj
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): note: insert 'FALLTHROUGH;' to silence this warning
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
      |     FALLTHROUGH;
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): note: insert 'break;' to avoid fall-through
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
      |     break;
1 warning generated.
```
---
 compiler-rt/lib/interception/interception_win.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index b2974cf1934fb..c9a77180014c4 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -743,6 +743,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
     case 0x058B:  // 8B 05 XX XX XX XX : mov eax, dword ptr [XX XX XX XX]
       if (rel_offset)
         *rel_offset = 2;
+      FALLTHROUGH;
     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
       return 6;
 

>From e1d91ba06d250dd8bbd5bded4824c5b210c2667a Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Fri, 11 Apr 2025 13:07:30 -0400
Subject: [PATCH 51/76] [lldb] Fix erroneous return value

Found when building with MSVC on Windows, was seeing:
```
[2703/7138] Building CXX object tools\lldb\source\Plugins\Process\Utility\CMakeFiles\lldbPluginProcessUtility.dir\NativeRegisterContextDBReg.cpp.obj
C:\git\llvm-project\lldb\source\Plugins\Process\Utility\NativeRegisterContextDBReg.cpp(286): warning C4305: 'return': truncation from 'unsigned int' to 'bool'
```
---
 .../Plugins/Process/Utility/NativeRegisterContextDBReg.cpp      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.cpp b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.cpp
index 1e0c1a5db09ca..19601b7f35d47 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.cpp
+++ b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.cpp
@@ -283,7 +283,7 @@ bool NativeRegisterContextDBReg::ClearHardwareWatchpoint(uint32_t wp_index) {
     LLDB_LOG_ERROR(
         log, std::move(error),
         "unable to set watchpoint: failed to read debug registers: {0}");
-    return LLDB_INVALID_INDEX32;
+    return false;
   }
 
   if (wp_index >= m_max_hwp_supported)

>From 715c61e9a7cc631fd0965b887941ccfd8c0133d6 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Fri, 11 Apr 2025 13:08:49 -0400
Subject: [PATCH 52/76] [lldb][lldbp-dap] On Windoows, silence warnings when
 building with MSVC

Fixes:
```
[6373/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\DAP.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\DAP.cpp(725) : warning C4715: '`lldb_dap::DAP::HandleObject'::`30'::<lambda_2>::operator()': not all control paths return a value
[6421/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\Protocol\ProtocolTypes.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(203) : warning C4715: 'lldb_dap::protocol::ToString': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(98) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(72) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(111) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
[6426/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\Protocol\ProtocolBase.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolBase.cpp(287) : warning C4715: 'lldb_dap::protocol::fromJSON': not all control paths return a value
```
---
 lldb/tools/lldb-dap/DAP.cpp                    | 1 +
 lldb/tools/lldb-dap/Protocol/ProtocolBase.cpp  | 1 +
 lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp | 4 ++++
 3 files changed, 6 insertions(+)

diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index 9361ba968e9c2..1f49d70ab3ac2 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -722,6 +722,7 @@ bool DAP::HandleObject(const protocol::Message &M) {
                              case protocol::eResponseMessageNotStopped:
                                return "notStopped";
                              }
+                             llvm_unreachable("unknown response message kind.");
                            }),
                        *resp->message);
       }
diff --git a/lldb/tools/lldb-dap/Protocol/ProtocolBase.cpp b/lldb/tools/lldb-dap/Protocol/ProtocolBase.cpp
index 87fd0df018b65..af63cc803e545 100644
--- a/lldb/tools/lldb-dap/Protocol/ProtocolBase.cpp
+++ b/lldb/tools/lldb-dap/Protocol/ProtocolBase.cpp
@@ -284,6 +284,7 @@ bool fromJSON(const json::Value &Params, Message &PM, json::Path P) {
     PM = std::move(evt);
     return true;
   }
+  llvm_unreachable("unhandled message type request.");
 }
 
 json::Value toJSON(const Message &M) {
diff --git a/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp b/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
index d1dd9ad9c5fee..f4f0bf8dcea84 100644
--- a/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
+++ b/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
@@ -69,6 +69,7 @@ json::Value toJSON(const ColumnType &T) {
   case eColumnTypeTimestamp:
     return "unixTimestampUTC";
   }
+  llvm_unreachable("unhandled column type.");
 }
 
 json::Value toJSON(const ColumnDescriptor &CD) {
@@ -95,6 +96,7 @@ json::Value toJSON(const ChecksumAlgorithm &CA) {
   case eChecksumAlgorithmTimestamp:
     return "timestamp";
   }
+  llvm_unreachable("unhandled checksum algorithm.");
 }
 
 json::Value toJSON(const BreakpointModeApplicability &BMA) {
@@ -108,6 +110,7 @@ json::Value toJSON(const BreakpointModeApplicability &BMA) {
   case eBreakpointModeApplicabilityInstruction:
     return "instruction";
   }
+  llvm_unreachable("unhandled breakpoint mode applicability.");
 }
 
 json::Value toJSON(const BreakpointMode &BM) {
@@ -200,6 +203,7 @@ static llvm::StringLiteral ToString(AdapterFeature feature) {
   case eAdapterFeatureTerminateDebuggee:
     return "supportTerminateDebuggee";
   }
+  llvm_unreachable("unhandled adapter feature.");
 }
 
 json::Value toJSON(const Capabilities &C) {

>From 46135ade9ec0b7fd975b5d3923aea95f4d416296 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <alex_toresh at yahoo.fr>
Date: Fri, 11 Apr 2025 13:22:04 -0400
Subject: [PATCH 53/76] [Sema] On Windows, silence erroneous warning when
 building with MSVC

Fixes what seems to be a buggy warning in MSVC:
```
[1/37] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaConcept.cpp.obj
C:\git\llvm-project\clang\lib\Sema\SemaConcept.cpp(1933): warning C4101: '$S26': unreferenced local variable
```
---
 clang/lib/Sema/SemaConcept.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 011a6d072d35c..73bc8731af57d 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1929,11 +1929,11 @@ auto SubsumptionChecker::find(AtomicConstraint *Ori) -> Literal {
   }
   auto It = Elems.find(ID);
   if (It == Elems.end()) {
-    It =
-        Elems
-            .insert({ID, MappedAtomicConstraint{Ori, Literal{getNewLiteralId(),
-                                                             Literal::Atomic}}})
-            .first;
+    It = Elems
+             .insert({ID,
+                      MappedAtomicConstraint{
+                          Ori, {getNewLiteralId(), Literal::Atomic}}})
+             .first;
     ReverseMap[It->second.ID.Value] = Ori;
   }
   return It->getSecond().ID;

>From 6e7fe85247301c52d10d234b87f13376e091c77e Mon Sep 17 00:00:00 2001
From: Jeffrey Byrnes <jeffrey.byrnes at amd.com>
Date: Fri, 11 Apr 2025 15:34:49 -0700
Subject: [PATCH 54/76] [AMDGPU] Teach iterative schedulers about IGLP
 (#134953)

This adds IGLP mutation to the iterative schedulers
(`gcn-iterative-max-occupancy-experimental`, `gcn-iterative-minreg`, and
`gcn-iterative-ilp`).

The `gcn-iterative-minreg` and `gcn-iterative-ilp` schedulers never
actually applied the mutations added, so this also has the effect of
teaching them about mutations in general. The
`gcn-iterative-max-occupancy-experimental` scheduler has calls to
`ScheduleDAGMILive::schedule()`, so, before this, mutations were applied
at this point. Now this is done during calls to `BuildDAG`, with IGLP
superseding other mutations (similar to the other schedulers). We may
end up scheduling regions multiple times, with mutations being applied
each time, so we need to track for
`AMDGPU::SchedulingPhase::PreRAReentry`
---
 .../lib/Target/AMDGPU/AMDGPUTargetMachine.cpp |   8 +-
 .../Target/AMDGPU/GCNIterativeScheduler.cpp   |  49 +-
 .../lib/Target/AMDGPU/GCNIterativeScheduler.h |   3 +
 llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp   |  14 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.h          |   6 +
 llvm/test/CodeGen/AMDGPU/iglp.opt.reentry.ll  |   2 +
 ...vm.amdgcn.sched.group.barrier.iterative.ll | 933 ++++++++++++++++++
 .../AMDGPU/schedule-regpressure-limit2.ll     |  16 +-
 8 files changed, 1005 insertions(+), 26 deletions(-)
 create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sched.group.barrier.iterative.ll

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index e06d5a08e06a5..8f3138acaea0d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -616,12 +616,15 @@ createIterativeGCNMaxOccupancyMachineScheduler(MachineSchedContext *C) {
   DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI));
   if (ST.shouldClusterStores())
     DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
+  DAG->addMutation(createIGroupLPDAGMutation(AMDGPU::SchedulingPhase::Initial));
   return DAG;
 }
 
 static ScheduleDAGInstrs *createMinRegScheduler(MachineSchedContext *C) {
-  return new GCNIterativeScheduler(C,
-    GCNIterativeScheduler::SCHEDULE_MINREGFORCED);
+  auto *DAG = new GCNIterativeScheduler(
+      C, GCNIterativeScheduler::SCHEDULE_MINREGFORCED);
+  DAG->addMutation(createIGroupLPDAGMutation(AMDGPU::SchedulingPhase::Initial));
+  return DAG;
 }
 
 static ScheduleDAGInstrs *
@@ -632,6 +635,7 @@ createIterativeILPMachineScheduler(MachineSchedContext *C) {
   if (ST.shouldClusterStores())
     DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
   DAG->addMutation(createAMDGPUMacroFusionDAGMutation());
+  DAG->addMutation(createIGroupLPDAGMutation(AMDGPU::SchedulingPhase::Initial));
   return DAG;
 }
 
diff --git a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
index da065e8d8cb6b..19cdfc01c02c4 100644
--- a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "GCNIterativeScheduler.h"
+#include "AMDGPUIGroupLP.h"
 #include "GCNSchedStrategy.h"
 #include "SIMachineFunctionInfo.h"
 
@@ -118,6 +119,26 @@ void GCNIterativeScheduler::printSchedRP(raw_ostream &OS,
 }
 #endif
 
+void GCNIterativeScheduler::swapIGLPMutations(const Region &R, bool IsReentry) {
+  bool HasIGLPInstrs = false;
+  const SIInstrInfo *SII = static_cast<const SIInstrInfo *>(TII);
+  for (MachineBasicBlock::iterator I = R.Begin; I != R.End; I++) {
+    if (SII->isIGLPMutationOnly(I->getOpcode())) {
+      HasIGLPInstrs = true;
+      break;
+    }
+  }
+
+  if (HasIGLPInstrs) {
+    SavedMutations.clear();
+    SavedMutations.swap(Mutations);
+    auto SchedPhase = IsReentry ? AMDGPU::SchedulingPhase::PreRAReentry
+                                : AMDGPU::SchedulingPhase::Initial;
+
+    addMutation(createIGroupLPDAGMutation(SchedPhase));
+  }
+}
+
 // DAG builder helper
 class GCNIterativeScheduler::BuildDAG {
   GCNIterativeScheduler &Sch;
@@ -125,14 +146,15 @@ class GCNIterativeScheduler::BuildDAG {
 
   SmallVector<SUnit*, 8> BotRoots;
 public:
-  BuildDAG(const Region &R, GCNIterativeScheduler &_Sch)
-    : Sch(_Sch) {
+  BuildDAG(const Region &R, GCNIterativeScheduler &_Sch, bool IsReentry = false)
+      : Sch(_Sch) {
     auto *BB = R.Begin->getParent();
     Sch.BaseClass::startBlock(BB);
     Sch.BaseClass::enterRegion(BB, R.Begin, R.End, R.NumRegionInstrs);
-
+    Sch.swapIGLPMutations(R, IsReentry);
     Sch.buildSchedGraph(Sch.AA, nullptr, nullptr, nullptr,
                         /*TrackLaneMask*/true);
+    Sch.postProcessDAG();
     Sch.Topo.InitDAGTopologicalSorting();
     Sch.findRootsAndBiasEdges(TopRoots, BotRoots);
   }
@@ -432,13 +454,15 @@ unsigned GCNIterativeScheduler::tryMaximizeOccupancy(unsigned TargetOcc) {
 
   auto NewOcc = TargetOcc;
   for (auto *R : Regions) {
+    // Always build the DAG to add mutations
+    BuildDAG DAG(*R, *this);
+
     if (R->MaxPressure.getOccupancy(ST) >= NewOcc)
-      break;
+      continue;
 
     LLVM_DEBUG(printRegion(dbgs(), R->Begin, R->End, LIS, 3);
                printLivenessInfo(dbgs(), R->Begin, R->End, LIS));
 
-    BuildDAG DAG(*R, *this);
     const auto MinSchedule = makeMinRegSchedule(DAG.getTopRoots(), *this);
     const auto MaxRP = getSchedulePressure(*R, MinSchedule);
     LLVM_DEBUG(dbgs() << "Occupancy improvement attempt:\n";
@@ -469,8 +493,11 @@ void GCNIterativeScheduler::scheduleLegacyMaxOccupancy(
   sortRegionsByPressure(TgtOcc);
   auto Occ = Regions.front()->MaxPressure.getOccupancy(ST);
 
-  if (TryMaximizeOccupancy && Occ < TgtOcc)
+  bool IsReentry = false;
+  if (TryMaximizeOccupancy && Occ < TgtOcc) {
     Occ = tryMaximizeOccupancy(TgtOcc);
+    IsReentry = true;
+  }
 
   // This is really weird but for some magic scheduling regions twice
   // gives performance improvement
@@ -489,7 +516,8 @@ void GCNIterativeScheduler::scheduleLegacyMaxOccupancy(
     LStrgy.setTargetOccupancy(I == 0 ? 0 : TgtOcc);
     for (auto *R : Regions) {
       OverrideLegacyStrategy Ovr(*R, LStrgy, *this);
-
+      IsReentry |= I > 0;
+      swapIGLPMutations(*R, IsReentry);
       Ovr.schedule();
       const auto RP = getRegionPressure(*R);
       LLVM_DEBUG(printSchedRP(dbgs(), R->MaxPressure, RP));
@@ -556,8 +584,11 @@ void GCNIterativeScheduler::scheduleILP(
   sortRegionsByPressure(TgtOcc);
   auto Occ = Regions.front()->MaxPressure.getOccupancy(ST);
 
-  if (TryMaximizeOccupancy && Occ < TgtOcc)
+  bool IsReentry = false;
+  if (TryMaximizeOccupancy && Occ < TgtOcc) {
     Occ = tryMaximizeOccupancy(TgtOcc);
+    IsReentry = true;
+  }
 
   TgtOcc = std::min(Occ, TgtOcc);
   LLVM_DEBUG(dbgs() << "Scheduling using default scheduler, "
@@ -566,7 +597,7 @@ void GCNIterativeScheduler::scheduleILP(
 
   unsigned FinalOccupancy = std::min(Occ, MFI->getOccupancy());
   for (auto *R : Regions) {
-    BuildDAG DAG(*R, *this);
+    BuildDAG DAG(*R, *this, IsReentry);
     const auto ILPSchedule = makeGCNILPScheduler(DAG.getBottomRoots(), *this);
 
     const auto RP = getSchedulePressure(*R, ILPSchedule);
diff --git a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.h b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.h
index c0228540b7a2f..f731b1fc7e0df 100644
--- a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.h
+++ b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.h
@@ -77,6 +77,8 @@ class GCNIterativeScheduler : public ScheduleDAGMILive {
   const StrategyKind Strategy;
   mutable GCNUpwardRPTracker UPTracker;
 
+  std::vector<std::unique_ptr<ScheduleDAGMutation>> SavedMutations;
+
   class BuildDAG;
   class OverrideLegacyStrategy;
 
@@ -91,6 +93,7 @@ class GCNIterativeScheduler : public ScheduleDAGMILive {
     return getRegionPressure(R.Begin, R.End);
   }
 
+  void swapIGLPMutations(const Region &R, bool IsReentry);
   void setBestSchedule(Region &R,
                        ScheduleRef Schedule,
                        const GCNRegPressure &MaxRP = GCNRegPressure());
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
index ea9bc88bbe86b..5678512748569 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -188,12 +188,6 @@ static void getRegisterPressures(
   Pressure[AMDGPU::RegisterPressureSets::AGPR_32] = NewPressure.getAGPRNum();
 }
 
-// Return true if the instruction is mutually exclusive with all non-IGLP DAG
-// mutations, requiring all other mutations to be disabled.
-static bool isIGLPMutationOnly(unsigned Opcode) {
-  return Opcode == AMDGPU::SCHED_GROUP_BARRIER || Opcode == AMDGPU::IGLP_OPT;
-}
-
 void GCNSchedStrategy::initCandidate(SchedCandidate &Cand, SUnit *SU,
                                      bool AtTop,
                                      const RegPressureTracker &RPTracker,
@@ -1161,9 +1155,10 @@ bool GCNSchedStage::initGCNRegion() {
   Unsched.reserve(DAG.NumRegionInstrs);
   if (StageID == GCNSchedStageID::OccInitialSchedule ||
       StageID == GCNSchedStageID::ILPInitialSchedule) {
+    const SIInstrInfo *SII = static_cast<const SIInstrInfo *>(DAG.TII);
     for (auto &I : DAG) {
       Unsched.push_back(&I);
-      if (isIGLPMutationOnly(I.getOpcode()))
+      if (SII->isIGLPMutationOnly(I.getOpcode()))
         DAG.RegionsWithIGLPInstrs[RegionIdx] = true;
     }
   } else {
@@ -2047,8 +2042,9 @@ void GCNScheduleDAGMILive::updateRegionBoundaries(
 }
 
 static bool hasIGLPInstrs(ScheduleDAGInstrs *DAG) {
-  return any_of(*DAG, [](MachineBasicBlock::iterator MI) {
-    return isIGLPMutationOnly(MI->getOpcode());
+  const SIInstrInfo *SII = static_cast<const SIInstrInfo *>(DAG->TII);
+  return any_of(*DAG, [SII](MachineBasicBlock::iterator MI) {
+    return SII->isIGLPMutationOnly(MI->getOpcode());
   });
 }
 
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index d63225c067c9d..9eb9444d0fe96 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -985,6 +985,12 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo {
 
   bool isIGLP(const MachineInstr &MI) const { return isIGLP(MI.getOpcode()); }
 
+  // Return true if the instruction is mutually exclusive with all non-IGLP DAG
+  // mutations, requiring all other mutations to be disabled.
+  bool isIGLPMutationOnly(unsigned Opcode) const {
+    return Opcode == AMDGPU::SCHED_GROUP_BARRIER || Opcode == AMDGPU::IGLP_OPT;
+  }
+
   static unsigned getNonSoftWaitcntOpcode(unsigned Opcode) {
     switch (Opcode) {
     case AMDGPU::S_WAITCNT_soft:
diff --git a/llvm/test/CodeGen/AMDGPU/iglp.opt.reentry.ll b/llvm/test/CodeGen/AMDGPU/iglp.opt.reentry.ll
index 1113acb3c0305..ba1cb9b26dec6 100644
--- a/llvm/test/CodeGen/AMDGPU/iglp.opt.reentry.ll
+++ b/llvm/test/CodeGen/AMDGPU/iglp.opt.reentry.ll
@@ -1,4 +1,6 @@
 ; RUN: llc -mtriple=amdgcn -mcpu=gfx908 -O3 < %s | FileCheck %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx908 -O3 -misched=gcn-iterative-max-occupancy-experimental < %s | FileCheck %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx908 -O3 -misched=gcn-iterative-ilp < %s | FileCheck %s
 
 ; Test should not result in build failure
 ; CHECK-LABEL: shouldNotReApply
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sched.group.barrier.iterative.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sched.group.barrier.iterative.ll
new file mode 100644
index 0000000000000..0764cd5d34d75
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sched.group.barrier.iterative.ll
@@ -0,0 +1,933 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs -misched-cluster=0 -misched=gcn-iterative-minreg < %s | FileCheck -check-prefix=GCN-MINREG %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs -misched-cluster=0 -misched=gcn-iterative-max-occupancy-experimental < %s | FileCheck -check-prefix=GCN-MAXOCC %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs -misched-cluster=0 -misched=gcn-iterative-ilp < %s | FileCheck -check-prefix=GCN-ILP %s
+
+define amdgpu_kernel void @test_sched_group_barrier_pipeline_MFMA_interleave(ptr addrspace(3) noalias %in, ptr addrspace(3) noalias %out) #0 {
+; GCN-MINREG-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave:
+; GCN-MINREG:       ; %bb.0: ; %entry
+; GCN-MINREG-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-MINREG-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-MINREG-NEXT:    v_and_b32_e32 v0, 0x1ff80, v0
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v2, 1.0
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v1, 2.0
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_add_u32_e32 v4, s0, v0
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v4 offset:112
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v4 offset:96
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v4 offset:80
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v4 offset:64
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v4
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v4 offset:16
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v4 offset:32
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v4 offset:48
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v1, a[0:31]
+; GCN-MINREG-NEXT:    v_add_u32_e32 v5, s1, v0
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v0, s1
+; GCN-MINREG-NEXT:    v_add_u32_e32 v3, 0x6000, v4
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[28:31] offset:112
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[24:27] offset:96
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[20:23] offset:80
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[16:19] offset:64
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[12:15] offset:48
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[8:11] offset:32
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[4:7] offset:16
+; GCN-MINREG-NEXT:    ds_write_b128 v5, a[0:3]
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v4 offset:8304
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v4 offset:8288
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v4 offset:8272
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v4 offset:8256
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v4 offset:8240
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v4 offset:8224
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v4 offset:8208
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v4 offset:8192
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v1, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[24:27] offset:8288
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[28:31] offset:8304
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[16:19] offset:8256
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[20:23] offset:8272
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[8:11] offset:8224
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[12:15] offset:8240
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[0:3] offset:8192
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[4:7] offset:8208
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v4 offset:24688
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v4 offset:24672
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v4 offset:24656
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v4 offset:24640
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v4 offset:24624
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v4 offset:24608
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v4 offset:24592
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v4 offset:24576
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v1, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[24:27] offset:16480
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[28:31] offset:16496
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[16:19] offset:16448
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[20:23] offset:16464
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[8:11] offset:16416
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[12:15] offset:16432
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[0:3] offset:16384
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[4:7] offset:16400
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v4 offset:49264
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v4 offset:49248
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v4 offset:49232
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v4 offset:49216
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v4 offset:49200
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v4 offset:49184
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v4 offset:49168
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v4 offset:49152
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v1, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[24:27] offset:24672
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[28:31] offset:24688
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[16:19] offset:24640
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[20:23] offset:24656
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[8:11] offset:24608
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[12:15] offset:24624
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[0:3] offset:24576
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[4:7] offset:24592
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v3 offset:57456
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v3 offset:57440
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v3 offset:57424
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v3 offset:57408
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v3 offset:57344
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v3 offset:57360
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v3 offset:57376
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v3 offset:57392
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v1, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[24:27] offset:32864
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[28:31] offset:32880
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[16:19] offset:32832
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[20:23] offset:32848
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[8:11] offset:32800
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[12:15] offset:32816
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[0:3] offset:32768
+; GCN-MINREG-NEXT:    ds_write_b128 v0, a[4:7] offset:32784
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    s_endpgm
+;
+; GCN-MAXOCC-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave:
+; GCN-MAXOCC:       ; %bb.0: ; %entry
+; GCN-MAXOCC-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-MAXOCC-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-MAXOCC-NEXT:    v_and_b32_e32 v1, 0x1ff80, v0
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v2, 1.0
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v3, 2.0
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v0, s0, v1
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:112
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:96
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:80
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:64
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:16
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:32
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:48
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v3, a[0:31]
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v1, s1, v1
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[28:31] offset:112
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[24:27] offset:96
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[20:23] offset:80
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[16:19] offset:64
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[12:15] offset:48
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[8:11] offset:32
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[4:7] offset:16
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[0:3]
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:8304
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:8288
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:8272
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:8256
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:8240
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:8224
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:8208
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:8192
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v3, a[0:31]
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v1, s1
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[24:27] offset:8288
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[28:31] offset:8304
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[16:19] offset:8256
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[20:23] offset:8272
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[8:11] offset:8224
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[12:15] offset:8240
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[0:3] offset:8192
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[4:7] offset:8208
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:24688
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:24672
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:24656
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:24640
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:24624
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:24608
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:24592
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:24576
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v3, a[0:31]
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 2
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[24:27] offset:16480
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[28:31] offset:16496
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[16:19] offset:16448
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[20:23] offset:16464
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[8:11] offset:16416
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[12:15] offset:16432
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[0:3] offset:16384
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[4:7] offset:16400
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:49264
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:49248
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:49232
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:49216
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:49200
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:49184
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:49168
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:49152
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v3, a[0:31]
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v0, 0x6000, v0
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[24:27] offset:24672
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[28:31] offset:24688
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[16:19] offset:24640
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[20:23] offset:24656
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[8:11] offset:24608
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[12:15] offset:24624
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[0:3] offset:24576
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[4:7] offset:24592
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:57456
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:57440
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:57424
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:57408
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:57344
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:57360
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:57376
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:57392
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v2, v3, a[0:31]
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 2
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[24:27] offset:32864
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[28:31] offset:32880
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[16:19] offset:32832
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[20:23] offset:32848
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[8:11] offset:32800
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[12:15] offset:32816
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[0:3] offset:32768
+; GCN-MAXOCC-NEXT:    ds_write_b128 v1, a[4:7] offset:32784
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_endpgm
+;
+; GCN-ILP-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave:
+; GCN-ILP:       ; %bb.0: ; %entry
+; GCN-ILP-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-ILP-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-ILP-NEXT:    v_and_b32_e32 v0, 0x1ff80, v0
+; GCN-ILP-NEXT:    v_mov_b32_e32 v1, 1.0
+; GCN-ILP-NEXT:    v_mov_b32_e32 v2, 2.0
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_add_u32_e32 v3, s0, v0
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:48
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:32
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:16
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:64
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:80
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:96
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:112
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-ILP-NEXT:    v_add_u32_e32 v0, s1, v0
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[28:31] offset:112
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[24:27] offset:96
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[20:23] offset:80
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[16:19] offset:64
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[12:15] offset:48
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[8:11] offset:32
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[4:7] offset:16
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[0:3]
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:8192
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:8208
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:8224
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:8240
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:8256
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:8272
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:8288
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:8304
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-ILP-NEXT:    v_mov_b32_e32 v0, s1
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[24:27] offset:8288
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[28:31] offset:8304
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[16:19] offset:8256
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[20:23] offset:8272
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[8:11] offset:8224
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[12:15] offset:8240
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[0:3] offset:8192
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[4:7] offset:8208
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:24576
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:24592
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:24608
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:24624
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:24640
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:24656
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:24672
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:24688
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 2
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[4:7] offset:16400
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:49168
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[0:3] offset:16384
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:49152
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[12:15] offset:16432
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:49200
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[8:11] offset:16416
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:49184
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[20:23] offset:16464
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:49232
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[16:19] offset:16448
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:49216
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[28:31] offset:16496
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:49264
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[24:27] offset:16480
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:49248
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-ILP-NEXT:    v_add_u32_e32 v3, 0x6000, v3
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[4:7] offset:24592
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:57360
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[0:3] offset:24576
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:57344
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[12:15] offset:24624
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:57392
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[8:11] offset:24608
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:57376
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[20:23] offset:24656
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:57424
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[16:19] offset:24640
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:57408
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[28:31] offset:24688
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:57456
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[24:27] offset:24672
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:57440
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 2
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[24:27] offset:32864
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[28:31] offset:32880
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[16:19] offset:32832
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[20:23] offset:32848
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[8:11] offset:32800
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[12:15] offset:32816
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[0:3] offset:32768
+; GCN-ILP-NEXT:    ds_write_b128 v0, a[4:7] offset:32784
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    s_endpgm
+entry:
+  %idx = call i32 @llvm.amdgcn.workitem.id.x()
+  %load.0.addr = getelementptr <32 x float>, ptr addrspace(3) %in, i32 %idx
+  %load.0 = load <32 x float>, ptr addrspace(3) %load.0.addr
+  %load.1.addr = getelementptr <32 x float>, ptr addrspace(3) %load.0.addr, i32 64
+  %load.1 = load <32 x float>, ptr addrspace(3) %load.1.addr
+  %load.2.addr = getelementptr <32 x float>, ptr addrspace(3) %load.1.addr, i32 128
+  %load.2 = load <32 x float>, ptr addrspace(3) %load.2.addr
+  %load.3.addr = getelementptr <32 x float>, ptr addrspace(3) %load.2.addr, i32 192
+  %load.3 = load <32 x float>, ptr addrspace(3) %load.3.addr
+  %load.4.addr = getelementptr <32 x float>, ptr addrspace(3) %load.3.addr, i32 256
+  %load.4 = load <32 x float>, ptr addrspace(3) %load.4.addr
+  %mai.0 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.0, i32 0, i32 0, i32 0)
+  %mai.1 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.1, i32 0, i32 0, i32 0)
+  %mai.2 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.2, i32 0, i32 0, i32 0)
+  %mai.3 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.3, i32 0, i32 0, i32 0)
+  %mai.4 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.4, i32 0, i32 0, i32 0)
+  %store.0.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 %idx
+  store <32 x float> %mai.0, ptr addrspace(3) %store.0.addr
+  %store.1.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 64
+  store <32 x float> %mai.1, ptr addrspace(3) %store.1.addr
+  %store.2.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 128
+  store <32 x float> %mai.2, ptr addrspace(3) %store.2.addr
+  %store.3.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 192
+  store <32 x float> %mai.3, ptr addrspace(3) %store.3.addr
+  %store.4.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 256
+  store <32 x float> %mai.4, ptr addrspace(3) %store.4.addr
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ret void
+}
+
+
+define amdgpu_kernel void @test_sched_group_barrier_pipeline_MFMA_interleave_split_region(ptr addrspace(3) noalias %in, ptr addrspace(3) noalias %out) #0 {
+; GCN-MINREG-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave_split_region:
+; GCN-MINREG:       ; %bb.0: ; %entry
+; GCN-MINREG-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-MINREG-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-MINREG-NEXT:    v_and_b32_e32 v2, 0x1ff80, v0
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v1, 1.0
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v0, 2.0
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_add_u32_e32 v3, s0, v2
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v3 offset:112
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v3 offset:96
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v3 offset:80
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v3 offset:64
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v3
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v3 offset:16
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v3 offset:32
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v3 offset:48
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v0, a[0:31]
+; GCN-MINREG-NEXT:    v_add_u32_e32 v2, s1, v2
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 1
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[28:31] offset:112
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[24:27] offset:96
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[20:23] offset:80
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[16:19] offset:64
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[12:15] offset:48
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[8:11] offset:32
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[4:7] offset:16
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[0:3]
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v3 offset:8304
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v3 offset:8288
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v3 offset:8272
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v3 offset:8256
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v3 offset:8240
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v3 offset:8224
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v3 offset:8208
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v3 offset:8192
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v0, a[0:31]
+; GCN-MINREG-NEXT:    v_mov_b32_e32 v2, s1
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 1
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[24:27] offset:8288
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[28:31] offset:8304
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[16:19] offset:8256
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[20:23] offset:8272
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[8:11] offset:8224
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[12:15] offset:8240
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[0:3] offset:8192
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[4:7] offset:8208
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_barrier mask(0x00000000)
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v3 offset:24688
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v3 offset:24672
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v3 offset:24656
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v3 offset:24640
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v3 offset:24576
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v3 offset:24592
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v3 offset:24608
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v3 offset:24624
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v0, a[0:31]
+; GCN-MINREG-NEXT:    v_add_u32_e32 v4, 0x6000, v3
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 1
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[28:31] offset:16496
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[24:27] offset:16480
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[20:23] offset:16464
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[16:19] offset:16448
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[12:15] offset:16432
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[8:11] offset:16416
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[4:7] offset:16400
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[0:3] offset:16384
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v3 offset:49264
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v3 offset:49248
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v3 offset:49232
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v3 offset:49216
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v3 offset:49200
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v3 offset:49184
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v3 offset:49168
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v3 offset:49152
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v0, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[28:31] offset:24688
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[24:27] offset:24672
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[20:23] offset:24656
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[16:19] offset:24640
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[12:15] offset:24624
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[8:11] offset:24608
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[4:7] offset:24592
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[0:3] offset:24576
+; GCN-MINREG-NEXT:    ds_read_b128 a[28:31], v4 offset:57456
+; GCN-MINREG-NEXT:    ds_read_b128 a[24:27], v4 offset:57440
+; GCN-MINREG-NEXT:    ds_read_b128 a[20:23], v4 offset:57424
+; GCN-MINREG-NEXT:    ds_read_b128 a[16:19], v4 offset:57408
+; GCN-MINREG-NEXT:    ds_read_b128 a[0:3], v4 offset:57344
+; GCN-MINREG-NEXT:    ds_read_b128 a[4:7], v4 offset:57360
+; GCN-MINREG-NEXT:    ds_read_b128 a[8:11], v4 offset:57376
+; GCN-MINREG-NEXT:    ds_read_b128 a[12:15], v4 offset:57392
+; GCN-MINREG-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MINREG-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v0, a[0:31]
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 7
+; GCN-MINREG-NEXT:    s_nop 2
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[28:31] offset:32880
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[24:27] offset:32864
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[20:23] offset:32848
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[16:19] offset:32832
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[12:15] offset:32816
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[8:11] offset:32800
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[4:7] offset:32784
+; GCN-MINREG-NEXT:    ds_write_b128 v2, a[0:3] offset:32768
+; GCN-MINREG-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MINREG-NEXT:    s_endpgm
+;
+; GCN-MAXOCC-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave_split_region:
+; GCN-MAXOCC:       ; %bb.0: ; %entry
+; GCN-MAXOCC-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-MAXOCC-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-MAXOCC-NEXT:    v_and_b32_e32 v3, 0x1ff80, v0
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v1, 1.0
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v2, 2.0
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v0, s0, v3
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:112
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:96
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:80
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:64
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:16
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:32
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:48
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v3, s1, v3
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[28:31] offset:112
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[24:27] offset:96
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[20:23] offset:80
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[16:19] offset:64
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[12:15] offset:48
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[8:11] offset:32
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[4:7] offset:16
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[0:3]
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:8304
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:8288
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:8272
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:8256
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:8240
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:8224
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:8208
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:8192
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-MAXOCC-NEXT:    v_mov_b32_e32 v3, s1
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[24:27] offset:8288
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[28:31] offset:8304
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[16:19] offset:8256
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[20:23] offset:8272
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[8:11] offset:8224
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[12:15] offset:8240
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[0:3] offset:8192
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[4:7] offset:8208
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_barrier mask(0x00000000)
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:24688
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:24672
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:24656
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:24640
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:24576
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:24592
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:24608
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:24624
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 2
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[28:31] offset:16496
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[24:27] offset:16480
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[20:23] offset:16464
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[16:19] offset:16448
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[12:15] offset:16432
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[8:11] offset:16416
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[4:7] offset:16400
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[0:3] offset:16384
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:49264
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:49248
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:49232
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:49216
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:49200
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:49184
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:49168
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:49152
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-MAXOCC-NEXT:    v_add_u32_e32 v0, 0x6000, v0
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 1
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[28:31] offset:24688
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[24:27] offset:24672
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[20:23] offset:24656
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[16:19] offset:24640
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[12:15] offset:24624
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[8:11] offset:24608
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[4:7] offset:24592
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[0:3] offset:24576
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[28:31], v0 offset:57456
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[24:27], v0 offset:57440
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[20:23], v0 offset:57424
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[16:19], v0 offset:57408
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[0:3], v0 offset:57344
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[4:7], v0 offset:57360
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[8:11], v0 offset:57376
+; GCN-MAXOCC-NEXT:    ds_read_b128 a[12:15], v0 offset:57392
+; GCN-MAXOCC-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-MAXOCC-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v1, v2, a[0:31]
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 7
+; GCN-MAXOCC-NEXT:    s_nop 2
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[28:31] offset:32880
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[24:27] offset:32864
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[20:23] offset:32848
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[16:19] offset:32832
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[12:15] offset:32816
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[8:11] offset:32800
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[4:7] offset:32784
+; GCN-MAXOCC-NEXT:    ds_write_b128 v3, a[0:3] offset:32768
+; GCN-MAXOCC-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-MAXOCC-NEXT:    s_endpgm
+;
+; GCN-ILP-LABEL: test_sched_group_barrier_pipeline_MFMA_interleave_split_region:
+; GCN-ILP:       ; %bb.0: ; %entry
+; GCN-ILP-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
+; GCN-ILP-NEXT:    v_lshlrev_b32_e32 v0, 7, v0
+; GCN-ILP-NEXT:    v_and_b32_e32 v2, 0x1ff80, v0
+; GCN-ILP-NEXT:    v_mov_b32_e32 v0, 1.0
+; GCN-ILP-NEXT:    v_mov_b32_e32 v1, 2.0
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_add_u32_e32 v3, s0, v2
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:48
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:32
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:16
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:64
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:80
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:96
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:112
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v0, v1, a[0:31]
+; GCN-ILP-NEXT:    v_add_u32_e32 v2, s1, v2
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[0:3]
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:8192
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[4:7] offset:16
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:8208
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[8:11] offset:32
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:8224
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[12:15] offset:48
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:8240
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[16:19] offset:64
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:8256
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[20:23] offset:80
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:8272
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[24:27] offset:96
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:8288
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[28:31] offset:112
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:8304
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v0, v1, a[0:31]
+; GCN-ILP-NEXT:    v_mov_b32_e32 v2, s1
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[24:27] offset:8288
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[28:31] offset:8304
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[16:19] offset:8256
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[20:23] offset:8272
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[8:11] offset:8224
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[12:15] offset:8240
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[0:3] offset:8192
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[4:7] offset:8208
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_barrier mask(0x00000000)
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:24624
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:24608
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:24592
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:24576
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:24640
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:24656
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:24672
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:24688
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v0, v1, a[0:31]
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 2
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[28:31] offset:16496
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[24:27] offset:16480
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[20:23] offset:16464
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[16:19] offset:16448
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[12:15] offset:16432
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[8:11] offset:16416
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[4:7] offset:16400
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[0:3] offset:16384
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:49152
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:49168
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:49184
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:49200
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:49216
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:49232
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:49248
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:49264
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v0, v1, a[0:31]
+; GCN-ILP-NEXT:    v_add_u32_e32 v3, 0x6000, v3
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 1
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[0:3] offset:24576
+; GCN-ILP-NEXT:    ds_read_b128 a[0:3], v3 offset:57344
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[4:7] offset:24592
+; GCN-ILP-NEXT:    ds_read_b128 a[4:7], v3 offset:57360
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[8:11] offset:24608
+; GCN-ILP-NEXT:    ds_read_b128 a[8:11], v3 offset:57376
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[12:15] offset:24624
+; GCN-ILP-NEXT:    ds_read_b128 a[12:15], v3 offset:57392
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[16:19] offset:24640
+; GCN-ILP-NEXT:    ds_read_b128 a[16:19], v3 offset:57408
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[20:23] offset:24656
+; GCN-ILP-NEXT:    ds_read_b128 a[20:23], v3 offset:57424
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[24:27] offset:24672
+; GCN-ILP-NEXT:    ds_read_b128 a[24:27], v3 offset:57440
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[28:31] offset:24688
+; GCN-ILP-NEXT:    ds_read_b128 a[28:31], v3 offset:57456
+; GCN-ILP-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-ILP-NEXT:    v_mfma_f32_32x32x1f32 a[0:31], v0, v1, a[0:31]
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000100) size(8) SyncID(0)
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 7
+; GCN-ILP-NEXT:    s_nop 2
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[28:31] offset:32880
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[24:27] offset:32864
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[20:23] offset:32848
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[16:19] offset:32832
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[12:15] offset:32816
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[8:11] offset:32800
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[4:7] offset:32784
+; GCN-ILP-NEXT:    ds_write_b128 v2, a[0:3] offset:32768
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000008) size(1) SyncID(0)
+; GCN-ILP-NEXT:    ; sched_group_barrier mask(0x00000200) size(8) SyncID(0)
+; GCN-ILP-NEXT:    s_endpgm
+entry:
+  %idx = call i32 @llvm.amdgcn.workitem.id.x()
+  %load.0.addr = getelementptr <32 x float>, ptr addrspace(3) %in, i32 %idx
+  %load.0 = load <32 x float>, ptr addrspace(3) %load.0.addr
+  %load.1.addr = getelementptr <32 x float>, ptr addrspace(3) %load.0.addr, i32 64
+  %load.1 = load <32 x float>, ptr addrspace(3) %load.1.addr
+  %mai.0 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.0, i32 0, i32 0, i32 0)
+  %mai.1 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.1, i32 0, i32 0, i32 0)
+  %store.0.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 %idx
+  store <32 x float> %mai.0, ptr addrspace(3) %store.0.addr
+  %store.1.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 64
+  store <32 x float> %mai.1, ptr addrspace(3) %store.1.addr
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; parition the regions
+  call void @llvm.amdgcn.sched.barrier(i32 0)
+  %load.2.addr = getelementptr <32 x float>, ptr addrspace(3) %load.1.addr, i32 128
+  %load.2 = load <32 x float>, ptr addrspace(3) %load.2.addr
+  %load.3.addr = getelementptr <32 x float>, ptr addrspace(3) %load.2.addr, i32 192
+  %load.3 = load <32 x float>, ptr addrspace(3) %load.3.addr
+  %load.4.addr = getelementptr <32 x float>, ptr addrspace(3) %load.3.addr, i32 256
+  %load.4 = load <32 x float>, ptr addrspace(3) %load.4.addr
+  %mai.2 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.2, i32 0, i32 0, i32 0)
+  %mai.3 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.3, i32 0, i32 0, i32 0)
+  %mai.4 = tail call <32 x float> @llvm.amdgcn.mfma.f32.32x32x1f32(float 1.0, float 2.0, <32 x float> %load.4, i32 0, i32 0, i32 0)
+  %store.2.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 128
+  store <32 x float> %mai.2, ptr addrspace(3) %store.2.addr
+  %store.3.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 192
+  store <32 x float> %mai.3, ptr addrspace(3) %store.3.addr
+  %store.4.addr = getelementptr <32 x float>, ptr addrspace(3) %out, i32 256
+  store <32 x float> %mai.4, ptr addrspace(3) %store.4.addr
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ; 8 DS read
+  call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 8, i32 0)
+  ; 1 MFMA
+  call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+  ; 8 DS write
+  call void @llvm.amdgcn.sched.group.barrier(i32 512, i32 8, i32 0)
+  ret void
+}
diff --git a/llvm/test/CodeGen/AMDGPU/schedule-regpressure-limit2.ll b/llvm/test/CodeGen/AMDGPU/schedule-regpressure-limit2.ll
index 7d771342a598e..462ac23ec7e0e 100644
--- a/llvm/test/CodeGen/AMDGPU/schedule-regpressure-limit2.ll
+++ b/llvm/test/CodeGen/AMDGPU/schedule-regpressure-limit2.ll
@@ -2,10 +2,10 @@
 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti -enable-amdgpu-aa=0 -misched=gcn-iterative-max-occupancy-experimental -verify-machineinstrs < %s | FileCheck --check-prefix=SI-MAXOCC %s
 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-minreg -verify-machineinstrs < %s | FileCheck --check-prefix=SI-MINREG %s
 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-maxocc -verify-machineinstrs < %s | FileCheck --check-prefix=SI-MAXOCC %s
-; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -misched=gcn-iterative-minreg -verify-machineinstrs < %s | FileCheck --check-prefix=VI %s
-; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -misched=gcn-iterative-max-occupancy-experimental -verify-machineinstrs < %s | FileCheck --check-prefix=VI %s
-; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-minreg -verify-machineinstrs < %s | FileCheck --check-prefix=VI %s
-; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-maxocc -verify-machineinstrs < %s | FileCheck --check-prefix=VI %s
+; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -misched=gcn-iterative-minreg -verify-machineinstrs < %s | FileCheck --check-prefix=VI-MINREG %s
+; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -misched=gcn-iterative-max-occupancy-experimental -verify-machineinstrs < %s | FileCheck --check-prefix=VI-MAXOCC %s
+; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-minreg -verify-machineinstrs < %s | FileCheck --check-prefix=VI-MINREG %s
+; RUN: llc -mtriple=amdgcn -mcpu=fiji -enable-amdgpu-aa=0 -amdgpu-sched-strategy=iterative-maxocc -verify-machineinstrs < %s | FileCheck --check-prefix=VI-MAXOCC %s
 
 ; SI-MINREG: NumSgprs: {{[1-9]$}}
 ; SI-MINREG: NumVgprs: {{[1-9]$}}
@@ -14,8 +14,12 @@
 ; SI-MAXOCC: NumVgprs: {{[1-4]?[0-9]$}}
 
 ; stores may alias loads
-; VI: NumSgprs: {{[0-9]$}}
-; VI: NumVgprs: {{[1-3][0-9]$}}
+; VI-MINREG: NumSgprs: {{[0-9]$}}
+; VI-MINREG: NumVgprs: {{[1-3][0-9]$}}
+
+; stores may alias loads
+; VI-MAXOCC: NumSgprs: {{[1-3][0-9]$}}
+; VI-MAXOCC: NumVgprs: {{[1-6][0-9]$}}
 
 define amdgpu_kernel void @load_fma_store(ptr addrspace(3) nocapture readonly %in_arg, ptr addrspace(1) nocapture %out_arg) {
 bb:

>From eb68b914dd7f1926daf9cfab19b85765f2a60700 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Fri, 11 Apr 2025 15:49:01 -0700
Subject: [PATCH 55/76] [NFC][LLVM] Apply std::move to object being pushed back
 in findSymbolCommon (#135290)

Static analysis found that we could move LineInfo into the Result vector
instead of just copying it.
---
 llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index b96f97a159243..d154f16f272bd 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -257,7 +257,7 @@ LLVMSymbolizer::findSymbolCommon(const T &ModuleSpecifier, StringRef Symbol,
     if (LineInfo.FileName != DILineInfo::BadString) {
       if (Opts.Demangle)
         LineInfo.FunctionName = DemangleName(LineInfo.FunctionName, Info);
-      Result.push_back(LineInfo);
+      Result.push_back(std::move(LineInfo));
     }
   }
 

>From 957bd6aa32da8b89571a6e6abb53ec87ad828332 Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis at chromium.org>
Date: Fri, 11 Apr 2025 19:08:05 -0400
Subject: [PATCH 56/76] [gn] port d1fd97737e90

---
 .../gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn      | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn
index 4bc2ccc79c85a..8fcd96ccc582d 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/sanitizer_common/BUILD.gn
@@ -65,6 +65,7 @@ source_set("sources") {
     "sanitizer_flat_map.h",
     "sanitizer_fuchsia.cpp",
     "sanitizer_fuchsia.h",
+    "sanitizer_haiku.cpp",
     "sanitizer_getauxval.h",
     "sanitizer_hash.h",
     "sanitizer_interface_internal.h",
@@ -107,6 +108,7 @@ source_set("sources") {
     "sanitizer_procmaps_bsd.cpp",
     "sanitizer_procmaps_common.cpp",
     "sanitizer_procmaps_fuchsia.cpp",
+    "sanitizer_procmaps_haiku.cpp",
     "sanitizer_procmaps_linux.cpp",
     "sanitizer_procmaps_mac.cpp",
     "sanitizer_procmaps_solaris.cpp",

>From 4c67bdd973ee1c308155555500ef39d4e2099a6a Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 11 Apr 2025 16:12:19 -0700
Subject: [PATCH 57/76] [RISCV] Don't fold offsets into auipc if offset is
 larger than the reference global variable. (#135297)

The global variable should be within 2GB of the PC, but an offset to an
address outside the global might not be.

Fixes #134525.
---
 .../lib/Target/RISCV/RISCVMergeBaseOffset.cpp | 35 +++++++---
 .../test/CodeGen/RISCV/fold-addi-loadstore.ll | 69 +++++++++++++++++++
 2 files changed, 95 insertions(+), 9 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp b/llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp
index bbbb1e1595982..eb3d43c9af7c2 100644
--- a/llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp
+++ b/llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp
@@ -35,7 +35,7 @@ class RISCVMergeBaseOffsetOpt : public MachineFunctionPass {
   bool detectFoldable(MachineInstr &Hi, MachineInstr *&Lo);
 
   bool detectAndFoldOffset(MachineInstr &Hi, MachineInstr &Lo);
-  void foldOffset(MachineInstr &Hi, MachineInstr &Lo, MachineInstr &Tail,
+  bool foldOffset(MachineInstr &Hi, MachineInstr &Lo, MachineInstr &Tail,
                   int64_t Offset);
   bool foldLargeOffset(MachineInstr &Hi, MachineInstr &Lo,
                        MachineInstr &TailAdd, Register GSReg);
@@ -142,9 +142,21 @@ bool RISCVMergeBaseOffsetOpt::detectFoldable(MachineInstr &Hi,
 // Update the offset in Hi and Lo instructions.
 // Delete the tail instruction and update all the uses to use the
 // output from Lo.
-void RISCVMergeBaseOffsetOpt::foldOffset(MachineInstr &Hi, MachineInstr &Lo,
+bool RISCVMergeBaseOffsetOpt::foldOffset(MachineInstr &Hi, MachineInstr &Lo,
                                          MachineInstr &Tail, int64_t Offset) {
   assert(isInt<32>(Offset) && "Unexpected offset");
+
+  // If Hi is an AUIPC, don't fold the offset if it is outside the bounds of
+  // the global object. The object may be within 2GB of the PC, but addresses
+  // outside of the object might not be.
+  if (Hi.getOpcode() == RISCV::AUIPC && Hi.getOperand(1).isGlobal()) {
+    const GlobalValue *GV = Hi.getOperand(1).getGlobal();
+    Type *Ty = GV->getValueType();
+    if (!Ty->isSized() || Offset < 0 ||
+        (uint64_t)Offset > GV->getDataLayout().getTypeAllocSize(Ty))
+      return false;
+  }
+
   // Put the offset back in Hi and the Lo
   Hi.getOperand(1).setOffset(Offset);
   if (Hi.getOpcode() != RISCV::AUIPC)
@@ -156,6 +168,7 @@ void RISCVMergeBaseOffsetOpt::foldOffset(MachineInstr &Hi, MachineInstr &Lo,
   Tail.eraseFromParent();
   LLVM_DEBUG(dbgs() << "  Merged offset " << Offset << " into base.\n"
                     << "     " << Hi << "     " << Lo;);
+  return true;
 }
 
 // Detect patterns for large offsets that are passed into an ADD instruction.
@@ -205,7 +218,8 @@ bool RISCVMergeBaseOffsetOpt::foldLargeOffset(MachineInstr &Hi,
     // Handle rs1 of ADDI is X0.
     if (AddiReg == RISCV::X0) {
       LLVM_DEBUG(dbgs() << "  Offset Instrs: " << OffsetTail);
-      foldOffset(Hi, Lo, TailAdd, OffLo);
+      if (!foldOffset(Hi, Lo, TailAdd, OffLo))
+        return false;
       OffsetTail.eraseFromParent();
       return true;
     }
@@ -226,7 +240,8 @@ bool RISCVMergeBaseOffsetOpt::foldLargeOffset(MachineInstr &Hi,
       return false;
     LLVM_DEBUG(dbgs() << "  Offset Instrs: " << OffsetTail
                       << "                 " << OffsetLui);
-    foldOffset(Hi, Lo, TailAdd, Offset);
+    if (!foldOffset(Hi, Lo, TailAdd, Offset))
+      return false;
     OffsetTail.eraseFromParent();
     OffsetLui.eraseFromParent();
     return true;
@@ -235,7 +250,8 @@ bool RISCVMergeBaseOffsetOpt::foldLargeOffset(MachineInstr &Hi,
     // exists.
     LLVM_DEBUG(dbgs() << "  Offset Instr: " << OffsetTail);
     int64_t Offset = SignExtend64<32>(OffsetTail.getOperand(1).getImm() << 12);
-    foldOffset(Hi, Lo, TailAdd, Offset);
+    if (!foldOffset(Hi, Lo, TailAdd, Offset))
+      return false;
     OffsetTail.eraseFromParent();
     return true;
   }
@@ -294,7 +310,8 @@ bool RISCVMergeBaseOffsetOpt::foldShiftedOffset(MachineInstr &Hi,
   Offset = (uint64_t)Offset << ShAmt;
 
   LLVM_DEBUG(dbgs() << "  Offset Instr: " << OffsetTail);
-  foldOffset(Hi, Lo, TailShXAdd, Offset);
+  if (!foldOffset(Hi, Lo, TailShXAdd, Offset))
+    return false;
   OffsetTail.eraseFromParent();
   return true;
 }
@@ -327,15 +344,15 @@ bool RISCVMergeBaseOffsetOpt::detectAndFoldOffset(MachineInstr &Hi,
       if (TailTail.getOpcode() == RISCV::ADDI) {
         Offset += TailTail.getOperand(2).getImm();
         LLVM_DEBUG(dbgs() << "  Offset Instrs: " << Tail << TailTail);
-        foldOffset(Hi, Lo, TailTail, Offset);
+        if (!foldOffset(Hi, Lo, TailTail, Offset))
+          return false;
         Tail.eraseFromParent();
         return true;
       }
     }
 
     LLVM_DEBUG(dbgs() << "  Offset Instr: " << Tail);
-    foldOffset(Hi, Lo, Tail, Offset);
-    return true;
+    return foldOffset(Hi, Lo, Tail, Offset);
   }
   case RISCV::ADD:
     // The offset is too large to fit in the immediate field of ADDI.
diff --git a/llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll b/llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll
index b8dc7804c4908..255e65490195c 100644
--- a/llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll
+++ b/llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll
@@ -1227,3 +1227,72 @@ for.inc.peel:                                     ; preds = %entry
   store i32 %spec.select, ptr null, align 4
   ret i32 0
 }
+
+ at ki_end = external dso_local global [0 x i8], align 1
+
+define i1 @pr134525() nounwind {
+; RV32I-LABEL: pr134525:
+; RV32I:       # %bb.0: # %entry
+; RV32I-NEXT:    lui a0, %hi(ki_end)
+; RV32I-NEXT:    addi a0, a0, %lo(ki_end)
+; RV32I-NEXT:    lui a1, 523776
+; RV32I-NEXT:    lui a2, 32
+; RV32I-NEXT:    add a1, a0, a1
+; RV32I-NEXT:    addi a2, a2, 1
+; RV32I-NEXT:    sltu a2, a1, a2
+; RV32I-NEXT:    sltu a0, a1, a0
+; RV32I-NEXT:    not a0, a0
+; RV32I-NEXT:    and a0, a0, a2
+; RV32I-NEXT:    ret
+;
+; RV32I-MEDIUM-LABEL: pr134525:
+; RV32I-MEDIUM:       # %bb.0: # %entry
+; RV32I-MEDIUM-NEXT:  .Lpcrel_hi15:
+; RV32I-MEDIUM-NEXT:    auipc a0, %pcrel_hi(ki_end)
+; RV32I-MEDIUM-NEXT:    lui a1, 523776
+; RV32I-MEDIUM-NEXT:    lui a2, 32
+; RV32I-MEDIUM-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi15)
+; RV32I-MEDIUM-NEXT:    addi a2, a2, 1
+; RV32I-MEDIUM-NEXT:    add a1, a0, a1
+; RV32I-MEDIUM-NEXT:    sltu a2, a1, a2
+; RV32I-MEDIUM-NEXT:    sltu a0, a1, a0
+; RV32I-MEDIUM-NEXT:    not a0, a0
+; RV32I-MEDIUM-NEXT:    and a0, a0, a2
+; RV32I-MEDIUM-NEXT:    ret
+;
+; RV64I-LABEL: pr134525:
+; RV64I:       # %bb.0: # %entry
+; RV64I-NEXT:    lui a0, %hi(ki_end+2145386496)
+; RV64I-NEXT:    addi a0, a0, %lo(ki_end+2145386496)
+; RV64I-NEXT:    lui a1, 32
+; RV64I-NEXT:    addiw a1, a1, 1
+; RV64I-NEXT:    sltu a0, a0, a1
+; RV64I-NEXT:    ret
+;
+; RV64I-MEDIUM-LABEL: pr134525:
+; RV64I-MEDIUM:       # %bb.0: # %entry
+; RV64I-MEDIUM-NEXT:  .Lpcrel_hi15:
+; RV64I-MEDIUM-NEXT:    auipc a0, %pcrel_hi(ki_end)
+; RV64I-MEDIUM-NEXT:    lui a1, 523776
+; RV64I-MEDIUM-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi15)
+; RV64I-MEDIUM-NEXT:    add a0, a0, a1
+; RV64I-MEDIUM-NEXT:    lui a1, 32
+; RV64I-MEDIUM-NEXT:    addiw a1, a1, 1
+; RV64I-MEDIUM-NEXT:    sltu a0, a0, a1
+; RV64I-MEDIUM-NEXT:    ret
+;
+; RV64I-LARGE-LABEL: pr134525:
+; RV64I-LARGE:       # %bb.0: # %entry
+; RV64I-LARGE-NEXT:  .Lpcrel_hi16:
+; RV64I-LARGE-NEXT:    auipc a0, %pcrel_hi(.LCPI22_0)
+; RV64I-LARGE-NEXT:    ld a0, %pcrel_lo(.Lpcrel_hi16)(a0)
+; RV64I-LARGE-NEXT:    lui a1, 523776
+; RV64I-LARGE-NEXT:    add a0, a0, a1
+; RV64I-LARGE-NEXT:    lui a1, 32
+; RV64I-LARGE-NEXT:    addiw a1, a1, 1
+; RV64I-LARGE-NEXT:    sltu a0, a0, a1
+; RV64I-LARGE-NEXT:    ret
+entry:
+  %cmp = icmp ult i64 sub (i64 ptrtoint (ptr @ki_end to i64), i64 -2145386496), 131073
+  ret i1 %cmp
+}

>From 6aae1047b6c701b407c0cadaf1acd036c1bab6b6 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Fri, 11 Apr 2025 20:18:16 -0300
Subject: [PATCH 58/76] [clang] ASTImporter: fix SubstNonTypeTemplateParmExpr
 source location (#135450)

This makes it clear which source location is imported.
---
 clang/lib/AST/ASTImporter.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index f7cd54e447bbf..ab550d7aff5f1 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -8931,14 +8931,14 @@ ExpectedStmt ASTNodeImporter::VisitSubstNonTypeTemplateParmExpr(
     SubstNonTypeTemplateParmExpr *E) {
   Error Err = Error::success();
   auto ToType = importChecked(Err, E->getType());
-  auto ToExprLoc = importChecked(Err, E->getExprLoc());
+  auto ToNameLoc = importChecked(Err, E->getNameLoc());
   auto ToAssociatedDecl = importChecked(Err, E->getAssociatedDecl());
   auto ToReplacement = importChecked(Err, E->getReplacement());
   if (Err)
     return std::move(Err);
 
   return new (Importer.getToContext()) SubstNonTypeTemplateParmExpr(
-      ToType, E->getValueKind(), ToExprLoc, ToReplacement, ToAssociatedDecl,
+      ToType, E->getValueKind(), ToNameLoc, ToReplacement, ToAssociatedDecl,
       E->getIndex(), E->getPackIndex(), E->isReferenceParameter(),
       E->getFinal());
 }

>From b74dbf7fb2d152109bba29fdb39e0924eb8dc842 Mon Sep 17 00:00:00 2001
From: Pranav Kant <prka at google.com>
Date: Fri, 11 Apr 2025 16:34:49 -0700
Subject: [PATCH 59/76] [bazel] Add support for SMT Dialect (#135454)

This fixes #131480
---
 .../llvm-project-overlay/mlir/BUILD.bazel     | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 5acdf7e6ae46b..ebdbe77f3c7f4 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -6341,6 +6341,75 @@ cc_library(
     ],
 )
 
+
+td_library(
+    name = "SMTTdFiles",
+    srcs = [
+        "include/mlir/Dialect/SMT/IR/SMT.td",
+        "include/mlir/Dialect/SMT/IR/SMTArrayOps.td",
+        "include/mlir/Dialect/SMT/IR/SMTAttributes.td",
+        "include/mlir/Dialect/SMT/IR/SMTBitVectorOps.td",
+        "include/mlir/Dialect/SMT/IR/SMTDialect.td",
+        "include/mlir/Dialect/SMT/IR/SMTIntOps.td",
+        "include/mlir/Dialect/SMT/IR/SMTOps.td",
+        "include/mlir/Dialect/SMT/IR/SMTTypes.td",
+    ],
+    includes = ["include"],
+    deps = [
+        ":AttrTdFiles",
+        ":OpBaseTdFiles",
+        ":SideEffectInterfacesTdFiles",
+        ":BuiltinDialectTdFiles",
+        ":ControlFlowInterfacesTdFiles",
+        ":InferTypeOpInterfaceTdFiles",
+    ],
+)
+
+gentbl_cc_library(
+    name = "SMTIncGen",
+    tbl_outs = {
+        "include/mlir/Dialect/SMT/IR/SMT.h.inc": ["-gen-op-decls"],
+        "include/mlir/Dialect/SMT/IR/SMT.cpp.inc": ["-gen-op-defs"],
+          "include/mlir/Dialect/SMT/IR/SMTDialect.h.inc": [
+            "-gen-dialect-decls",
+            "-dialect=smt",
+        ],
+        "include/mlir/Dialect/SMT/IR/SMTDialect.cpp.inc": [
+            "-gen-dialect-defs",
+            "-dialect=smt",
+        ],
+        "g3doc/Dialects/SMT/SMT.md": ["-gen-op-doc"],
+        "include/mlir/Dialect/SMT/IR/SMTTypes.h.inc": ["-gen-typedef-decls"],
+        "include/mlir/Dialect/SMT/IR/SMTTypes.cpp.inc": ["-gen-typedef-defs"],
+        "include/mlir/Dialect/SMT/IR/SMTAttributes.h.inc": ["-gen-attrdef-decls"],
+        "include/mlir/Dialect/SMT/IR/SMTAttributes.cpp.inc": ["-gen-attrdef-defs"],
+        "include/mlir/Dialect/SMT/IR/SMTEnums.h.inc": ["-gen-enum-decls"],
+        "include/mlir/Dialect/SMT/IR/SMTEnums.cpp.inc": ["-gen-enum-defs"],
+    },
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SMT/IR/SMT.td",
+    deps = [":SMTTdFiles"],
+)
+
+cc_library(
+    name = "SMTDialect",
+    srcs = glob([
+        "lib/Dialect/SMT/IR/*.cpp",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/SMT/IR/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ControlFlowInterfaces"
+        ":IR",
+        ":InferTypeOpInterface",
+        ":SMTIncGen",
+        ":Support",
+        "//llvm:Support",
+    ],
+)
+
 td_library(
     name = "SPIRVImageInterfacesTdFiles",
     srcs = ["include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.td"],
@@ -8769,6 +8838,7 @@ cc_library(
         ":ShapeToStandard",
         ":ShapeTransforms",
         ":ShapeTransformsPassIncGen",
+        ":SMTDialect",
         ":SparseTensorDialect",
         ":SparseTensorPipelines",
         ":SparseTensorTransformOps",

>From a4fbc6f78f7a276d23f61c93694090fccd2461cb Mon Sep 17 00:00:00 2001
From: Pranav Kant <prka at google.com>
Date: Fri, 11 Apr 2025 17:05:52 -0700
Subject: [PATCH 60/76] [bazel] Fix a typo (#135460)

---
 utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index ebdbe77f3c7f4..cc4af7ce40067 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -6401,7 +6401,7 @@ cc_library(
     ]),
     includes = ["include"],
     deps = [
-        ":ControlFlowInterfaces"
+        ":ControlFlowInterfaces",
         ":IR",
         ":InferTypeOpInterface",
         ":SMTIncGen",

>From 54e70ac7650f1c22f687937d1a082e4152f97b22 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Fri, 11 Apr 2025 20:12:36 -0400
Subject: [PATCH 61/76] [mlir][SMT] remove custom forall/exists builder because
 of asan memory leak

---
 mlir/include/mlir/Dialect/SMT/IR/SMTOps.td    |  12 --
 mlir/lib/Dialect/SMT/IR/SMTOps.cpp            |  20 --
 mlir/unittests/Dialect/SMT/CMakeLists.txt     |   1 -
 mlir/unittests/Dialect/SMT/QuantifierTest.cpp | 187 ------------------
 4 files changed, 220 deletions(-)
 delete mode 100644 mlir/unittests/Dialect/SMT/QuantifierTest.cpp

diff --git a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
index 1872c00b74f1a..af73955caee54 100644
--- a/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
+++ b/mlir/include/mlir/Dialect/SMT/IR/SMTOps.td
@@ -448,18 +448,6 @@ class QuantifierOp<string mnemonic> : SMTOp<mnemonic, [
                         VariadicRegion<SizedRegion<1>>:$patterns);
   let results = (outs BoolType:$result);
 
-  let builders = [
-    OpBuilder<(ins
-      "TypeRange":$boundVarTypes,
-      "function_ref<Value(OpBuilder &, Location, ValueRange)>":$bodyBuilder,
-      CArg<"std::optional<ArrayRef<StringRef>>", "std::nullopt">:$boundVarNames,
-      CArg<"function_ref<ValueRange(OpBuilder &, Location, ValueRange)>",
-           "{}">:$patternBuilder,
-      CArg<"uint32_t", "0">:$weight,
-      CArg<"bool", "false">:$noPattern)>
-  ];
-  let skipDefaultBuilders = true;
-
   let assemblyFormat = [{
     ($boundVarNames^)? (`no_pattern` $noPattern^)? (`weight` $weight^)?
     attr-dict-with-keyword $body (`patterns` $patterns^)?
diff --git a/mlir/lib/Dialect/SMT/IR/SMTOps.cpp b/mlir/lib/Dialect/SMT/IR/SMTOps.cpp
index 8977a3abc125d..604dd26da1982 100644
--- a/mlir/lib/Dialect/SMT/IR/SMTOps.cpp
+++ b/mlir/lib/Dialect/SMT/IR/SMTOps.cpp
@@ -432,16 +432,6 @@ LogicalResult ForallOp::verifyRegions() {
   return verifyQuantifierRegions(*this);
 }
 
-void ForallOp::build(
-    OpBuilder &odsBuilder, OperationState &odsState, TypeRange boundVarTypes,
-    function_ref<Value(OpBuilder &, Location, ValueRange)> bodyBuilder,
-    std::optional<ArrayRef<StringRef>> boundVarNames,
-    function_ref<ValueRange(OpBuilder &, Location, ValueRange)> patternBuilder,
-    uint32_t weight, bool noPattern) {
-  buildQuantifier<Properties>(odsBuilder, odsState, boundVarTypes, bodyBuilder,
-                              boundVarNames, patternBuilder, weight, noPattern);
-}
-
 //===----------------------------------------------------------------------===//
 // ExistsOp
 //===----------------------------------------------------------------------===//
@@ -458,15 +448,5 @@ LogicalResult ExistsOp::verifyRegions() {
   return verifyQuantifierRegions(*this);
 }
 
-void ExistsOp::build(
-    OpBuilder &odsBuilder, OperationState &odsState, TypeRange boundVarTypes,
-    function_ref<Value(OpBuilder &, Location, ValueRange)> bodyBuilder,
-    std::optional<ArrayRef<StringRef>> boundVarNames,
-    function_ref<ValueRange(OpBuilder &, Location, ValueRange)> patternBuilder,
-    uint32_t weight, bool noPattern) {
-  buildQuantifier<Properties>(odsBuilder, odsState, boundVarTypes, bodyBuilder,
-                              boundVarNames, patternBuilder, weight, noPattern);
-}
-
 #define GET_OP_CLASSES
 #include "mlir/Dialect/SMT/IR/SMT.cpp.inc"
diff --git a/mlir/unittests/Dialect/SMT/CMakeLists.txt b/mlir/unittests/Dialect/SMT/CMakeLists.txt
index a1331467febaa..86e16d6194ea9 100644
--- a/mlir/unittests/Dialect/SMT/CMakeLists.txt
+++ b/mlir/unittests/Dialect/SMT/CMakeLists.txt
@@ -1,6 +1,5 @@
 add_mlir_unittest(MLIRSMTTests
   AttributeTest.cpp
-  QuantifierTest.cpp
   TypeTest.cpp
 )
 
diff --git a/mlir/unittests/Dialect/SMT/QuantifierTest.cpp b/mlir/unittests/Dialect/SMT/QuantifierTest.cpp
deleted file mode 100644
index 7bb0c1808ca0a..0000000000000
--- a/mlir/unittests/Dialect/SMT/QuantifierTest.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//===- QuantifierTest.cpp - SMT quantifier operation unit tests -----------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/SMT/IR/SMTOps.h"
-#include "gtest/gtest.h"
-
-using namespace mlir;
-using namespace smt;
-
-namespace {
-
-//===----------------------------------------------------------------------===//
-// Test custom builders of ExistsOp
-//===----------------------------------------------------------------------===//
-
-TEST(QuantifierTest, ExistsBuilderWithPattern) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ExistsOp existsOp = builder.create<ExistsOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      std::nullopt,
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return boundVars;
-      },
-      /*weight=*/2);
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  existsOp.print(stream);
-
-  ASSERT_STREQ(
-      stream.str().str().c_str(),
-      "%0 = smt.exists weight 2 {\n^bb0(%arg0: !smt.bool, "
-      "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield %0 : "
-      "!smt.bool\n} patterns {\n^bb0(%arg0: !smt.bool, %arg1: !smt.bool):\n  "
-      "smt.yield %arg0, %arg1 : !smt.bool, !smt.bool\n}\n");
-}
-
-TEST(QuantifierTest, ExistsBuilderNoPattern) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ExistsOp existsOp = builder.create<ExistsOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      ArrayRef<StringRef>{"a", "b"}, nullptr, /*weight=*/0, /*noPattern=*/true);
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  existsOp.print(stream);
-
-  ASSERT_STREQ(stream.str().str().c_str(),
-               "%0 = smt.exists [\"a\", \"b\"] no_pattern {\n^bb0(%arg0: "
-               "!smt.bool, %arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  "
-               "smt.yield %0 : !smt.bool\n}\n");
-}
-
-TEST(QuantifierTest, ExistsBuilderDefault) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ExistsOp existsOp = builder.create<ExistsOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      ArrayRef<StringRef>{"a", "b"});
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  existsOp.print(stream);
-
-  ASSERT_STREQ(stream.str().str().c_str(),
-               "%0 = smt.exists [\"a\", \"b\"] {\n^bb0(%arg0: !smt.bool, "
-               "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield "
-               "%0 : !smt.bool\n}\n");
-}
-
-//===----------------------------------------------------------------------===//
-// Test custom builders of ForallOp
-//===----------------------------------------------------------------------===//
-
-TEST(QuantifierTest, ForallBuilderWithPattern) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ForallOp forallOp = builder.create<ForallOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      ArrayRef<StringRef>{"a", "b"},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return boundVars;
-      },
-      /*weight=*/2);
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  forallOp.print(stream);
-
-  ASSERT_STREQ(
-      stream.str().str().c_str(),
-      "%0 = smt.forall [\"a\", \"b\"] weight 2 {\n^bb0(%arg0: !smt.bool, "
-      "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield %0 : "
-      "!smt.bool\n} patterns {\n^bb0(%arg0: !smt.bool, %arg1: !smt.bool):\n  "
-      "smt.yield %arg0, %arg1 : !smt.bool, !smt.bool\n}\n");
-}
-
-TEST(QuantifierTest, ForallBuilderNoPattern) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ForallOp forallOp = builder.create<ForallOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      ArrayRef<StringRef>{"a", "b"}, nullptr, /*weight=*/0, /*noPattern=*/true);
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  forallOp.print(stream);
-
-  ASSERT_STREQ(stream.str().str().c_str(),
-               "%0 = smt.forall [\"a\", \"b\"] no_pattern {\n^bb0(%arg0: "
-               "!smt.bool, %arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  "
-               "smt.yield %0 : !smt.bool\n}\n");
-}
-
-TEST(QuantifierTest, ForallBuilderDefault) {
-  MLIRContext context;
-  context.loadDialect<SMTDialect>();
-  Location loc(UnknownLoc::get(&context));
-
-  OpBuilder builder(&context);
-  auto boolTy = BoolType::get(&context);
-
-  ForallOp forallOp = builder.create<ForallOp>(
-      loc, TypeRange{boolTy, boolTy},
-      [](OpBuilder &builder, Location loc, ValueRange boundVars) {
-        return builder.create<AndOp>(loc, boundVars);
-      },
-      std::nullopt);
-
-  SmallVector<char, 1024> buffer;
-  llvm::raw_svector_ostream stream(buffer);
-  forallOp.print(stream);
-
-  ASSERT_STREQ(stream.str().str().c_str(),
-               "%0 = smt.forall {\n^bb0(%arg0: !smt.bool, "
-               "%arg1: !smt.bool):\n  %0 = smt.and %arg0, %arg1\n  smt.yield "
-               "%0 : !smt.bool\n}\n");
-}
-
-} // namespace

>From 357e3803bb94cc622c785f7eb60aa38d552bc5ef Mon Sep 17 00:00:00 2001
From: Sagar Kulkarni <sagar.kulkarni1911 at gmail.com>
Date: Fri, 11 Apr 2025 21:15:51 -0400
Subject: [PATCH 62/76] [mlir][vector] Prevent folding non memref-type gather
 into maskedload (#135371)

This patch fixes an issue in the FoldContiguousGather pattern which was
incorrectly folding vector.gather operations with contiguous indices
into vector.maskedload operations regardless of the base operand type.

While vector.gather operations can work on both tensor and memref types,
vector.maskedload operations are only valid for memref types. The
pattern was incorrectly lowering a tensor-based gather into a
masked-load, which is invalid.

This fix adds a type check to ensure the pattern only applies to
memref-based gather operations.

Co-authored-by: Sagar Kulkarni <sagar at rain.ai>
---
 mlir/lib/Dialect/Vector/IR/VectorOps.cpp   |  3 +++
 mlir/test/Dialect/Vector/canonicalize.mlir | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index 5324e38fa7d25..fdbdc72c057af 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -5348,6 +5348,9 @@ class FoldContiguousGather final : public OpRewritePattern<GatherOp> {
   using OpRewritePattern::OpRewritePattern;
   LogicalResult matchAndRewrite(GatherOp op,
                                 PatternRewriter &rewriter) const override {
+    if (!op.getBase().getType().isa<MemRefType>())
+      return rewriter.notifyMatchFailure(op, "base must be of memref type");
+
     if (failed(isZeroBasedContiguousSeq(op.getIndexVec())))
       return failure();
 
diff --git a/mlir/test/Dialect/Vector/canonicalize.mlir b/mlir/test/Dialect/Vector/canonicalize.mlir
index a6d82b85777b0..78b0ea78849e8 100644
--- a/mlir/test/Dialect/Vector/canonicalize.mlir
+++ b/mlir/test/Dialect/Vector/canonicalize.mlir
@@ -3198,6 +3198,19 @@ func.func @contiguous_gather_step(%base: memref<?xf32>,
 
 // -----
 
+// CHECK-LABEL: @no_fold_contiguous_gather_tensor
+func.func @no_fold_contiguous_gather_tensor(%base: tensor<8xf32>, %mask: vector<4xi1>, %pass_thru: vector<4xf32>) -> vector<4xf32> {
+  %c0 = arith.constant 0 : index
+  %indices = arith.constant dense<[0, 1, 2, 3]> : vector<4xindex>
+  // CHECK: vector.gather
+  // CHECK-NOT: vector.maskedload
+  %0 = vector.gather %base[%c0][%indices], %mask, %pass_thru :
+    tensor<8xf32>, vector<4xindex>, vector<4xi1>, vector<4xf32> into vector<4xf32>
+  return %0 : vector<4xf32>
+}
+
+// -----
+
 // CHECK-LABEL: @gather_broadcast(
 // TODO: Broadcast is not supported yet
 //       CHECK:   %[[R:.*]] = vector.gather

>From 336b290923151d02fd6b3050ccbaf74f0aa08339 Mon Sep 17 00:00:00 2001
From: Philip Reames <preames at rivosinc.com>
Date: Fri, 11 Apr 2025 20:02:53 -0700
Subject: [PATCH 63/76] [RISCV] Use a DAG combine to prune pointless
 vrgather.vi (#135392)

If the vrgather.vi is preceeded by a vmv.v.x which writes a superset of
the lanes writen by the vrgather, and the vrgather has no passthru, then
the vrgather has no semantic effect.

This is the start of a mini-series of patches around rewriting
vrgather.vi/vx preceeded by vmv.v.x, vfmf.v.f, vmv.s.x, etc... Starting
with the simplest, but also lowest impact.

One point I'd like a second oppinion on is the out of bounds semenatic
change. As far as I can tell, all the indices are in bounds by
construction. The doc change is as much as I couldn't figure out how to
test the alternative as anything else.
---
 llvm/lib/Target/RISCV/RISCVISelLowering.cpp         | 13 +++++++++++++
 llvm/lib/Target/RISCV/RISCVISelLowering.h           |  3 ++-
 .../CodeGen/RISCV/rvv/fixed-vectors-shuffle-int.ll  |  5 ++---
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index fef9084bd0e73..e5843477e04e5 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -19709,6 +19709,19 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
     if (SDValue V = combineToVCPOP(N, DAG, Subtarget))
       return V;
     break;
+  case RISCVISD::VRGATHER_VX_VL: {
+    // Drop a redundant vrgather_vx.
+    // Note this assumes that out of bounds indices produce poison
+    // and can thus be replaced without having to prove them inbounds..
+    SDValue Src = N->getOperand(0);
+    SDValue Passthru = N->getOperand(2);
+    SDValue VL = N->getOperand(4);
+    // TODO: Handle fmv.v.f?
+    if (Src.getOpcode() == RISCVISD::VMV_V_X_VL && Passthru.isUndef() &&
+        VL == Src.getOperand(2))
+      return Src;
+    break;
+  }
   }
 
   return SDValue();
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.h b/llvm/lib/Target/RISCV/RISCVISelLowering.h
index 5ebdbbd51f2b1..d624ee33d6a63 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.h
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.h
@@ -388,7 +388,8 @@ enum NodeType : unsigned {
   VMSET_VL,
 
   // Matches the semantics of vrgather.vx and vrgather.vv with extra operands
-  // for passthru and VL. Operands are (src, index, mask, passthru, vl).
+  // for passthru and VL, except that out of bound indices result in a poison
+  // result not zero.  Operands are (src, index, mask, passthru, vl).
   VRGATHER_VX_VL,
   VRGATHER_VV_VL,
   VRGATHEREI16_VV_VL,
diff --git a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-int.ll b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-int.ll
index e6375e276d37f..185b8b6d03134 100644
--- a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-int.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-int.ll
@@ -1346,10 +1346,9 @@ define <4 x i16> @vmerge_2(<4 x i16> %x) {
 define <4 x i16> @vmerge_3(<4 x i16> %x) {
 ; CHECK-LABEL: vmerge_3:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, mu
+; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
 ; CHECK-NEXT:    vmv.v.i v0, 6
-; CHECK-NEXT:    vmv.v.i v9, 5
-; CHECK-NEXT:    vrgather.vi v8, v9, 1, v0.t
+; CHECK-NEXT:    vmerge.vim v8, v8, 5, v0
 ; CHECK-NEXT:    ret
    %s = shufflevector <4 x i16> %x, <4 x i16> <i16 poison, i16 5, i16 poison, i16 poison>, <4 x i32> <i32 0, i32 5, i32 5, i32 3>
    ret <4 x i16> %s

>From 3a2d9a7c1e73618ca77caa6455e9208ad3b16664 Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Fri, 11 Apr 2025 20:47:04 -0700
Subject: [PATCH 64/76] [clang][frontend] Expose
 `CompilerInstance::cloneForModuleCompile()` (#135405)

This PR exposes `cloneForModuleCompile()` as a public `CompilerInstance`
member function. This will be eventually used in the dependency scanner
to customize implicit module builds.
---
 .../include/clang/Frontend/CompilerInstance.h |  8 +++++
 clang/lib/Frontend/CompilerInstance.cpp       | 30 +++++++------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index 4960d40ca7c37..66f56932c51a3 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -871,6 +871,14 @@ class CompilerInstance : public ModuleLoader {
                                                  bool IsInclusionDirective);
 
 public:
+  /// Creates a new \c CompilerInstance for compiling a module.
+  ///
+  /// This takes care of creating appropriate \c FrontendInputFile for
+  /// public/private frameworks, inferred modules and such.
+  std::unique_ptr<CompilerInstance>
+  cloneForModuleCompile(SourceLocation ImportLoc, Module *Module,
+                        StringRef ModuleFileName);
+
   ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path,
                               Module::NameVisibilityKind Visibility,
                               bool IsInclusionDirective) override;
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 55265af90f917..eb138de9d20cc 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1335,23 +1335,15 @@ static OptionalFileEntryRef getPublicModuleMap(FileEntryRef File,
   return FileMgr.getOptionalFileRef(PublicFilename);
 }
 
-/// Creates a \c CompilerInstance for compiling a module.
-///
-/// This takes care of creating appropriate \c FrontendInputFile for
-/// public/private frameworks, inferred modules and such.
-static std::unique_ptr<CompilerInstance>
-createCompilerInstanceForModuleCompile(CompilerInstance &ImportingInstance,
-                                       SourceLocation ImportLoc, Module *Module,
-                                       StringRef ModuleFileName) {
+std::unique_ptr<CompilerInstance> CompilerInstance::cloneForModuleCompile(
+    SourceLocation ImportLoc, Module *Module, StringRef ModuleFileName) {
   StringRef ModuleName = Module->getTopLevelModuleName();
 
-  InputKind IK(getLanguageFromOptions(ImportingInstance.getLangOpts()),
-               InputKind::ModuleMap);
+  InputKind IK(getLanguageFromOptions(getLangOpts()), InputKind::ModuleMap);
 
   // Get or create the module map that we'll use to build this module.
-  ModuleMap &ModMap =
-      ImportingInstance.getPreprocessor().getHeaderSearchInfo().getModuleMap();
-  SourceManager &SourceMgr = ImportingInstance.getSourceManager();
+  ModuleMap &ModMap = getPreprocessor().getHeaderSearchInfo().getModuleMap();
+  SourceManager &SourceMgr = getSourceManager();
 
   if (FileID ModuleMapFID = ModMap.getContainingModuleMapFileID(Module);
       ModuleMapFID.isValid()) {
@@ -1372,8 +1364,8 @@ createCompilerInstanceForModuleCompile(CompilerInstance &ImportingInstance,
     // Canonicalize compilation to start with the public module map. This is
     // vital for submodules declarations in the private module maps to be
     // correctly parsed when depending on a top level module in the public one.
-    if (OptionalFileEntryRef PublicMMFile = getPublicModuleMap(
-            *ModuleMapFile, ImportingInstance.getFileManager()))
+    if (OptionalFileEntryRef PublicMMFile =
+            getPublicModuleMap(*ModuleMapFile, getFileManager()))
       ModuleMapFile = PublicMMFile;
 
     StringRef ModuleMapFilePath = ModuleMapFile->getNameAsRequested();
@@ -1387,7 +1379,7 @@ createCompilerInstanceForModuleCompile(CompilerInstance &ImportingInstance,
 
     // Use the module map where this module resides.
     return createCompilerInstanceForModuleCompileImpl(
-        ImportingInstance, ImportLoc, ModuleName,
+        *this, ImportLoc, ModuleName,
         FrontendInputFile(ModuleMapFilePath, IK, IsSystem),
         ModMap.getModuleMapFileForUniquing(Module)->getName(), ModuleFileName);
   }
@@ -1404,7 +1396,7 @@ createCompilerInstanceForModuleCompile(CompilerInstance &ImportingInstance,
   Module->print(OS);
 
   auto Instance = createCompilerInstanceForModuleCompileImpl(
-      ImportingInstance, ImportLoc, ModuleName,
+      *this, ImportLoc, ModuleName,
       FrontendInputFile(FakeModuleMapFile, IK, +Module->IsSystem),
       ModMap.getModuleMapFileForUniquing(Module)->getName(), ModuleFileName);
 
@@ -1465,8 +1457,8 @@ static bool compileModuleAndReadASTImpl(CompilerInstance &ImportingInstance,
                                         SourceLocation ModuleNameLoc,
                                         Module *Module,
                                         StringRef ModuleFileName) {
-  auto Instance = createCompilerInstanceForModuleCompile(
-      ImportingInstance, ModuleNameLoc, Module, ModuleFileName);
+  auto Instance = ImportingInstance.cloneForModuleCompile(ModuleNameLoc, Module,
+                                                          ModuleFileName);
 
   if (!compileModule(ImportingInstance, ModuleNameLoc,
                      Module->getTopLevelModuleName(), ModuleFileName,

>From fa4ac19f0fc937e30fd7711dad98d0fcdb34f8ba Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Fri, 11 Apr 2025 21:26:19 -0700
Subject: [PATCH 65/76] [BOLT] Accept PLT fall-throughs as valid traces
 (#129481)

We used to report PLT traces as invalid (mismatching disassembled
function contents) because PLT functions are marked as pseudo and
ignored, thus missing CFG. However, such traces are not mismatching
the function contents. Accept them without attaching the profile.

Test Plan: updated callcont-fallthru.s
---
 bolt/lib/Profile/DataAggregator.cpp | 19 ++++++++++++++-----
 bolt/test/X86/callcont-fallthru.s   | 10 ++++++++++
 bolt/test/link_fdata.py             | 11 ++++++++++-
 3 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index d20626bd5062f..f016576ff61af 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -871,11 +871,6 @@ DataAggregator::getFallthroughsInTrace(BinaryFunction &BF,
 
   BinaryContext &BC = BF.getBinaryContext();
 
-  if (!BF.isSimple())
-    return std::nullopt;
-
-  assert(BF.hasCFG() && "can only record traces in CFG state");
-
   // Offsets of the trace within this function.
   const uint64_t From = FirstLBR.To - BF.getAddress();
   const uint64_t To = SecondLBR.From - BF.getAddress();
@@ -883,6 +878,20 @@ DataAggregator::getFallthroughsInTrace(BinaryFunction &BF,
   if (From > To)
     return std::nullopt;
 
+  // Accept fall-throughs inside pseudo functions (PLT/thunks).
+  // This check has to be above BF.empty as pseudo functions would pass it:
+  // pseudo => ignored => CFG not built => empty.
+  // If we return nullopt, trace would be reported as mismatching disassembled
+  // function contents which it is not. To avoid this, return an empty
+  // fall-through list instead.
+  if (BF.isPseudo())
+    return Branches;
+
+  if (!BF.isSimple())
+    return std::nullopt;
+
+  assert(BF.hasCFG() && "can only record traces in CFG state");
+
   const BinaryBasicBlock *FromBB = BF.getBasicBlockContainingOffset(From);
   const BinaryBasicBlock *ToBB = BF.getBasicBlockContainingOffset(To);
 
diff --git a/bolt/test/X86/callcont-fallthru.s b/bolt/test/X86/callcont-fallthru.s
index 95cb4c5fc2df4..ee72d8f62e032 100644
--- a/bolt/test/X86/callcont-fallthru.s
+++ b/bolt/test/X86/callcont-fallthru.s
@@ -9,6 +9,7 @@
 # RUN: link_fdata %s %t %t.pa3 PREAGG3
 # RUN: link_fdata %s %t %t.pat PREAGGT1
 # RUN: link_fdata %s %t %t.pat2 PREAGGT2
+# RUN: link_fdata %s %t %t.patplt PREAGGPLT
 
 ## Check normal case: fallthrough is not LP or secondary entry.
 # RUN: llvm-strip --strip-unneeded %t -o %t.strip
@@ -42,6 +43,12 @@
 # RUN: llvm-bolt %t.strip --pa -p %t.pat2 -o %t.out \
 # RUN:   --print-cfg --print-only=main | FileCheck %s --check-prefix=CHECK3
 
+## Check pre-aggregated traces don't report zero-sized PLT fall-through as
+## invalid trace
+# RUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
+# RUN:   --check-prefix=CHECK-PLT
+# CHECK-PLT: traces mismatching disassembled function contents: 0
+
   .globl foo
   .type foo, %function
 foo:
@@ -65,7 +72,10 @@ main:
 	movl	$0x0, -0x4(%rbp)
 	movl	%edi, -0x8(%rbp)
 	movq	%rsi, -0x10(%rbp)
+Ltmp0_br:
 	callq	puts at PLT
+## Check PLT traces are accepted
+# PREAGGPLT: T #Ltmp0_br# #puts at plt# #puts at plt# 3
 ## Target is an external-origin call continuation
 # PREAGG1: B X:0 #Ltmp1# 2 0
 # PREAGGT1: T X:0 #Ltmp1# #Ltmp4_br# 2
diff --git a/bolt/test/link_fdata.py b/bolt/test/link_fdata.py
index 028823a69ce00..f1d83458346d6 100755
--- a/bolt/test/link_fdata.py
+++ b/bolt/test/link_fdata.py
@@ -8,6 +8,7 @@
 """
 
 import argparse
+import os
 import subprocess
 import sys
 import re
@@ -84,8 +85,16 @@
             exit("ERROR: unexpected input:\n%s" % line)
 
 # Read nm output: <symbol value> <symbol type> <symbol name>
+is_llvm_nm = os.path.basename(args.nmtool) == "llvm-nm"
 nm_output = subprocess.run(
-    [args.nmtool, "--defined-only", args.objfile], text=True, capture_output=True
+    [
+        args.nmtool,
+        "--defined-only",
+        "--special-syms" if is_llvm_nm else "--synthetic",
+        args.objfile,
+    ],
+    text=True,
+    capture_output=True,
 ).stdout
 # Populate symbol map
 symbols = {}

>From 6bea80e93fcba89a6b3a8312cc0a3c3f528b284a Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 11 Apr 2025 19:55:16 -0700
Subject: [PATCH 66/76] [TableGen] Remove unneeded FIXME. NFC

The message looks correct to me.
---
 llvm/utils/TableGen/PseudoLoweringEmitter.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
index 6d39d1496c09e..8408ac77cdad9 100644
--- a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
+++ b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
@@ -90,7 +90,6 @@ unsigned PseudoLoweringEmitter::addDagOperandMapping(
       // problem.
       // FIXME: We probably shouldn't ever get a non-zero BaseIdx here.
       assert(BaseIdx == 0 && "Named subargument in pseudo expansion?!");
-      // FIXME: Are the message operand types backward?
       if (DI->getDef() != Insn.Operands[BaseIdx + i].Rec) {
         PrintError(Rec, "In pseudo instruction '" + Rec->getName() +
                             "', operand type '" + DI->getDef()->getName() +

>From d49063b4962367bac52d4a3e2aa4ff324a7d8fbf Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Sat, 12 Apr 2025 00:49:23 -0400
Subject: [PATCH 67/76] [compiler-rt][sanitizer][NFC] update endif markers for
 Haiku (#135475)

---
 compiler-rt/lib/asan/asan_linux.cpp                         | 2 +-
 compiler-rt/lib/asan/asan_malloc_linux.cpp                  | 2 +-
 compiler-rt/lib/interception/interception_linux.cpp         | 2 +-
 compiler-rt/lib/interception/interception_linux.h           | 2 +-
 compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp        | 6 +++---
 compiler-rt/lib/sanitizer_common/sanitizer_linux.h          | 2 +-
 .../sanitizer_common/sanitizer_platform_limits_posix.cpp    | 2 +-
 .../lib/sanitizer_common/sanitizer_platform_limits_posix.h  | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/compiler-rt/lib/asan/asan_linux.cpp b/compiler-rt/lib/asan/asan_linux.cpp
index b5b4d88d1c3c2..d2c2a394b06c2 100644
--- a/compiler-rt/lib/asan/asan_linux.cpp
+++ b/compiler-rt/lib/asan/asan_linux.cpp
@@ -288,4 +288,4 @@ bool HandleDlopenInit() {
 }  // namespace __asan
 
 #endif  // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_SOLARIS || SANITIZER_HAIKU
diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cpp b/compiler-rt/lib/asan/asan_malloc_linux.cpp
index cbcdd9c1be29d..3f023d4c2ed0a 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cpp
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cpp
@@ -217,4 +217,4 @@ void ReplaceSystemMalloc() {
 #endif  // SANITIZER_ANDROID
 
 #endif  // SANITIZER_FREEBSD || SANITIZER_FUCHSIA || SANITIZER_LINUX ||
-        // SANITIZER_NETBSD || SANITIZER_SOLARIS
+        // SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU
diff --git a/compiler-rt/lib/interception/interception_linux.cpp b/compiler-rt/lib/interception/interception_linux.cpp
index 0a6659d38ae83..f900ae6a593bd 100644
--- a/compiler-rt/lib/interception/interception_linux.cpp
+++ b/compiler-rt/lib/interception/interception_linux.cpp
@@ -80,4 +80,4 @@ bool InterceptFunction(const char *name, const char *ver, uptr *ptr_to_real,
 }  // namespace __interception
 
 #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_SOLARIS || SANITIZER_HAIKU
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h
index 52e34d535030e..0958ffe3fecc1 100644
--- a/compiler-rt/lib/interception/interception_linux.h
+++ b/compiler-rt/lib/interception/interception_linux.h
@@ -52,4 +52,4 @@ bool InterceptFunction(const char *name, const char *ver, uptr *ptr_to_real,
 
 #endif  // INTERCEPTION_LINUX_H
 #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_SOLARIS || SANITIZER_HAIKU
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index a06682c3bbe56..4446823c47d22 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -606,7 +606,7 @@ uptr internal_execve(const char *filename, char *const argv[],
   return internal_syscall(SYSCALL(execve), (uptr)filename, (uptr)argv,
                           (uptr)envp);
 }
-#  endif  // !SANITIZER_SOLARIS && !SANITIZER_NETBSD
+#  endif  // !SANITIZER_SOLARIS && !SANITIZER_NETBSD && !SANITIZER_HAIKU
 
 #  if !SANITIZER_NETBSD && !SANITIZER_HAIKU
 void internal__exit(int exitcode) {
@@ -617,7 +617,7 @@ void internal__exit(int exitcode) {
 #    endif
   Die();  // Unreachable.
 }
-#  endif  // !SANITIZER_NETBSD
+#  endif  // !SANITIZER_NETBSD && !SANITIZER_HAIKU
 
 // ----------------- sanitizer_common.h
 bool FileExists(const char *filename) {
@@ -807,7 +807,7 @@ static void GetArgsAndEnv(char ***argv, char ***envp) {
 #    if !SANITIZER_GO
   }
 #    endif  // !SANITIZER_GO
-#  endif    // SANITIZER_FREEBSD
+#  endif    // SANITIZER_HAIKU
 }
 
 char **GetArgv() {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
index c1562506babf3..6959f785990f9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
@@ -48,7 +48,7 @@ struct MemoryMappingLayoutData {
 };
 
 void ReadProcMaps(ProcSelfMapsBuff *proc_maps);
-#  endif
+#  endif  // SANITIZER_HAIKU
 
 // Syscall wrappers.
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index edb619f4ddafa..b4d87ab6228e5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -367,7 +367,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
 
 #  if !SANITIZER_ANDROID && !SANITIZER_HAIKU
   const int wordexp_wrde_dooffs = WRDE_DOOFFS;
-#  endif  // !SANITIZER_ANDROID
+#  endif  // !SANITIZER_ANDROID && !SANITIZER_HAIKU
 
 #  if SANITIZER_LINUX && !SANITIZER_ANDROID &&                               \
       (defined(__i386) || defined(__x86_64) || defined(__mips64) ||          \
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 26de940f931b5..348bb4f27aec3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1567,6 +1567,6 @@ extern const int si_SEGV_ACCERR;
 typedef void *__sanitizer_timer_t;
 #  endif
 
-#endif  // SANITIZER_LINUX || SANITIZER_APPLE
+#endif  // SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU
 
 #endif

>From 7a6a79551d1bf5468f925ffcaa3d62807cca1aaa Mon Sep 17 00:00:00 2001
From: donald chen <chenxunyu1993 at gmail.com>
Date: Sat, 12 Apr 2025 13:08:50 +0800
Subject: [PATCH 68/76] [NFC][equivalenceClass] Refactor coding style in
 EquivalenceClasses.h. (#135467)

---
 llvm/include/llvm/ADT/EquivalenceClasses.h | 36 +++++++++++++---------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index 0d44d2c79dd2e..fed012ce56005 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -79,11 +79,15 @@ template <class ElemTy> class EquivalenceClasses {
     // ECValue ctor - Start out with EndOfList pointing to this node, Next is
     // Null, isLeader = true.
     ECValue(const ElemTy &Elt)
-      : Leader(this), Next((ECValue*)(intptr_t)1), Data(Elt) {}
+        : Leader(this),
+          Next(reinterpret_cast<ECValue *>(static_cast<intptr_t>(1))),
+          Data(Elt) {}
 
     const ECValue *getLeader() const {
-      if (isLeader()) return this;
-      if (Leader->isLeader()) return Leader;
+      if (isLeader())
+        return this;
+      if (Leader->isLeader())
+        return Leader;
       // Path compression.
       return Leader = Leader->getLeader();
     }
@@ -95,12 +99,16 @@ template <class ElemTy> class EquivalenceClasses {
 
     void setNext(const ECValue *NewNext) const {
       assert(getNext() == nullptr && "Already has a next pointer!");
-      Next = (const ECValue*)((intptr_t)NewNext | (intptr_t)isLeader());
+      Next = reinterpret_cast<const ECValue *>(
+          reinterpret_cast<intptr_t>(NewNext) |
+          static_cast<intptr_t>(isLeader()));
     }
 
   public:
-    ECValue(const ECValue &RHS) : Leader(this), Next((ECValue*)(intptr_t)1),
-                                  Data(RHS.Data) {
+    ECValue(const ECValue &RHS)
+        : Leader(this),
+          Next(reinterpret_cast<ECValue *>(static_cast<intptr_t>(1))),
+          Data(RHS.Data) {
       // Only support copying of singleton nodes.
       assert(RHS.isLeader() && RHS.getNext() == nullptr && "Not a singleton!");
     }
@@ -109,7 +117,8 @@ template <class ElemTy> class EquivalenceClasses {
     const ElemTy &getData() const { return Data; }
 
     const ECValue *getNext() const {
-      return (ECValue*)((intptr_t)Next & ~(intptr_t)1);
+      return reinterpret_cast<ECValue *>(reinterpret_cast<intptr_t>(Next) &
+                                         ~static_cast<intptr_t>(1));
     }
   };
 
@@ -124,9 +133,7 @@ template <class ElemTy> class EquivalenceClasses {
 
 public:
   EquivalenceClasses() = default;
-  EquivalenceClasses(const EquivalenceClasses &RHS) {
-    operator=(RHS);
-  }
+  EquivalenceClasses(const EquivalenceClasses &RHS) { operator=(RHS); }
 
   EquivalenceClasses &operator=(const EquivalenceClasses &RHS) {
     TheMapping.clear();
@@ -160,9 +167,7 @@ template <class ElemTy> class EquivalenceClasses {
     return member_iterator(ECV.isLeader() ? &ECV : nullptr);
   }
 
-  member_iterator member_end() const {
-    return member_iterator(nullptr);
-  }
+  member_iterator member_end() const { return member_iterator(nullptr); }
 
   iterator_range<member_iterator> members(const ECValue &ECV) const {
     return make_range(member_begin(ECV), member_end());
@@ -294,7 +299,8 @@ template <class ElemTy> class EquivalenceClasses {
   }
   member_iterator unionSets(member_iterator L1, member_iterator L2) {
     assert(L1 != member_end() && L2 != member_end() && "Illegal inputs!");
-    if (L1 == L2) return L1;   // Unifying the same two sets, noop.
+    if (L1 == L2)
+      return L1; // Unifying the same two sets, noop.
 
     // Otherwise, this is a real union operation.  Set the end of the L1 list to
     // point to the L2 leader node.
@@ -350,7 +356,7 @@ template <class ElemTy> class EquivalenceClasses {
       return *this;
     }
 
-    member_iterator operator++(int) {    // postincrement operators.
+    member_iterator operator++(int) { // postincrement operators.
       member_iterator tmp = *this;
       ++*this;
       return tmp;

>From b864405c9b848d6815ac4562fe3680c5ce8d90ff Mon Sep 17 00:00:00 2001
From: Fangrui Song <i at maskray.me>
Date: Fri, 11 Apr 2025 22:09:23 -0700
Subject: [PATCH 69/76] MCAsmInfo: Remove unused UseParensForDollarSignNames

Follow-up to 3acccf042ab8a7b7e663bb2b2fac328d9bf65b38
---
 llvm/include/llvm/MC/MCAsmInfo.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index ec27a47e36820..950dc952d0b44 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -387,10 +387,6 @@ class MCAsmInfo {
   /// directives, e.g. .word foo(got).
   bool UseParensForSpecifier = false;
 
-  /// True if the target uses parens for symbol names starting with
-  /// '$' character to distinguish them from absolute names.
-  bool UseParensForDollarSignNames = true;
-
   /// True if the target supports flags in ".loc" directive, false if only
   /// location is allowed.
   bool SupportsExtendedDwarfLocDirective = true;

>From 339f58de16ac7a31869d189bec6cad7696958546 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 12 Apr 2025 05:21:26 +0000
Subject: [PATCH 70/76] [Github] Add llvm-symbolizer to CI container

This is needed for symbolizing some test failures. It is under 8MB, so there is
very little cost to adding it.
---
 .github/workflows/containers/github-action-ci/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/containers/github-action-ci/Dockerfile b/.github/workflows/containers/github-action-ci/Dockerfile
index e1e9827737adb..60f47653a078f 100644
--- a/.github/workflows/containers/github-action-ci/Dockerfile
+++ b/.github/workflows/containers/github-action-ci/Dockerfile
@@ -32,7 +32,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
   -DLLVM_ENABLE_RUNTIMES="compiler-rt" \
   -DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
   -DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
-  -DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build" \
+  -DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build;llvm-symbolizer" \
   -DCLANG_DEFAULT_LINKER="lld"
 
 RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution

>From 76e07d8ba5286daf349ef19588c8c011162bec09 Mon Sep 17 00:00:00 2001
From: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: Sat, 12 Apr 2025 15:11:54 +0800
Subject: [PATCH 71/76] [LibCall] Infer nocallback for libcalls (#135173)

This patch adds `nocallback` attributes for string/math libcalls. It
allows FuncAttributor to infer `norecurse` more precisely and encourages
more aggressive global optimization.
---
 llvm/lib/Transforms/Utils/BuildLibCalls.cpp   | 39 ++++++++++++++++++-
 .../Transforms/InferFunctionAttrs/annotate.ll | 37 +++++++++---------
 .../readonly_and_writeonly.ll                 |  2 +-
 llvm/test/Transforms/LICM/strlen.ll           |  2 +-
 llvm/test/Transforms/LoopIdiom/basic.ll       |  3 +-
 .../LoopIdiom/memset-pattern-tbaa.ll          |  2 +-
 .../Transforms/LoopIdiom/struct_pattern.ll    |  2 +-
 .../Transforms/LoopIdiom/unroll-custom-dl.ll  |  2 +-
 llvm/test/Transforms/LoopIdiom/unroll.ll      |  2 +-
 .../X86/memset-pattern.ll                     |  2 +-
 10 files changed, 65 insertions(+), 28 deletions(-)

diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index 24eefc91117b4..a5f6047b0b7ae 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -47,6 +47,7 @@ STATISTIC(
     NumWriteArgumentMemOrErrnoMemOnly,
     "Number of functions inferred as memory(argmem: write, errnomem: write)");
 STATISTIC(NumNoUnwind, "Number of functions inferred as nounwind");
+STATISTIC(NumNoCallback, "Number of functions inferred as nocallback");
 STATISTIC(NumNoCapture, "Number of arguments inferred as nocapture");
 STATISTIC(NumWriteOnlyArg, "Number of arguments inferred as writeonly");
 STATISTIC(NumReadOnlyArg, "Number of arguments inferred as readonly");
@@ -148,6 +149,14 @@ static bool setDoesNotThrow(Function &F) {
   return true;
 }
 
+static bool setDoesNotCallback(Function &F) {
+  if (F.hasFnAttribute(Attribute::NoCallback))
+    return false;
+  F.addFnAttr(Attribute::NoCallback);
+  ++NumNoCallback;
+  return true;
+}
+
 static bool setRetDoesNotAlias(Function &F) {
   if (F.hasRetAttribute(Attribute::NoAlias))
     return false;
@@ -322,6 +331,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_wcslen:
     Changed |= setOnlyReadsMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
@@ -331,6 +341,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     break;
   case LibFunc_strtol:
@@ -341,6 +352,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_strtold:
   case LibFunc_strtoull:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 1);
     Changed |= setOnlyReadsMemory(F, 0);
@@ -349,6 +361,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_strncat:
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setReturnedArg(F, 0);
     Changed |= setDoesNotCapture(F, 1);
@@ -364,6 +377,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_stpncpy:
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 1);
     Changed |= setOnlyWritesMemory(F, 0);
@@ -373,6 +387,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_strxfrm:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
     Changed |= setDoesNotCapture(F, 1);
@@ -383,6 +398,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_strncmp:     // 0,1
   case LibFunc_strcspn:     // 0,1
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setOnlyReadsMemory(F);
@@ -396,6 +412,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     // global memory.
     Changed |= setOnlyReadsMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
     Changed |= setDoesNotCapture(F, 1);
@@ -405,12 +422,14 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 1);
     break;
   case LibFunc_strtok:
   case LibFunc_strtok_r:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 1);
     Changed |= setOnlyReadsMemory(F, 1);
@@ -509,6 +528,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
     Changed |= setDoesNotCapture(F, 1);
@@ -516,6 +536,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_memchr:
   case LibFunc_memrchr:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setWillReturn(F);
@@ -524,6 +545,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_modff:
   case LibFunc_modfl:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyWritesMemory(F);
@@ -531,6 +553,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_memcpy:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotAlias(F, 0);
@@ -542,6 +565,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_memmove:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setReturnedArg(F, 0);
@@ -555,6 +579,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     [[fallthrough]];
   case LibFunc_memcpy_chk:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setDoesNotAlias(F, 0);
     Changed |= setOnlyWritesMemory(F, 0);
@@ -657,6 +682,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_bcopy:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
@@ -666,6 +692,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_bcmp:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setWillReturn(F);
@@ -674,6 +701,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_bzero:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
@@ -710,6 +738,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_atof:
   case LibFunc_atoll:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setOnlyReadsMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setDoesNotCapture(F, 0);
@@ -787,6 +816,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_frexpf:
   case LibFunc_frexpl:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setWillReturn(F);
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyWritesMemory(F);
@@ -1025,6 +1055,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_ntohl:
   case LibFunc_ntohs:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setDoesNotAccessMemory(F);
     break;
   case LibFunc_lstat:
@@ -1041,7 +1072,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyReadsMemory(F, 0);
     break;
   case LibFunc_qsort:
-    // May throw; places call through function pointer.
+    // May throw/callback; places call through function pointer.
     // Cannot give undef pointer/size
     Changed |= setRetAndArgsNoUndef(F);
     Changed |= setDoesNotCapture(F, 3);
@@ -1058,6 +1089,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     break;
   case LibFunc_dunder_strtok_r:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setDoesNotCapture(F, 1);
     Changed |= setOnlyReadsMemory(F, 1);
     break;
@@ -1149,6 +1181,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setOnlyAccessesArgMemory(F);
     Changed |= setOnlyWritesMemory(F, 0);
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     break;
   case LibFunc_abort:
     Changed |= setIsCold(F);
@@ -1156,6 +1189,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setDoesNotThrow(F);
     break;
   case LibFunc_terminate:
+    // May callback; terminate_handler may be called
     Changed |= setIsCold(F);
     Changed |= setNoReturn(F);
     break;
@@ -1284,6 +1318,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_tanhl:
   case LibFunc_tanl:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setDoesNotFreeMemory(F);
     Changed |= setWillReturn(F);
     Changed |= setOnlyWritesErrnoMemory(F);
@@ -1327,6 +1362,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_isascii:
   case LibFunc_isdigit:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setDoesNotFreeMemory(F);
     Changed |= setWillReturn(F);
     break;
@@ -1340,6 +1376,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
   case LibFunc_remquof:
   case LibFunc_remquol:
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotCallback(F);
     Changed |= setDoesNotFreeMemory(F);
     Changed |= setOnlyWritesMemory(F, 2);
     Changed |= setDoesNotCapture(F, 2);
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index 55896b72d3a57..9e56b01c6b315 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -1038,34 +1038,34 @@ declare i64 @strspn(ptr, ptr)
 ; CHECK: declare ptr @strstr(ptr, ptr captures(none)) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]]
 declare ptr @strstr(ptr, ptr)
 
-; CHECK: declare double @strtod(ptr readonly, ptr captures(none)) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare double @strtod(ptr readonly, ptr captures(none)) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
 declare double @strtod(ptr, ptr)
 
-; CHECK: declare float @strtof(ptr readonly, ptr captures(none)) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare float @strtof(ptr readonly, ptr captures(none)) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare float @strtof(ptr, ptr)
 
-; CHECK: declare ptr @strtok(ptr, ptr readonly captures(none)) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare ptr @strtok(ptr, ptr readonly captures(none)) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare ptr @strtok(ptr, ptr)
 
-; CHECK: declare ptr @strtok_r(ptr, ptr readonly captures(none), ptr) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare ptr @strtok_r(ptr, ptr readonly captures(none), ptr) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare ptr @strtok_r(ptr, ptr, ptr)
 
-; CHECK: declare i64 @strtol(ptr readonly, ptr captures(none), i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @strtol(ptr readonly, ptr captures(none), i32) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare i64 @strtol(ptr, ptr, i32)
 
-; CHECK: declare x86_fp80 @strtold(ptr readonly, ptr captures(none)) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare x86_fp80 @strtold(ptr readonly, ptr captures(none)) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare x86_fp80 @strtold(ptr, ptr)
 
-; CHECK: declare i64 @strtoll(ptr readonly, ptr captures(none), i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @strtoll(ptr readonly, ptr captures(none), i32) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare i64 @strtoll(ptr, ptr, i32)
 
-; CHECK: declare i64 @strtoul(ptr readonly, ptr captures(none), i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @strtoul(ptr readonly, ptr captures(none), i32) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare i64 @strtoul(ptr, ptr, i32)
 
-; CHECK: declare i64 @strtoull(ptr readonly, ptr captures(none), i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @strtoull(ptr readonly, ptr captures(none), i32) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare i64 @strtoull(ptr, ptr, i32)
 
-; CHECK: declare i64 @strxfrm(ptr captures(none), ptr readonly captures(none), i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @strxfrm(ptr captures(none), ptr readonly captures(none), i64) [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]]
 declare i64 @strxfrm(ptr, ptr, i64)
 
 ; CHECK: declare noundef i32 @system(ptr noundef readonly captures(none)) [[NOFREE]]
@@ -1182,21 +1182,22 @@ declare void @memset_pattern8(ptr, ptr, i64)
 declare void @memset_pattern16(ptr, ptr, i64)
 
 ; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn }
-; CHECK-DAG: attributes [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
-; CHECK-DAG: attributes [[ARGMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(argmem: write, errnomem: write) }
-; CHECK-DAG: attributes [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(errnomem: write) }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] = { mustprogress nofree nounwind willreturn memory(argmem: write) }
+; CHECK-DAG: attributes [[NOCALLBACK_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn }
+; CHECK-DAG: attributes [[MEMNONE_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
+; CHECK-DAG: attributes [[ARGMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write, errnomem: write) }
+; CHECK-DAG: attributes [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(errnomem: write) }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
 ; CHECK-DAG: attributes [[NOFREE_NOUNWIND]] = { nofree nounwind }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized,aligned") allocsize(1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCZEROED_ALLOCSIZE01_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(read) }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(read) }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY]] = { nofree nounwind memory(read) }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(argmem: read) }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: read) }
 ; CHECK-DAG: attributes [[NOFREE]] = { nofree }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND]] = { nofree nounwind memory(argmem: readwrite) }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND]] = { nocallback nofree nounwind memory(argmem: readwrite) }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE12_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1,2) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
 ; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
diff --git a/llvm/test/Transforms/InferFunctionAttrs/readonly_and_writeonly.ll b/llvm/test/Transforms/InferFunctionAttrs/readonly_and_writeonly.ll
index c1a5f11cf94ab..895ae2069fcaa 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/readonly_and_writeonly.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/readonly_and_writeonly.ll
@@ -5,4 +5,4 @@
 ; CHECK: declare double @acos(double) [[NOFREE_NOUNWIND_WILLRETURN_READNONE:#[0-9]+]]
 declare double @acos(double) readonly
 
-; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN_READNONE]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
+; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN_READNONE]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
diff --git a/llvm/test/Transforms/LICM/strlen.ll b/llvm/test/Transforms/LICM/strlen.ll
index e758b2f86cdd4..009725c30afe7 100644
--- a/llvm/test/Transforms/LICM/strlen.ll
+++ b/llvm/test/Transforms/LICM/strlen.ll
@@ -13,7 +13,7 @@ loop:
 }
 
 ; CHECK: declare i64 @strlen(ptr captures(none)) #0
-; CHECK: attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) }
+; CHECK: attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: read) }
 declare i64 @strlen(ptr)
 
 
diff --git a/llvm/test/Transforms/LoopIdiom/basic.ll b/llvm/test/Transforms/LoopIdiom/basic.ll
index e6fc11625317b..45af783026575 100644
--- a/llvm/test/Transforms/LoopIdiom/basic.ll
+++ b/llvm/test/Transforms/LoopIdiom/basic.ll
@@ -1625,6 +1625,5 @@ define noalias ptr @_ZN8CMSPULog9beginImplEja(ptr nocapture writeonly %0) local_
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nounwind }
 ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR4:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
-; CHECK: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
 ;.
diff --git a/llvm/test/Transforms/LoopIdiom/memset-pattern-tbaa.ll b/llvm/test/Transforms/LoopIdiom/memset-pattern-tbaa.ll
index 57a91a3bf6e2c..9bbc732f8d07d 100644
--- a/llvm/test/Transforms/LoopIdiom/memset-pattern-tbaa.ll
+++ b/llvm/test/Transforms/LoopIdiom/memset-pattern-tbaa.ll
@@ -116,7 +116,7 @@ for.body:
 !21 = !{!22, !20, i64 0}
 !22 = !{!"B", !20, i64 0}
 ;.
-; CHECK: attributes #[[ATTR0:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ;.
 ; CHECK: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
 ; CHECK: [[META1]] = !{!"double", [[META2:![0-9]+]], i64 0}
diff --git a/llvm/test/Transforms/LoopIdiom/struct_pattern.ll b/llvm/test/Transforms/LoopIdiom/struct_pattern.ll
index b65e95353ab3e..b4ce766fdd73b 100644
--- a/llvm/test/Transforms/LoopIdiom/struct_pattern.ll
+++ b/llvm/test/Transforms/LoopIdiom/struct_pattern.ll
@@ -292,5 +292,5 @@ for.end:                                          ; preds = %for.end.loopexit, %
 }
 ;.
 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind ssp }
-; CHECK: attributes #[[ATTR1:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ;.
diff --git a/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll b/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll
index a3b421907885b..bca922094eebb 100644
--- a/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll
+++ b/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll
@@ -126,5 +126,5 @@ for.end:                                          ; preds = %for.end.loopexit, %
 ;.
 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind ssp }
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ;.
diff --git a/llvm/test/Transforms/LoopIdiom/unroll.ll b/llvm/test/Transforms/LoopIdiom/unroll.ll
index c70eeefd6376d..621082b9eeb6f 100644
--- a/llvm/test/Transforms/LoopIdiom/unroll.ll
+++ b/llvm/test/Transforms/LoopIdiom/unroll.ll
@@ -130,5 +130,5 @@ for.end:                                          ; preds = %for.end.loopexit, %
 ;.
 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind ssp }
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ;.
diff --git a/llvm/test/Transforms/PreISelIntrinsicLowering/X86/memset-pattern.ll b/llvm/test/Transforms/PreISelIntrinsicLowering/X86/memset-pattern.ll
index d7798218b498f..64cc4ba281635 100644
--- a/llvm/test/Transforms/PreISelIntrinsicLowering/X86/memset-pattern.ll
+++ b/llvm/test/Transforms/PreISelIntrinsicLowering/X86/memset-pattern.ll
@@ -220,7 +220,7 @@ define void @memset_pattern_i64_x_fromnonconstptr(ptr %a, i64 %x, ptr %p) nounwi
 ;.
 ; CHECK: attributes #[[ATTR0]] = { nounwind }
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
-; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
 ;.
 ; CHECK: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
 ; CHECK: [[META1]] = !{!"double", [[META2:![0-9]+]], i64 0}

>From 8b40a09bf50d62e2017611b7be2c55fab22d9572 Mon Sep 17 00:00:00 2001
From: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: Sat, 12 Apr 2025 15:35:45 +0800
Subject: [PATCH 72/76] [Clang][CodeGen][UBSan] Remove redundant
 `EmitCheckValue` calls. NFCI (#135141)

`EmitCheckValue` is called inside `EmitCheck`:

https://github.com/llvm/llvm-project/blob/b122956390a6877536927c2b073a0b99f8b9704f/clang/lib/CodeGen/CGExpr.cpp#L3739
The outside calls are redundant because
`EmitCheckValue(EmitCheckValue(V))` always returns `EmitCheckValue(V)`.

Required by https://github.com/llvm/llvm-project/pull/135135.
---
 clang/lib/CodeGen/CGExpr.cpp                  |  2 +-
 clang/lib/CodeGen/CodeGenFunction.cpp         |  4 +---
 .../catch-alignment-assumption-array.c        |  2 +-
 ...mption-attribute-align_value-on-lvalue.cpp |  2 +-
 ...tion-attribute-align_value-on-paramvar.cpp |  2 +-
 ...ibute-alloc_align-on-function-variable.cpp | 23 +++++++++----------
 ...tion-attribute-alloc_align-on-function.cpp | 23 +++++++++----------
 ...-assume_aligned-on-function-two-params.cpp |  2 +-
 ...n-attribute-assume_aligned-on-function.cpp |  2 +-
 ...on-builtin_assume_aligned-polymorphism.cpp |  2 +-
 ...n_assume_aligned-three-params-variable.cpp |  2 +-
 ...on-builtin_assume_aligned-three-params.cpp |  2 +-
 ...tion-builtin_assume_aligned-two-params.cpp |  2 +-
 .../catch-alignment-assumption-openmp.cpp     |  2 +-
 14 files changed, 34 insertions(+), 38 deletions(-)

diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 4d6e776f42660..5f028f6d8c6ac 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -1966,7 +1966,7 @@ bool CodeGenFunction::EmitScalarRangeCheck(llvm::Value *Value, QualType Ty,
   SanitizerKind::SanitizerOrdinal Kind =
       NeedsEnumCheck ? SanitizerKind::SO_Enum : SanitizerKind::SO_Bool;
   EmitCheck(std::make_pair(Check, Kind), SanitizerHandler::LoadInvalidValue,
-            StaticArgs, EmitCheckValue(Value));
+            StaticArgs, Value);
   return true;
 }
 
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 232d48141a0c0..4d29ceace646f 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -3197,9 +3197,7 @@ void CodeGenFunction::emitAlignmentAssumptionCheck(
     llvm::Constant *StaticData[] = {EmitCheckSourceLocation(Loc),
                                     EmitCheckSourceLocation(SecondaryLoc),
                                     EmitCheckTypeDescriptor(Ty)};
-    llvm::Value *DynamicData[] = {EmitCheckValue(Ptr),
-                                  EmitCheckValue(Alignment),
-                                  EmitCheckValue(OffsetValue)};
+    llvm::Value *DynamicData[] = {Ptr, Alignment, OffsetValue};
     EmitCheck({std::make_pair(TheCheck, SanitizerKind::SO_Alignment)},
               SanitizerHandler::AlignmentAssumption, StaticData, DynamicData);
   }
diff --git a/clang/test/CodeGen/catch-alignment-assumption-array.c b/clang/test/CodeGen/catch-alignment-assumption-array.c
index 8a39355c0ba01..413068ecde42d 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-array.c
+++ b/clang/test/CodeGen/catch-alignment-assumption-array.c
@@ -16,9 +16,9 @@ void *caller(void) {
   // CHECK-SANITIZE-NEXT:               %[[PTRINT:.*]] = ptrtoint ptr %[[ARRAYDECAY]] to i64
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 0
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[ARRAYDECAY]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[ARRAYDECAY]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 1, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 1, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp
index b84fd628cf36b..785f2354b5679 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp
@@ -24,9 +24,9 @@ char **load_from_ac_struct(struct ac_struct *x) {
   // CHECK-SANITIZE-NEXT:               %[[PTRINT:.*]] = ptrtoint ptr %[[A]] to i64
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[A]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[A]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-paramvar.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-paramvar.cpp
index bd3c7555ca147..114de8962f306 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-paramvar.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-paramvar.cpp
@@ -16,9 +16,9 @@ char **passthrough(__attribute__((align_value(0x100000000))) char **x) {
   // CHECK-SANITIZE-NEXT:               %[[PTRINT:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
index bf5a150b58909..b43c2e9763d1a 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
@@ -34,11 +34,11 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[TMP2:%.*]] = sub i64 [[TMP1]], 1
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], [[TMP2]]
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-NORECOVER-NEXT:    [[TMP3:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-NORECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF3:![0-9]+]], !nosanitize !2
+// CHECK-SANITIZE-NORECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF2:![0-9]+]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-NORECOVER:       handler.alignment_assumption:
-// CHECK-SANITIZE-NORECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption_abort(ptr @[[GLOB1:[0-9]+]], i64 [[TMP3]], i64 [[TMP1]], i64 0) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-NORECOVER-NEXT:    unreachable, !nosanitize !2
+// CHECK-SANITIZE-NORECOVER-NEXT:    [[TMP3:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize [[META3]]
+// CHECK-SANITIZE-NORECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption_abort(ptr @[[GLOB1:[0-9]+]], i64 [[TMP3]], i64 [[TMP1]], i64 0) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-NORECOVER-NEXT:    unreachable, !nosanitize [[META3]]
 // CHECK-SANITIZE-NORECOVER:       cont:
 // CHECK-SANITIZE-NORECOVER-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 [[TMP1]]) ]
 // CHECK-SANITIZE-NORECOVER-NEXT:    ret ptr [[CALL]]
@@ -57,11 +57,11 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-RECOVER-NEXT:    [[TMP2:%.*]] = sub i64 [[TMP1]], 1
 // CHECK-SANITIZE-RECOVER-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], [[TMP2]]
 // CHECK-SANITIZE-RECOVER-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-RECOVER-NEXT:    [[TMP3:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-RECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF3:![0-9]+]], !nosanitize !2
+// CHECK-SANITIZE-RECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF2:![0-9]+]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-RECOVER:       handler.alignment_assumption:
-// CHECK-SANITIZE-RECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption(ptr @[[GLOB1:[0-9]+]], i64 [[TMP3]], i64 [[TMP1]], i64 0) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-RECOVER-NEXT:    br label [[CONT]], !nosanitize !2
+// CHECK-SANITIZE-RECOVER-NEXT:    [[TMP3:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize [[META3]]
+// CHECK-SANITIZE-RECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption(ptr @[[GLOB1:[0-9]+]], i64 [[TMP3]], i64 [[TMP1]], i64 0) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-RECOVER-NEXT:    br label [[CONT]], !nosanitize [[META3]]
 // CHECK-SANITIZE-RECOVER:       cont:
 // CHECK-SANITIZE-RECOVER-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 [[TMP1]]) ]
 // CHECK-SANITIZE-RECOVER-NEXT:    ret ptr [[CALL]]
@@ -80,11 +80,10 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-TRAP-NEXT:    [[TMP2:%.*]] = sub i64 [[TMP1]], 1
 // CHECK-SANITIZE-TRAP-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], [[TMP2]]
 // CHECK-SANITIZE-TRAP-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-TRAP-NEXT:    [[TMP3:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-TRAP-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[TRAP:%.*]], !nosanitize !2
+// CHECK-SANITIZE-TRAP-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[TRAP:%.*]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-TRAP:       trap:
-// CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.ubsantrap(i8 23) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-TRAP-NEXT:    unreachable, !nosanitize !2
+// CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.ubsantrap(i8 23) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-TRAP-NEXT:    unreachable, !nosanitize [[META3]]
 // CHECK-SANITIZE-TRAP:       cont:
 // CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 [[TMP1]]) ]
 // CHECK-SANITIZE-TRAP-NEXT:    ret ptr [[CALL]]
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
index 60a94c1067f51..5c7eeed1c8662 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
@@ -39,11 +39,11 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[PTRINT:%.*]] = ptrtoint ptr [[CALL]] to i64
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 127
 // CHECK-SANITIZE-NORECOVER-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-NORECOVER-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-NORECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF3:![0-9]+]], !nosanitize !2
+// CHECK-SANITIZE-NORECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF2:![0-9]+]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-NORECOVER:       handler.alignment_assumption:
-// CHECK-SANITIZE-NORECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption_abort(ptr @[[GLOB1:[0-9]+]], i64 [[TMP1]], i64 128, i64 0) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-NORECOVER-NEXT:    unreachable, !nosanitize !2
+// CHECK-SANITIZE-NORECOVER-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize [[META3]]
+// CHECK-SANITIZE-NORECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption_abort(ptr @[[GLOB1:[0-9]+]], i64 [[TMP1]], i64 128, i64 0) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-NORECOVER-NEXT:    unreachable, !nosanitize [[META3]]
 // CHECK-SANITIZE-NORECOVER:       cont:
 // CHECK-SANITIZE-NORECOVER-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 128) ]
 // CHECK-SANITIZE-NORECOVER-NEXT:    ret ptr [[CALL]]
@@ -58,11 +58,11 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-RECOVER-NEXT:    [[PTRINT:%.*]] = ptrtoint ptr [[CALL]] to i64
 // CHECK-SANITIZE-RECOVER-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 127
 // CHECK-SANITIZE-RECOVER-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-RECOVER-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-RECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF3:![0-9]+]], !nosanitize !2
+// CHECK-SANITIZE-RECOVER-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[HANDLER_ALIGNMENT_ASSUMPTION:%.*]], !prof [[PROF2:![0-9]+]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-RECOVER:       handler.alignment_assumption:
-// CHECK-SANITIZE-RECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption(ptr @[[GLOB1:[0-9]+]], i64 [[TMP1]], i64 128, i64 0) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-RECOVER-NEXT:    br label [[CONT]], !nosanitize !2
+// CHECK-SANITIZE-RECOVER-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize [[META3]]
+// CHECK-SANITIZE-RECOVER-NEXT:    call void @__ubsan_handle_alignment_assumption(ptr @[[GLOB1:[0-9]+]], i64 [[TMP1]], i64 128, i64 0) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-RECOVER-NEXT:    br label [[CONT]], !nosanitize [[META3]]
 // CHECK-SANITIZE-RECOVER:       cont:
 // CHECK-SANITIZE-RECOVER-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 128) ]
 // CHECK-SANITIZE-RECOVER-NEXT:    ret ptr [[CALL]]
@@ -77,11 +77,10 @@ passthrough(char **x, unsigned long alignment) {
 // CHECK-SANITIZE-TRAP-NEXT:    [[PTRINT:%.*]] = ptrtoint ptr [[CALL]] to i64
 // CHECK-SANITIZE-TRAP-NEXT:    [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 127
 // CHECK-SANITIZE-TRAP-NEXT:    [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
-// CHECK-SANITIZE-TRAP-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[CALL]] to i64, !nosanitize !2
-// CHECK-SANITIZE-TRAP-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[TRAP:%.*]], !nosanitize !2
+// CHECK-SANITIZE-TRAP-NEXT:    br i1 [[MASKCOND]], label [[CONT:%.*]], label [[TRAP:%.*]], !prof [[PROF2:![0-9]+]], !nosanitize [[META3:![0-9]+]]
 // CHECK-SANITIZE-TRAP:       trap:
-// CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.ubsantrap(i8 23) #[[ATTR3:[0-9]+]], !nosanitize !2
-// CHECK-SANITIZE-TRAP-NEXT:    unreachable, !nosanitize !2
+// CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.ubsantrap(i8 23) #[[ATTR3:[0-9]+]], !nosanitize [[META3]]
+// CHECK-SANITIZE-TRAP-NEXT:    unreachable, !nosanitize [[META3]]
 // CHECK-SANITIZE-TRAP:       cont:
 // CHECK-SANITIZE-TRAP-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[CALL]], i64 128) ]
 // CHECK-SANITIZE-TRAP-NEXT:    ret ptr [[CALL]]
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
index 3114bfa8e8702..dcc8fedb7b888 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
@@ -28,9 +28,9 @@ char **caller(char **x) {
   // CHECK-SANITIZE-NEXT:               %[[OFFSETPTR:.*]] = sub i64 %[[PTRINT]], 42
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RETURNED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RETURNED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 42){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 42){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp b/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
index 6c31fb26532bf..70084525751a7 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
@@ -28,9 +28,9 @@ char **caller(char **x) {
   // CHECK-SANITIZE-NEXT:               %[[PTRINT:.*]] = ptrtoint ptr %[[X_RETURNED]] to i64
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 127
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RETURNED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RETURNED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 128, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 128, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-polymorphism.cpp b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-polymorphism.cpp
index a5b969d3cbc0c..e40c0f3ce95d6 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-polymorphism.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-polymorphism.cpp
@@ -42,9 +42,9 @@ void *f(C *c) {
   // CHECK-SANITIZE-NEXT:                 %[[PTRINT:.*]] = ptrtoint ptr %[[CAST_RESULT]] to i64
   // CHECK-SANITIZE-NEXT:                 %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 7
   // CHECK-SANITIZE-NEXT:                 %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:                 %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[CAST_RESULT]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:                 br i1 %[[MASKCOND]], label %[[CONT1:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                    [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:      %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[CAST_RESULT]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 8, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:         call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 8, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:            call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
index 7ee9906e7c56d..01934010a4c08 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
@@ -19,9 +19,9 @@ void *caller(char **x, unsigned long offset) {
   // CHECK-SANITIZE-NEXT:               %[[OFFSETPTR:.*]] = sub i64 %[[PTRINT]], %[[OFFSET_RELOADED]]
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
index f5294f99dde42..5d5cef116b862 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
@@ -16,9 +16,9 @@ void *caller(char **x) {
   // CHECK-SANITIZE-NEXT:               %[[OFFSETPTR:.*]] = sub i64 %[[PTRINT]], 42
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 42){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 42){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
index 7022653d06cb6..3934c41f58618 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
@@ -15,9 +15,9 @@ void *caller(char **x) {
   // CHECK-SANITIZE-NEXT:               %[[PTRINT:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64
   // CHECK-SANITIZE-NEXT:               %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 4294967295
   // CHECK-SANITIZE-NEXT:               %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[X_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize
diff --git a/clang/test/CodeGen/catch-alignment-assumption-openmp.cpp b/clang/test/CodeGen/catch-alignment-assumption-openmp.cpp
index 30ebeee2c18d7..aa29b9435b66b 100644
--- a/clang/test/CodeGen/catch-alignment-assumption-openmp.cpp
+++ b/clang/test/CodeGen/catch-alignment-assumption-openmp.cpp
@@ -15,9 +15,9 @@ void func(char *data) {
   // CHECK-SANITIZE-NEXT:   %[[PTRINT:.*]] = ptrtoint ptr %[[DATA_RELOADED]] to i64
   // CHECK-SANITIZE-NEXT:   %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 4294967295
   // CHECK-SANITIZE-NEXT:   %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
-  // CHECK-SANITIZE-NEXT:               %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[DATA_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NEXT:               br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
   // CHECK-SANITIZE:                  [[HANDLER_ALIGNMENT_ASSUMPTION]]:
+  // CHECK-SANITIZE-ANYRECOVER-NEXT:    %[[PTRINT_DUP:.*]] = ptrtoint ptr %[[DATA_RELOADED]] to i64, !nosanitize
   // CHECK-SANITIZE-NORECOVER-NEXT:     call void @__ubsan_handle_alignment_assumption_abort(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-RECOVER-NEXT:       call void @__ubsan_handle_alignment_assumption(ptr @[[LINE_100_ALIGNMENT_ASSUMPTION]], i64 %[[PTRINT_DUP]], i64 4294967296, i64 0){{.*}}, !nosanitize
   // CHECK-SANITIZE-TRAP-NEXT:          call void @llvm.ubsantrap(i8 23){{.*}}, !nosanitize

>From 4dd80b73b00c05cf3d0a29c736fa2dae8e64c780 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Sat, 12 Apr 2025 12:25:40 +0200
Subject: [PATCH 73/76] [SimplifyCFG] test for trunc condition (NFC)

---
 .../SimplifyCFG/fold-branch-to-common-dest.ll | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
index 9fb5164d44d45..37f48a9a7e03a 100644
--- a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
+++ b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
@@ -84,6 +84,37 @@ final_right:
   ret void
 }
 
+define void @one_pred_trunc_cond(i8 %v0, i8 %v1) {
+; CHECK-LABEL: @one_pred_trunc_cond(
+; CHECK-NEXT:  pred:
+; CHECK-NEXT:    [[C0:%.*]] = icmp eq i8 [[V0:%.*]], 0
+; CHECK-NEXT:    br i1 [[C0]], label [[DISPATCH:%.*]], label [[FINAL_RIGHT:%.*]]
+; CHECK:       dispatch:
+; CHECK-NEXT:    [[C1:%.*]] = trunc i8 [[V1:%.*]] to i1
+; CHECK-NEXT:    br i1 [[C1]], label [[FINAL_LEFT:%.*]], label [[FINAL_RIGHT]]
+; CHECK:       common.ret:
+; CHECK-NEXT:    ret void
+; CHECK:       final_left:
+; CHECK-NEXT:    call void @sideeffect0()
+; CHECK-NEXT:    br label [[COMMON_RET:%.*]]
+; CHECK:       final_right:
+; CHECK-NEXT:    call void @sideeffect1()
+; CHECK-NEXT:    br label [[COMMON_RET]]
+;
+pred:
+  %c0 = icmp eq i8 %v0, 0
+  br i1 %c0, label %dispatch, label %final_right
+dispatch:
+  %c1 = trunc i8 %v1 to i1
+  br i1 %c1, label %final_left, label %final_right
+final_left:
+  call void @sideeffect0()
+  ret void
+final_right:
+  call void @sideeffect1()
+  ret void
+}
+
 ; More complex case, there's an extra op that is safe to execute unconditionally.
 
 define void @one_pred_with_extra_op(i8 %v0, i8 %v1) {

>From 2b270df2e7be5deef5d471b7624363d9b48b4480 Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek at codeweavers.com>
Date: Sat, 12 Apr 2025 13:24:45 +0200
Subject: [PATCH 74/76] [Object][COFF] Avoid underscore prefix for forwarding
 exports (#135433)

Fixes #132411.
---
 lld/test/COFF/export-alias.test          | 16 ++++++++++++++++
 llvm/lib/Object/COFFModuleDefinition.cpp |  5 ++++-
 llvm/test/tools/llvm-lib/underscore.test | 23 +++++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 lld/test/COFF/export-alias.test
 create mode 100644 llvm/test/tools/llvm-lib/underscore.test

diff --git a/lld/test/COFF/export-alias.test b/lld/test/COFF/export-alias.test
new file mode 100644
index 0000000000000..a13fdf1504fb2
--- /dev/null
+++ b/lld/test/COFF/export-alias.test
@@ -0,0 +1,16 @@
+; REQUIRES: x86
+
+; RUN: echo > %t.s
+; RUN: llvm-mc -filetype=obj -triple=i686-windows %t.s -o %t.obj
+; RUN: lld-link -machine:x86 -dll -noentry -safeseh:no -out:%t.dll -def:%s %t.obj
+; RUN: llvm-readobj --coff-exports %t.dll | FileCheck %s
+
+; CHECK:      Export {
+; CHECK-NEXT:   Ordinal: 1
+; CHECK-NEXT:   Name: func
+; CHECK-NEXT:   ForwardedTo: other.dll.func
+; CHECK-NEXT: }
+
+LIBRARY test.dll
+EXPORTS
+        func = other.dll.func
diff --git a/llvm/lib/Object/COFFModuleDefinition.cpp b/llvm/lib/Object/COFFModuleDefinition.cpp
index 82c18539658e8..67b0dc4fa2976 100644
--- a/llvm/lib/Object/COFFModuleDefinition.cpp
+++ b/llvm/lib/Object/COFFModuleDefinition.cpp
@@ -238,7 +238,10 @@ class Parser {
     }
 
     if (AddUnderscores) {
-      if (!isDecorated(E.Name, MingwDef))
+      // Don't add underscore if the name is already mangled or if it's a
+      // forward target.
+      if (!isDecorated(E.Name, MingwDef) &&
+          (E.ExtName.empty() || !StringRef(E.Name).contains(".")))
         E.Name = (std::string("_").append(E.Name));
       if (!E.ExtName.empty() && !isDecorated(E.ExtName, MingwDef))
         E.ExtName = (std::string("_").append(E.ExtName));
diff --git a/llvm/test/tools/llvm-lib/underscore.test b/llvm/test/tools/llvm-lib/underscore.test
new file mode 100644
index 0000000000000..61eee00bcf9bc
--- /dev/null
+++ b/llvm/test/tools/llvm-lib/underscore.test
@@ -0,0 +1,23 @@
+; RUN: llvm-lib -machine:x86 -out:%t.lib -def:%s
+; RUN: llvm-readobj %t.lib | FileCheck %s
+
+; CHECK:      File: test.dll
+; CHECK-NEXT: Format: COFF-import-file-i386
+; CHECK-NEXT: Type: code
+; CHECK-NEXT: Name type: noprefix
+; CHECK-NEXT: Export name: func
+; CHECK-NEXT: Symbol: __imp__func
+; CHECK-NEXT: Symbol: _func
+; CHECK-EMPTY:
+; CHECK-NEXT: File: test.dll
+; CHECK-NEXT: Format: COFF-import-file-i386
+; CHECK-NEXT: Type: code
+; CHECK-NEXT: Name type: noprefix
+; CHECK-NEXT: Export name: test.func
+; CHECK-NEXT: Symbol: __imp__test.func
+; CHECK-NEXT: Symbol: _test.func
+
+LIBRARY test.dll
+EXPORTS
+        func
+        test.func

>From 6de15379f4c1ae88ec347c6e000d6f27ad0a948b Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Sat, 12 Apr 2025 14:20:01 +0200
Subject: [PATCH 75/76] [NFC][libc++][test] Minor updates to generated header
 version test. (#134543)

Adjusting the existing script to match the new output makes it easy to
review the new script works correctly.

This adjusts the tests to match the changes in the new tests, Notably
- removes the synopsis uses 2 spaces indent in `# if`

It does not implement the conditional include part. This would be quite
some effort and these diffs are easy to review manually.

Note there are no tests for the changes; the existing script will be
phased out when the next generators are complete.
---
 .../algorithm.version.compile.pass.cpp        |   819 +-
 .../any.version.compile.pass.cpp              |    70 +-
 .../array.version.compile.pass.cpp            |   260 +-
 .../atomic.version.compile.pass.cpp           |   727 +-
 .../barrier.version.compile.pass.cpp          |   100 +-
 .../bit.version.compile.pass.cpp              |   302 +-
 .../bitset.version.compile.pass.cpp           |   101 +-
 .../charconv.version.compile.pass.cpp         |   176 +-
 .../chrono.version.compile.pass.cpp           |   137 +-
 .../cmath.version.compile.pass.cpp            |   331 +-
 .../compare.version.compile.pass.cpp          |    64 +-
 .../complex.version.compile.pass.cpp          |   131 +-
 .../concepts.version.compile.pass.cpp         |    64 +-
 .../coroutine.version.compile.pass.cpp        |    64 +-
 .../cstddef.version.compile.pass.cpp          |    70 +-
 .../cstdlib.version.compile.pass.cpp          |    82 +-
 .../cstring.version.compile.pass.cpp          |    64 +-
 .../deque.version.compile.pass.cpp            |   314 +-
 .../exception.version.compile.pass.cpp        |    70 +-
 .../execution.version.compile.pass.cpp        |   182 +-
 .../expected.version.compile.pass.cpp         |   115 +-
 .../filesystem.version.compile.pass.cpp       |   280 +-
 .../flat_map.version.compile.pass.cpp         |    58 +-
 .../flat_set.version.compile.pass.cpp         |    58 +-
 .../format.version.compile.pass.cpp           |   216 +-
 .../forward_list.version.compile.pass.cpp     |   454 +-
 .../fstream.version.compile.pass.cpp          |    64 +-
 .../functional.version.compile.pass.cpp       |   986 +-
 .../iomanip.version.compile.pass.cpp          |   136 +-
 .../ios.version.compile.pass.cpp              |    58 +-
 .../istream.version.compile.pass.cpp          |   100 +-
 .../iterator.version.compile.pass.cpp         |   543 +-
 .../latch.version.compile.pass.cpp            |   100 +-
 .../limits.version.compile.pass.cpp           |   100 +-
 .../list.version.compile.pass.cpp             |   454 +-
 .../locale.version.compile.pass.cpp           |   100 +-
 .../map.version.compile.pass.cpp              |   698 +-
 .../mdspan.version.compile.pass.cpp           |   173 +-
 .../memory.version.compile.pass.cpp           |  1188 +-
 .../memory_resource.version.compile.pass.cpp  |   217 +-
 .../mutex.version.compile.pass.cpp            |   118 +-
 .../new.version.compile.pass.cpp              |   349 +-
 .../numbers.version.compile.pass.cpp          |    64 +-
 .../numeric.version.compile.pass.cpp          |   421 +-
 .../optional.version.compile.pass.cpp         |   243 +-
 .../ostream.version.compile.pass.cpp          |   179 +-
 .../print.version.compile.pass.cpp            |    82 +-
 .../queue.version.compile.pass.cpp            |   107 +-
 .../random.version.compile.pass.cpp           |   121 +-
 .../ranges.version.compile.pass.cpp           |   780 +-
 .../ratio.version.compile.pass.cpp            |    52 +-
 .../regex.version.compile.pass.cpp            |    70 +-
 .../scoped_allocator.version.compile.pass.cpp |    70 +-
 .../semaphore.version.compile.pass.cpp        |   100 +-
 .../set.version.compile.pass.cpp              |   547 +-
 .../shared_mutex.version.compile.pass.cpp     |   255 +-
 .../source_location.version.compile.pass.cpp  |    64 +-
 .../span.version.compile.pass.cpp             |   154 +-
 .../sstream.version.compile.pass.cpp          |    52 +-
 .../stack.version.compile.pass.cpp            |   107 +-
 .../stdatomic.h.version.compile.pass.cpp      |    58 +-
 .../stop_token.version.compile.pass.cpp       |   100 +-
 .../string.version.compile.pass.cpp           |   870 +-
 .../string_view.version.compile.pass.cpp      |   407 +-
 .../syncstream.version.compile.pass.cpp       |   100 +-
 .../thread.version.compile.pass.cpp           |   179 +-
 .../tuple.version.compile.pass.cpp            |   578 +-
 .../type_traits.version.compile.pass.cpp      |  1834 +-
 .../typeinfo.version.compile.pass.cpp         |    58 +-
 .../unordered_map.version.compile.pass.cpp    |   686 +-
 .../unordered_set.version.compile.pass.cpp    |   535 +-
 .../utility.version.compile.pass.cpp          |   906 +-
 .../variant.version.compile.pass.cpp          |   186 +-
 .../vector.version.compile.pass.cpp           |   454 +-
 .../version.version.compile.pass.cpp          | 15635 ++++++++--------
 .../generate_feature_test_macro_components.py |    75 +-
 76 files changed, 18089 insertions(+), 18733 deletions(-)

diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
index acc13e5405867..488bc468bce79 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -5,473 +5,458 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <algorithm>
 
 // Test the feature test macros defined by <algorithm>
 
-/*  Constant                                                Value
-    __cpp_lib_clamp                                         201603L [C++17]
-    __cpp_lib_constexpr_algorithms                          201806L [C++20]
-                                                            202306L [C++26]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_freestanding_algorithm                        202311L [C++26]
-    __cpp_lib_parallel_algorithm                            201603L [C++17]
-    __cpp_lib_ranges                                        202110L [C++20]
-                                                            202406L [C++23]
-    __cpp_lib_ranges_contains                               202207L [C++23]
-    __cpp_lib_ranges_find_last                              202207L [C++23]
-    __cpp_lib_ranges_starts_ends_with                       202106L [C++23]
-    __cpp_lib_robust_nonmodifying_seq_ops                   201304L [C++14]
-    __cpp_lib_sample                                        201603L [C++17]
-    __cpp_lib_shift                                         201806L [C++20]
-*/
+// clang-format off
 
 #include <algorithm>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_sample
-#   error "__cpp_lib_sample should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
 
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_sample
-#   error "__cpp_lib_sample should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++17"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++17"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++17"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++17"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++17"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++17"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++20"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++20"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++20"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++20"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++20"
-# endif
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++20"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++20"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++20"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++20"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++23"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++23"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_contains != 202207L
-#   error "__cpp_lib_ranges_contains should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_find_last != 202207L
-#   error "__cpp_lib_ranges_find_last should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_starts_ends_with != 202106L
-#   error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++23"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++23"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++23"
-# endif
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++23"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++23"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++23"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++23"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++26"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_algorithms != 202306L
-#   error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_algorithm
-#     error "__cpp_lib_freestanding_algorithm should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_algorithm != 202311L
-#     error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_algorithm
-#     error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++26"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_contains != 202207L
-#   error "__cpp_lib_ranges_contains should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_find_last != 202207L
-#   error "__cpp_lib_ranges_find_last should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_starts_ends_with != 202106L
-#   error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++26"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++26"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++26"
-# endif
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++26"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 202306L
+#    error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_algorithm != 202311L
+#      error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++26"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++26"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
index 937d581c75cc5..7f3d6394749b4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
@@ -5,70 +5,68 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <any>
 
 // Test the feature test macros defined by <any>
 
-/*  Constant         Value
-    __cpp_lib_any    201606L [C++17]
-*/
+// clang-format off
 
 #include <any>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_any
-#   error "__cpp_lib_any should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_any
-#   error "__cpp_lib_any should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++17"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++17"
-# endif
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++17"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++20"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++20"
-# endif
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++20"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++23"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++23"
-# endif
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++23"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++26"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++26"
-# endif
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++26"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
index 75b5492394071..9e50976e5cc2c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
@@ -5,176 +5,170 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <array>
 
 // Test the feature test macros defined by <array>
 
-/*  Constant                                Value
-    __cpp_lib_array_constexpr               201603L [C++17]
-                                            201811L [C++20]
-    __cpp_lib_freestanding_array            202311L [C++26]
-    __cpp_lib_nonmember_container_access    201411L [C++17]
-    __cpp_lib_to_array                      201907L [C++20]
-*/
+// clang-format off
 
 #include <array>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++17"
-# endif
-# if __cpp_lib_array_constexpr != 201603L
-#   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++17"
+#  endif
+#  if __cpp_lib_array_constexpr != 201603L
+#    error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
+#  endif
 
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++20"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++20"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++20"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++20"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++20"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++23"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++23"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++23"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++23"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++26"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_array
-#     error "__cpp_lib_freestanding_array should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_array != 202311L
-#     error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_array
-#     error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++26"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++26"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++26"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_array
+#      error "__cpp_lib_freestanding_array should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_array != 202311L
+#      error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_array
+#      error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
index 5a21e6320bffe..e6145bbed5af9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
@@ -5,430 +5,419 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <atomic>
 
 // Test the feature test macros defined by <atomic>
 
-/*  Constant                                   Value
-    __cpp_lib_atomic_flag_test                 201907L [C++20]
-    __cpp_lib_atomic_float                     201711L [C++20]
-    __cpp_lib_atomic_is_always_lock_free       201603L [C++17]
-    __cpp_lib_atomic_lock_free_type_aliases    201907L [C++20]
-    __cpp_lib_atomic_min_max                   202403L [C++26]
-    __cpp_lib_atomic_ref                       201806L [C++20]
-    __cpp_lib_atomic_shared_ptr                201711L [C++20]
-    __cpp_lib_atomic_value_initialization      201911L [C++20]
-    __cpp_lib_atomic_wait                      201907L [C++20]
-    __cpp_lib_char8_t                          201907L [C++20]
-*/
+// clang-format off
 
 #include <atomic>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17"
-# endif
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17"
+#  endif
 
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++20"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++20"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++20"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++20"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++23"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++23"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++23"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++23"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_min_max
-#     error "__cpp_lib_atomic_min_max should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_min_max != 202403L
-#     error "__cpp_lib_atomic_min_max should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_min_max
-#     error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_min_max
+#      error "__cpp_lib_atomic_min_max should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_min_max != 202403L
+#      error "__cpp_lib_atomic_min_max should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_min_max
+#      error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
index bf8c8fa802e15..0d025923728b7 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <barrier>
 
-/*  Constant             Value
-    __cpp_lib_barrier    201907L [C++20]
-*/
+// clang-format off
 
 #include <barrier>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++20"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++20"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++23"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++23"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++26"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++26"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
index 0e1d06b928019..35033419ac440 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
@@ -5,200 +5,194 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <bit>
 
 // Test the feature test macros defined by <bit>
 
-/*  Constant              Value
-    __cpp_lib_bit_cast    201806L [C++20]
-    __cpp_lib_bitops      201907L [C++20]
-    __cpp_lib_byteswap    202110L [C++23]
-    __cpp_lib_endian      201907L [C++20]
-    __cpp_lib_int_pow2    202002L [C++20]
-*/
+// clang-format off
 
 #include <bit>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++20"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++20"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++20"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++20"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++20"
-# endif
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++20"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++20"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++20"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++20"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++23"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++23"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should be defined in c++23"
-# endif
-# if __cpp_lib_byteswap != 202110L
-#   error "__cpp_lib_byteswap should have the value 202110L in c++23"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++23"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++23"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
-# endif
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++23"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++23"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should be defined in c++23"
+#  endif
+#  if __cpp_lib_byteswap != 202110L
+#    error "__cpp_lib_byteswap should have the value 202110L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++23"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++23"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++26"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++26"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should be defined in c++26"
-# endif
-# if __cpp_lib_byteswap != 202110L
-#   error "__cpp_lib_byteswap should have the value 202110L in c++26"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++26"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++26"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
-# endif
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++26"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++26"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should be defined in c++26"
+#  endif
+#  if __cpp_lib_byteswap != 202110L
+#    error "__cpp_lib_byteswap should have the value 202110L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++26"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++26"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
index 039935943dbd6..ea61d99736208 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
@@ -5,92 +5,89 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <bitset>
 
 // Test the feature test macros defined by <bitset>
 
-/*  Constant                      Value
-    __cpp_lib_bitset              202306L [C++26]
-    __cpp_lib_constexpr_bitset    202207L [C++23]
-*/
+// clang-format off
 
 #include <bitset>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_bitset != 202207L
-#   error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23"
-# endif
+#  ifndef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_bitset != 202207L
+#    error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should be defined in c++26"
-# endif
-# if __cpp_lib_bitset != 202306L
-#   error "__cpp_lib_bitset should have the value 202306L in c++26"
-# endif
+#  ifndef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should be defined in c++26"
+#  endif
+#  if __cpp_lib_bitset != 202306L
+#    error "__cpp_lib_bitset should have the value 202306L in c++26"
+#  endif
 
-# ifndef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_bitset != 202207L
-#   error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_bitset != 202207L
+#    error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
index cc38cbacd51b7..52b02562dc5ab 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
@@ -5,126 +5,122 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <charconv>
 
 // Test the feature test macros defined by <charconv>
 
-/*  Constant                        Value
-    __cpp_lib_constexpr_charconv    202207L [C++23]
-    __cpp_lib_to_chars              201611L [C++17]
-                                    202306L [C++26]
-*/
+// clang-format off
 
 #include <charconv>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_to_chars
-#   error "__cpp_lib_to_chars should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_to_chars
+#    error "__cpp_lib_to_chars should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_to_chars
-#   error "__cpp_lib_to_chars should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_to_chars
+#    error "__cpp_lib_to_chars should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++17"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++17"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++20"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++20"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_charconv != 202207L
-#   error "__cpp_lib_constexpr_charconv should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++23"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_charconv != 202207L
+#    error "__cpp_lib_constexpr_charconv should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++23"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_charconv != 202207L
-#   error "__cpp_lib_constexpr_charconv should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++26"
-#   endif
-#   if __cpp_lib_to_chars != 202306L
-#     error "__cpp_lib_to_chars should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_charconv != 202207L
+#    error "__cpp_lib_constexpr_charconv should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++26"
+#    endif
+#    if __cpp_lib_to_chars != 202306L
+#      error "__cpp_lib_to_chars should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
index 0aaec6d1910aa..1453938b01da0 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
@@ -5,110 +5,107 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <chrono>
 
 // Test the feature test macros defined by <chrono>
 
-/*  Constant                 Value
-    __cpp_lib_chrono         201611L [C++17]
-    __cpp_lib_chrono_udls    201304L [C++14]
-*/
+// clang-format off
 
 #include <chrono>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should not be defined before c++14"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should not be defined before c++17"
+#  endif
 
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++14"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++14"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++17"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++17"
-# endif
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++17"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++17"
+#  endif
 
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++17"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++17"
-# endif
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++20"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++20"
-# endif
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++20"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++20"
+#  endif
 
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++20"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++20"
-# endif
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++23"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++23"
-# endif
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++23"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++23"
+#  endif
 
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++23"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++23"
-# endif
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++26"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++26"
-# endif
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++26"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++26"
+#  endif
 
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++26"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++26"
-# endif
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
index 898a73c985917..507c7ab6084f8 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
@@ -5,208 +5,203 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <cmath>
 
 // Test the feature test macros defined by <cmath>
 
-/*  Constant                            Value
-    __cpp_lib_constexpr_cmath           202202L [C++23]
-    __cpp_lib_hypot                     201603L [C++17]
-    __cpp_lib_interpolate               201902L [C++20]
-    __cpp_lib_math_special_functions    201603L [C++17]
-*/
+// clang-format off
 
 #include <cmath>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_math_special_functions
-#   error "__cpp_lib_math_special_functions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_math_special_functions
+#    error "__cpp_lib_math_special_functions should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_math_special_functions
-#   error "__cpp_lib_math_special_functions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_math_special_functions
+#    error "__cpp_lib_math_special_functions should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++17"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++17"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++17"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++17"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++20"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++20"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++20"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++20"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++20"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++20"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++23"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++23"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++23"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++23"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++23"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++23"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++23"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++23"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++26"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++26"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++26"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++26"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++26"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++26"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++26"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++26"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
index 1d61f43f9ee51..56759a88a7348 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <compare>
 
 // Test the feature test macros defined by <compare>
 
-/*  Constant                          Value
-    __cpp_lib_three_way_comparison    201907L [C++20]
-*/
+// clang-format off
 
 #include <compare>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++20"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++20"
-# endif
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++20"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++23"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++23"
-# endif
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++23"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++26"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++26"
-# endif
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++26"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
index 3718a9e222f98..b5efa984b456a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
@@ -5,107 +5,104 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <complex>
 
 // Test the feature test macros defined by <complex>
 
-/*  Constant                       Value
-    __cpp_lib_complex_udls         201309L [C++14]
-    __cpp_lib_constexpr_complex    201711L [C++20]
-*/
+// clang-format off
 
 #include <complex>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++14"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++14"
-# endif
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++14"
+#  endif
 
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++17"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++17"
-# endif
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++20"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++20"
-# endif
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++20"
+#  endif
 
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
-# endif
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++23"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++23"
-# endif
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++23"
+#  endif
 
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
-# endif
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++26"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++26"
-# endif
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++26"
+#  endif
 
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
index aa82b9ef87b87..d9b2c43ecbd12 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <concepts>
 
 // Test the feature test macros defined by <concepts>
 
-/*  Constant              Value
-    __cpp_lib_concepts    202002L [C++20]
-*/
+// clang-format off
 
 #include <concepts>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++20"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++20"
-# endif
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++20"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++23"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++23"
-# endif
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++23"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++26"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++26"
-# endif
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++26"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
index eedc05f1a6c6b..b472b205f89d5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <coroutine>
 
 // Test the feature test macros defined by <coroutine>
 
-/*  Constant               Value
-    __cpp_lib_coroutine    201902L [C++20]
-*/
+// clang-format off
 
 #include <coroutine>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++20"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++20"
-# endif
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++20"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++23"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++23"
-# endif
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++23"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++26"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++26"
-# endif
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++26"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
index 8365f4e5efd70..ccc034418cde0 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
@@ -5,70 +5,68 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <cstddef>
 
 // Test the feature test macros defined by <cstddef>
 
-/*  Constant          Value
-    __cpp_lib_byte    201603L [C++17]
-*/
+// clang-format off
 
 #include <cstddef>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_byte
-#   error "__cpp_lib_byte should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_byte
+#    error "__cpp_lib_byte should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_byte
-#   error "__cpp_lib_byte should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_byte
+#    error "__cpp_lib_byte should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++17"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++17"
-# endif
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++17"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++20"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++20"
-# endif
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++20"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++23"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++23"
-# endif
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++23"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++26"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++26"
-# endif
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++26"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
index 610c8c0265216..f250798c129ea 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
@@ -5,76 +5,74 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <cstdlib>
 
 // Test the feature test macros defined by <cstdlib>
 
-/*  Constant                     Value
-    __cpp_lib_constexpr_cmath    202202L [C++23]
-*/
+// clang-format off
 
 #include <cstdlib>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++23"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++23"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++26"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++26"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
index 345acf1e599d4..675c918cac417 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <cstring>
 
 // Test the feature test macros defined by <cstring>
 
-/*  Constant                          Value
-    __cpp_lib_freestanding_cstring    202306L [C++26]
-*/
+// clang-format off
 
 #include <cstring>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_cstring
-#     error "__cpp_lib_freestanding_cstring should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_cstring != 202306L
-#     error "__cpp_lib_freestanding_cstring should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_cstring
-#     error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_cstring
+#      error "__cpp_lib_freestanding_cstring should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_cstring != 202306L
+#      error "__cpp_lib_freestanding_cstring should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_cstring
+#      error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
index d0e4ac130c60e..eff8689be9fb8 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
@@ -5,206 +5,200 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <deque>
 
 // Test the feature test macros defined by <deque>
 
-/*  Constant                                                Value
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-*/
+// clang-format off
 
 #include <deque>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
index f8a4da7fd1bd5..60d6418c7459a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
@@ -5,70 +5,68 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <exception>
 
 // Test the feature test macros defined by <exception>
 
-/*  Constant                         Value
-    __cpp_lib_uncaught_exceptions    201411L [C++17]
-*/
+// clang-format off
 
 #include <exception>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++17"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++17"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++20"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++20"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++23"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++23"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++26"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++26"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
index d3c6d7b158eba..b843aab42e6eb 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
@@ -5,129 +5,125 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <execution>
 
 // Test the feature test macros defined by <execution>
 
-/*  Constant               Value
-    __cpp_lib_execution    201603L [C++17]
-                           201902L [C++20]
-    __cpp_lib_senders      202406L [C++26]
-*/
+// clang-format off
 
 #include <execution>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_execution
-#   error "__cpp_lib_execution should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_execution
+#    error "__cpp_lib_execution should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_execution
-#   error "__cpp_lib_execution should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_execution
+#    error "__cpp_lib_execution should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++17"
-#   endif
-#   if __cpp_lib_execution != 201603L
-#     error "__cpp_lib_execution should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++17"
+#    endif
+#    if __cpp_lib_execution != 201603L
+#      error "__cpp_lib_execution should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++20"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++20"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++23"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++23"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++26"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_senders
-#     error "__cpp_lib_senders should be defined in c++26"
-#   endif
-#   if __cpp_lib_senders != 202406L
-#     error "__cpp_lib_senders should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_senders
-#     error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++26"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_senders
+#      error "__cpp_lib_senders should be defined in c++26"
+#    endif
+#    if __cpp_lib_senders != 202406L
+#      error "__cpp_lib_senders should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_senders
+#      error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
index 175e9501eb958..d58f726f66e2f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
@@ -5,98 +5,95 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <expected>
 
 // Test the feature test macros defined by <expected>
 
-/*  Constant                           Value
-    __cpp_lib_expected                 202211L [C++23]
-    __cpp_lib_freestanding_expected    202311L [C++26]
-*/
+// clang-format off
 
 #include <expected>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_expected
-#   error "__cpp_lib_expected should be defined in c++23"
-# endif
-# if __cpp_lib_expected != 202211L
-#   error "__cpp_lib_expected should have the value 202211L in c++23"
-# endif
+#  ifndef __cpp_lib_expected
+#    error "__cpp_lib_expected should be defined in c++23"
+#  endif
+#  if __cpp_lib_expected != 202211L
+#    error "__cpp_lib_expected should have the value 202211L in c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_expected
-#   error "__cpp_lib_expected should be defined in c++26"
-# endif
-# if __cpp_lib_expected != 202211L
-#   error "__cpp_lib_expected should have the value 202211L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_expected
-#     error "__cpp_lib_freestanding_expected should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_expected != 202311L
-#     error "__cpp_lib_freestanding_expected should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_expected
-#     error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_expected
+#    error "__cpp_lib_expected should be defined in c++26"
+#  endif
+#  if __cpp_lib_expected != 202211L
+#    error "__cpp_lib_expected should have the value 202211L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_expected
+#      error "__cpp_lib_freestanding_expected should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_expected != 202311L
+#      error "__cpp_lib_freestanding_expected should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_expected
+#      error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
index 1a95acd3683d2..98acf8bb602ca 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-filesystem
 
@@ -17,170 +15,168 @@
 
 // Test the feature test macros defined by <filesystem>
 
-/*  Constant                 Value
-    __cpp_lib_char8_t        201907L [C++20]
-    __cpp_lib_filesystem     201703L [C++17]
-    __cpp_lib_format_path    202403L [C++26]
-*/
+// clang-format off
 
 #include <filesystem>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_filesystem
-#   error "__cpp_lib_filesystem should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_filesystem
+#    error "__cpp_lib_filesystem should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_filesystem
-#   error "__cpp_lib_filesystem should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_filesystem
+#    error "__cpp_lib_filesystem should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++17"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++17"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++20"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++20"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++23"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++23"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++26"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_format_path
-#     error "__cpp_lib_format_path should be defined in c++26"
-#   endif
-#   if __cpp_lib_format_path != 202403L
-#     error "__cpp_lib_format_path should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_format_path
-#     error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++26"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_format_path
+#      error "__cpp_lib_format_path should be defined in c++26"
+#    endif
+#    if __cpp_lib_format_path != 202403L
+#      error "__cpp_lib_format_path should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_format_path
+#      error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
index 0add849312d5e..19e2fd79a4295 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
@@ -5,64 +5,62 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <flat_map>
 
 // Test the feature test macros defined by <flat_map>
 
-/*  Constant              Value
-    __cpp_lib_flat_map    202207L [C++23]
-*/
+// clang-format off
 
 #include <flat_map>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should be defined in c++23"
-# endif
-# if __cpp_lib_flat_map != 202207L
-#   error "__cpp_lib_flat_map should have the value 202207L in c++23"
-# endif
+#  ifndef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should be defined in c++23"
+#  endif
+#  if __cpp_lib_flat_map != 202207L
+#    error "__cpp_lib_flat_map should have the value 202207L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should be defined in c++26"
-# endif
-# if __cpp_lib_flat_map != 202207L
-#   error "__cpp_lib_flat_map should have the value 202207L in c++26"
-# endif
+#  ifndef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should be defined in c++26"
+#  endif
+#  if __cpp_lib_flat_map != 202207L
+#    error "__cpp_lib_flat_map should have the value 202207L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
index 1d96845288b29..d078f9bda23c9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
@@ -5,64 +5,62 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <flat_set>
 
 // Test the feature test macros defined by <flat_set>
 
-/*  Constant              Value
-    __cpp_lib_flat_set    202207L [C++23]
-*/
+// clang-format off
 
 #include <flat_set>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should be defined in c++23"
-# endif
-# if __cpp_lib_flat_set != 202207L
-#   error "__cpp_lib_flat_set should have the value 202207L in c++23"
-# endif
+#  ifndef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should be defined in c++23"
+#  endif
+#  if __cpp_lib_flat_set != 202207L
+#    error "__cpp_lib_flat_set should have the value 202207L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should be defined in c++26"
-# endif
-# if __cpp_lib_flat_set != 202207L
-#   error "__cpp_lib_flat_set should have the value 202207L in c++26"
-# endif
+#  ifndef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should be defined in c++26"
+#  endif
+#  if __cpp_lib_flat_set != 202207L
+#    error "__cpp_lib_flat_set should have the value 202207L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
index 6a96325661346..3fa4334143b1a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
@@ -5,150 +5,146 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <format>
 
 // Test the feature test macros defined by <format>
 
-/*  Constant                   Value
-    __cpp_lib_format           202110L [C++20]
-    __cpp_lib_format_ranges    202207L [C++23]
-    __cpp_lib_format_uchar     202311L [C++20]
-*/
+// clang-format off
 
 #include <format>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++20"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++20"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++20"
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++20"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++20"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++23"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_format_ranges != 202207L
-#   error "__cpp_lib_format_ranges should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++23"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++23"
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++23"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_format_ranges != 202207L
+#    error "__cpp_lib_format_ranges should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++23"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++26"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_format_ranges != 202207L
-#   error "__cpp_lib_format_ranges should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++26"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++26"
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++26"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_format_ranges != 202207L
+#    error "__cpp_lib_format_ranges should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++26"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
index bcb606451b27f..31b3e900aabcd 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
@@ -5,277 +5,269 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <forward_list>
 
 // Test the feature test macros defined by <forward_list>
 
-/*  Constant                                                Value
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_incomplete_container_elements                 201505L [C++17]
-    __cpp_lib_list_remove_return_type                       201806L [C++20]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-*/
+// clang-format off
 
 #include <forward_list>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++17"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
-# endif
-
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++17"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++20"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++20"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++20"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++23"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++23"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++23"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++26"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++26"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++26"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
index d75ea4c37c89f..ee32346d61080 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,57 +15,57 @@
 
 // Test the feature test macros defined by <fstream>
 
-/*  Constant                           Value
-    __cpp_lib_fstream_native_handle    202306L [C++26]
-*/
+// clang-format off
 
 #include <fstream>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
-#   ifndef __cpp_lib_fstream_native_handle
-#     error "__cpp_lib_fstream_native_handle should be defined in c++26"
-#   endif
-#   if __cpp_lib_fstream_native_handle != 202306L
-#     error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_fstream_native_handle
-#     error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
+#    ifndef __cpp_lib_fstream_native_handle
+#      error "__cpp_lib_fstream_native_handle should be defined in c++26"
+#    endif
+#    if __cpp_lib_fstream_native_handle != 202306L
+#      error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_fstream_native_handle
+#      error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
index e19ed321515ec..8dbbbf432ddbf 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
@@ -5,565 +5,545 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <functional>
 
 // Test the feature test macros defined by <functional>
 
-/*  Constant                           Value
-    __cpp_lib_bind_back                202202L [C++23]
-    __cpp_lib_bind_front               201907L [C++20]
-                                       202306L [C++26]
-    __cpp_lib_boyer_moore_searcher     201603L [C++17]
-    __cpp_lib_constexpr_functional     201907L [C++20]
-    __cpp_lib_copyable_function        202306L [C++26]
-    __cpp_lib_function_ref             202306L [C++26]
-    __cpp_lib_invoke                   201411L [C++17]
-    __cpp_lib_invoke_r                 202106L [C++23]
-    __cpp_lib_move_only_function       202110L [C++23]
-    __cpp_lib_not_fn                   201603L [C++17]
-                                       202306L [C++26]
-    __cpp_lib_ranges                   202110L [C++20]
-                                       202406L [C++23]
-    __cpp_lib_reference_wrapper        202403L [C++26]
-    __cpp_lib_result_of_sfinae         201210L [C++14]
-    __cpp_lib_transparent_operators    201210L [C++14]
-                                       201510L [C++17]
-    __cpp_lib_unwrap_ref               201811L [C++20]
-*/
+// clang-format off
 
 #include <functional>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++14"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
-# endif
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++14"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
+#  endif
 
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++14"
-# endif
-# if __cpp_lib_transparent_operators != 201210L
-#   error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
-# endif
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++14"
+#  endif
+#  if __cpp_lib_transparent_operators != 201210L
+#    error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
+#  endif
 
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++17"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++17"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++17"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++17"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
-# endif
-
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++17"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++17"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++17"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++17"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++20"
-# endif
-# if __cpp_lib_bind_front != 201907L
-#   error "__cpp_lib_bind_front should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++20"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++20"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++20"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++20"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++20"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
-# endif
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++20"
+#  endif
+#  if __cpp_lib_bind_front != 201907L
+#    error "__cpp_lib_bind_front should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++20"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++20"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++20"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++20"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++20"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should be defined in c++23"
-# endif
-# if __cpp_lib_bind_back != 202202L
-#   error "__cpp_lib_bind_back should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++23"
-# endif
-# if __cpp_lib_bind_front != 201907L
-#   error "__cpp_lib_bind_front should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++23"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should be defined in c++23"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-#   error "__cpp_lib_invoke_r should have the value 202106L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should be defined in c++23"
-#   endif
-#   if __cpp_lib_move_only_function != 202110L
-#     error "__cpp_lib_move_only_function should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++23"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++23"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++23"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++23"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
-# endif
+#  ifndef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should be defined in c++23"
+#  endif
+#  if __cpp_lib_bind_back != 202202L
+#    error "__cpp_lib_bind_back should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++23"
+#  endif
+#  if __cpp_lib_bind_front != 201907L
+#    error "__cpp_lib_bind_front should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++23"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should be defined in c++23"
+#  endif
+#  if __cpp_lib_invoke_r != 202106L
+#    error "__cpp_lib_invoke_r should have the value 202106L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should be defined in c++23"
+#    endif
+#    if __cpp_lib_move_only_function != 202110L
+#      error "__cpp_lib_move_only_function should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++23"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++23"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++23"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++23"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should be defined in c++26"
-# endif
-# if __cpp_lib_bind_back != 202202L
-#   error "__cpp_lib_bind_back should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++26"
-# endif
-# if __cpp_lib_bind_front != 202306L
-#   error "__cpp_lib_bind_front should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_copyable_function
-#     error "__cpp_lib_copyable_function should be defined in c++26"
-#   endif
-#   if __cpp_lib_copyable_function != 202306L
-#     error "__cpp_lib_copyable_function should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_copyable_function
-#     error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_function_ref
-#     error "__cpp_lib_function_ref should be defined in c++26"
-#   endif
-#   if __cpp_lib_function_ref != 202306L
-#     error "__cpp_lib_function_ref should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_function_ref
-#     error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++26"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should be defined in c++26"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-#   error "__cpp_lib_invoke_r should have the value 202106L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should be defined in c++26"
-#   endif
-#   if __cpp_lib_move_only_function != 202110L
-#     error "__cpp_lib_move_only_function should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++26"
-# endif
-# if __cpp_lib_not_fn != 202306L
-#   error "__cpp_lib_not_fn should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# ifndef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should be defined in c++26"
-# endif
-# if __cpp_lib_reference_wrapper != 202403L
-#   error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++26"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++26"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++26"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
-# endif
+#  ifndef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should be defined in c++26"
+#  endif
+#  if __cpp_lib_bind_back != 202202L
+#    error "__cpp_lib_bind_back should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++26"
+#  endif
+#  if __cpp_lib_bind_front != 202306L
+#    error "__cpp_lib_bind_front should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_copyable_function
+#      error "__cpp_lib_copyable_function should be defined in c++26"
+#    endif
+#    if __cpp_lib_copyable_function != 202306L
+#      error "__cpp_lib_copyable_function should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_copyable_function
+#      error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_function_ref
+#      error "__cpp_lib_function_ref should be defined in c++26"
+#    endif
+#    if __cpp_lib_function_ref != 202306L
+#      error "__cpp_lib_function_ref should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_function_ref
+#      error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++26"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should be defined in c++26"
+#  endif
+#  if __cpp_lib_invoke_r != 202106L
+#    error "__cpp_lib_invoke_r should have the value 202106L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should be defined in c++26"
+#    endif
+#    if __cpp_lib_move_only_function != 202110L
+#      error "__cpp_lib_move_only_function should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++26"
+#  endif
+#  if __cpp_lib_not_fn != 202306L
+#    error "__cpp_lib_not_fn should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should be defined in c++26"
+#  endif
+#  if __cpp_lib_reference_wrapper != 202403L
+#    error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++26"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++26"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++26"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
index f3ac7a0a572f0..37deba7c9661a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,93 +15,93 @@
 
 // Test the feature test macros defined by <iomanip>
 
-/*  Constant                      Value
-    __cpp_lib_quoted_string_io    201304L [C++14]
-*/
+// clang-format off
 
 #include <iomanip>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_quoted_string_io
-#   error "__cpp_lib_quoted_string_io should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_quoted_string_io
+#    error "__cpp_lib_quoted_string_io should not be defined before c++14"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++14"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++14"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++14"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++14"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++17"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++17"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++20"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++20"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++23"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++23"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++26"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++26"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
index f245815eaa40d..179c3ce066b6f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,54 +15,54 @@
 
 // Test the feature test macros defined by <ios>
 
-/*  Constant                   Value
-    __cpp_lib_ios_noreplace    202207L [C++23]
-*/
+// clang-format off
 
 #include <ios>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should be defined in c++23"
-# endif
-# if __cpp_lib_ios_noreplace != 202207L
-#   error "__cpp_lib_ios_noreplace should have the value 202207L in c++23"
-# endif
+#  ifndef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_ios_noreplace != 202207L
+#    error "__cpp_lib_ios_noreplace should have the value 202207L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should be defined in c++26"
-# endif
-# if __cpp_lib_ios_noreplace != 202207L
-#   error "__cpp_lib_ios_noreplace should have the value 202207L in c++26"
-# endif
+#  ifndef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_ios_noreplace != 202207L
+#    error "__cpp_lib_ios_noreplace should have the value 202207L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
index fe3e6490386de..46238896f79c3 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <istream>
 
-/*  Constant             Value
-    __cpp_lib_char8_t    201907L [C++20]
-*/
+// clang-format off
 
 #include <istream>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
index a756d10fcc375..75dcb18a5428c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
@@ -5,325 +5,314 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <iterator>
 
 // Test the feature test macros defined by <iterator>
 
-/*  Constant                                Value
-    __cpp_lib_array_constexpr               201603L [C++17]
-                                            201811L [C++20]
-    __cpp_lib_constexpr_iterator            201811L [C++20]
-    __cpp_lib_make_reverse_iterator         201402L [C++14]
-    __cpp_lib_move_iterator_concept         202207L [C++20]
-    __cpp_lib_nonmember_container_access    201411L [C++17]
-    __cpp_lib_null_iterators                201304L [C++14]
-    __cpp_lib_ranges                        202110L [C++20]
-                                            202406L [C++23]
-    __cpp_lib_ssize                         201902L [C++20]
-*/
+// clang-format off
 
 #include <iterator>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++14"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
-# endif
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++14"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
+#  endif
 
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++14"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++14"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++17"
-# endif
-# if __cpp_lib_array_constexpr != 201603L
-#   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++17"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
-# endif
-
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++17"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++17"
+#  endif
+#  if __cpp_lib_array_constexpr != 201603L
+#    error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++17"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++20"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++20"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++20"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++20"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++20"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++20"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++20"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++20"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++20"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++20"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++23"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++23"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++23"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++23"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++23"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++23"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++23"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++23"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++23"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++23"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++23"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++26"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++26"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++26"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++26"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++26"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++26"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++26"
-# endif
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++26"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++26"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++26"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++26"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
index 34521fdffa221..6857c54460650 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <latch>
 
-/*  Constant           Value
-    __cpp_lib_latch    201907L [C++20]
-*/
+// clang-format off
 
 #include <latch>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++20"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++20"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++23"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++23"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++26"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++26"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
index 70baec07a3972..0b3d6f5d2bd9c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
@@ -5,85 +5,83 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <limits>
 
 // Test the feature test macros defined by <limits>
 
-/*  Constant             Value
-    __cpp_lib_char8_t    201907L [C++20]
-*/
+// clang-format off
 
 #include <limits>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
index 9cd3c3bc941c0..9fd638087fcea 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
@@ -5,277 +5,269 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <list>
 
 // Test the feature test macros defined by <list>
 
-/*  Constant                                                Value
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_incomplete_container_elements                 201505L [C++17]
-    __cpp_lib_list_remove_return_type                       201806L [C++20]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-*/
+// clang-format off
 
 #include <list>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++17"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
-# endif
-
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++17"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++20"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++20"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++20"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++23"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++23"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++23"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++26"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++26"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++26"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
index 2674123a2c38a..e1a04d1b0e087 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <locale>
 
-/*  Constant             Value
-    __cpp_lib_char8_t    201907L [C++20]
-*/
+// clang-format off
 
 #include <locale>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
index 4ffb72d1442e5..4044c2b1b2e0f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
@@ -5,407 +5,395 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <map>
 
 // Test the feature test macros defined by <map>
 
-/*  Constant                                         Value
-    __cpp_lib_allocator_traits_is_always_equal       201411L [C++17]
-    __cpp_lib_associative_heterogeneous_erasure      202110L [C++23]
-    __cpp_lib_associative_heterogeneous_insertion    202306L [C++26]
-    __cpp_lib_containers_ranges                      202202L [C++23]
-    __cpp_lib_erase_if                               202002L [C++20]
-    __cpp_lib_generic_associative_lookup             201304L [C++14]
-    __cpp_lib_map_try_emplace                        201411L [C++17]
-    __cpp_lib_node_extract                           201606L [C++17]
-    __cpp_lib_nonmember_container_access             201411L [C++17]
-    __cpp_lib_tuple_like                             202207L [C++23]
-                                                     202311L [C++26]
-*/
+// clang-format off
 
 #include <map>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++14"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++14"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++17"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++17"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++17"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++17"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++17"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++17"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++17"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++20"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++20"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++20"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++20"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++23"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++23"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++23"
-#   endif
-#   if __cpp_lib_tuple_like != 202207L
-#     error "__cpp_lib_tuple_like should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++23"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++23"
+#    endif
+#    if __cpp_lib_tuple_like != 202207L
+#      error "__cpp_lib_tuple_like should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_insertion != 202306L
-#     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++26"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++26"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++26"
-#   endif
-#   if __cpp_lib_tuple_like != 202311L
-#     error "__cpp_lib_tuple_like should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_insertion != 202306L
+#      error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++26"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++26"
+#    endif
+#    if __cpp_lib_tuple_like != 202311L
+#      error "__cpp_lib_tuple_like should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
index 64d1c99b223f4..28524438f644b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
@@ -5,133 +5,128 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <mdspan>
 
 // Test the feature test macros defined by <mdspan>
 
-/*  Constant                         Value
-    __cpp_lib_freestanding_mdspan    202311L [C++26]
-    __cpp_lib_mdspan                 202207L [C++23]
-                                     202406L [C++26]
-    __cpp_lib_submdspan              202306L [C++26]
-*/
+// clang-format off
 
 #include <mdspan>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should be defined in c++23"
-# endif
-# if __cpp_lib_mdspan != 202207L
-#   error "__cpp_lib_mdspan should have the value 202207L in c++23"
-# endif
+#  ifndef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should be defined in c++23"
+#  endif
+#  if __cpp_lib_mdspan != 202207L
+#    error "__cpp_lib_mdspan should have the value 202207L in c++23"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_mdspan
-#     error "__cpp_lib_freestanding_mdspan should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_mdspan != 202311L
-#     error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_mdspan
-#     error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should be defined in c++26"
-# endif
-# if __cpp_lib_mdspan != 202406L
-#   error "__cpp_lib_mdspan should have the value 202406L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_submdspan
-#     error "__cpp_lib_submdspan should be defined in c++26"
-#   endif
-#   if __cpp_lib_submdspan != 202306L
-#     error "__cpp_lib_submdspan should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_submdspan
-#     error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_mdspan
+#      error "__cpp_lib_freestanding_mdspan should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_mdspan != 202311L
+#      error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_mdspan
+#      error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should be defined in c++26"
+#  endif
+#  if __cpp_lib_mdspan != 202406L
+#    error "__cpp_lib_mdspan should have the value 202406L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_submdspan
+#      error "__cpp_lib_submdspan should be defined in c++26"
+#    endif
+#    if __cpp_lib_submdspan != 202306L
+#      error "__cpp_lib_submdspan should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_submdspan
+#      error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
index 0094bed44be07..fc70df3ae2ef9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
@@ -5,674 +5,650 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <memory>
 
 // Test the feature test macros defined by <memory>
 
-/*  Constant                                      Value
-    __cpp_lib_addressof_constexpr                 201603L [C++17]
-    __cpp_lib_allocate_at_least                   202302L [C++23]
-    __cpp_lib_allocator_traits_is_always_equal    201411L [C++17]
-    __cpp_lib_assume_aligned                      201811L [C++20]
-    __cpp_lib_atomic_value_initialization         201911L [C++20]
-    __cpp_lib_constexpr_dynamic_alloc             201907L [C++20]
-    __cpp_lib_constexpr_memory                    201811L [C++20]
-                                                  202202L [C++23]
-    __cpp_lib_enable_shared_from_this             201603L [C++17]
-    __cpp_lib_make_unique                         201304L [C++14]
-    __cpp_lib_out_ptr                             202106L [C++23]
-                                                  202311L [C++26]
-    __cpp_lib_ranges                              202110L [C++20]
-                                                  202406L [C++23]
-    __cpp_lib_raw_memory_algorithms               201606L [C++17]
-    __cpp_lib_shared_ptr_arrays                   201611L [C++17]
-                                                  201707L [C++20]
-    __cpp_lib_shared_ptr_weak_type                201606L [C++17]
-    __cpp_lib_smart_ptr_for_overwrite             202002L [C++20]
-    __cpp_lib_smart_ptr_owner_equality            202306L [C++26]
-    __cpp_lib_to_address                          201711L [C++20]
-    __cpp_lib_transparent_operators               201210L [C++14]
-                                                  201510L [C++17]
-*/
+// clang-format off
 
 #include <memory>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should not be defined before c++14"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
+#  endif
 
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++14"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++14"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++14"
-# endif
-# if __cpp_lib_transparent_operators != 201210L
-#   error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
-# endif
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++14"
+#  endif
+#  if __cpp_lib_transparent_operators != 201210L
+#    error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++17"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++17"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++17"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++17"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201611L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++17"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++17"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
-# endif
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++17"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++17"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++17"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201611L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++17"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++17"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++20"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++20"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_memory != 201811L
-#   error "__cpp_lib_constexpr_memory should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++20"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++20"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++20"
-# endif
-
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++20"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++20"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++20"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++20"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++20"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++20"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
-# endif
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++20"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++20"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_memory != 201811L
+#    error "__cpp_lib_constexpr_memory should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++20"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++20"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++20"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++20"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++23"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should be defined in c++23"
-# endif
-# if __cpp_lib_allocate_at_least != 202302L
-#   error "__cpp_lib_allocate_at_least should have the value 202302L in c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++23"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_memory != 202202L
-#   error "__cpp_lib_constexpr_memory should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++23"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++23"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should be defined in c++23"
-# endif
-# if __cpp_lib_out_ptr != 202106L
-#   error "__cpp_lib_out_ptr should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++23"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++23"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++23"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++23"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++23"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++23"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
-# endif
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++23"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocate_at_least != 202302L
+#    error "__cpp_lib_allocate_at_least should have the value 202302L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++23"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_memory != 202202L
+#    error "__cpp_lib_constexpr_memory should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++23"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should be defined in c++23"
+#  endif
+#  if __cpp_lib_out_ptr != 202106L
+#    error "__cpp_lib_out_ptr should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++23"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++23"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++26"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should be defined in c++26"
-# endif
-# if __cpp_lib_allocate_at_least != 202302L
-#   error "__cpp_lib_allocate_at_least should have the value 202302L in c++26"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++26"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_memory != 202202L
-#   error "__cpp_lib_constexpr_memory should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++26"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++26"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should be defined in c++26"
-# endif
-# if __cpp_lib_out_ptr != 202311L
-#   error "__cpp_lib_out_ptr should have the value 202311L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++26"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++26"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++26"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++26"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_smart_ptr_owner_equality
-#     error "__cpp_lib_smart_ptr_owner_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_smart_ptr_owner_equality != 202306L
-#     error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_smart_ptr_owner_equality
-#     error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++26"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++26"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
-# endif
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++26"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocate_at_least != 202302L
+#    error "__cpp_lib_allocate_at_least should have the value 202302L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++26"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_memory != 202202L
+#    error "__cpp_lib_constexpr_memory should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++26"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should be defined in c++26"
+#  endif
+#  if __cpp_lib_out_ptr != 202311L
+#    error "__cpp_lib_out_ptr should have the value 202311L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++26"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_smart_ptr_owner_equality
+#      error "__cpp_lib_smart_ptr_owner_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_smart_ptr_owner_equality != 202306L
+#      error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_smart_ptr_owner_equality
+#      error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++26"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
index f2bec492363d1..52fc2d1854fec 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
@@ -5,146 +5,143 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <memory_resource>
 
 // Test the feature test macros defined by <memory_resource>
 
-/*  Constant                           Value
-    __cpp_lib_memory_resource          201603L [C++17]
-    __cpp_lib_polymorphic_allocator    201902L [C++20]
-*/
+// clang-format off
 
 #include <memory_resource>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_memory_resource
-#   error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_memory_resource
+#    error "__cpp_lib_memory_resource should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_memory_resource
-#   error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_memory_resource
+#    error "__cpp_lib_memory_resource should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++17"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++17"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++20"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++20"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++20"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++20"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++23"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++23"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++23"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++23"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++26"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++26"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++26"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++26"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
index 49601e4d78cea..fb3734fff10e5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,84 +15,84 @@
 
 // Test the feature test macros defined by <mutex>
 
-/*  Constant                 Value
-    __cpp_lib_scoped_lock    201703L [C++17]
-*/
+// clang-format off
 
 #include <mutex>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_scoped_lock
-#   error "__cpp_lib_scoped_lock should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_scoped_lock
+#    error "__cpp_lib_scoped_lock should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_scoped_lock
-#   error "__cpp_lib_scoped_lock should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_scoped_lock
+#    error "__cpp_lib_scoped_lock should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++17"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++17"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++20"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++20"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++23"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++23"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++26"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++26"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
index 18dae0e4db6c0..b1de3f7629e9d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
@@ -5,217 +5,212 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <new>
 
 // Test the feature test macros defined by <new>
 
-/*  Constant                                Value
-    __cpp_lib_constexpr_new                 202406L [C++26]
-    __cpp_lib_destroying_delete             201806L [C++20]
-    __cpp_lib_hardware_interference_size    201703L [C++17]
-    __cpp_lib_launder                       201606L [C++17]
-*/
+// clang-format off
 
 #include <new>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_hardware_interference_size
-#   error "__cpp_lib_hardware_interference_size should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hardware_interference_size
+#    error "__cpp_lib_hardware_interference_size should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_launder
-#   error "__cpp_lib_launder should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_launder
+#    error "__cpp_lib_launder should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_hardware_interference_size
-#   error "__cpp_lib_hardware_interference_size should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hardware_interference_size
+#    error "__cpp_lib_hardware_interference_size should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_launder
-#   error "__cpp_lib_launder should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_launder
+#    error "__cpp_lib_launder should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++17"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++17"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++17"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++17"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++17"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++20"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++20"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++20"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++20"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++20"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++20"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++23"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++23"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++23"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++23"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++23"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++23"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_ABI_VCRUNTIME)
-#   ifndef __cpp_lib_constexpr_new
-#     error "__cpp_lib_constexpr_new should be defined in c++26"
-#   endif
-#   if __cpp_lib_constexpr_new != 202406L
-#     error "__cpp_lib_constexpr_new should have the value 202406L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_constexpr_new
-#     error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
-#   endif
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++26"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++26"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++26"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++26"
-# endif
+#  if !defined(_LIBCPP_ABI_VCRUNTIME)
+#    ifndef __cpp_lib_constexpr_new
+#      error "__cpp_lib_constexpr_new should be defined in c++26"
+#    endif
+#    if __cpp_lib_constexpr_new != 202406L
+#      error "__cpp_lib_constexpr_new should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_new
+#      error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
+#    endif
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++26"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++26"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++26"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
index 2e80a8eac103f..e8f109610a3e5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <numbers>
 
 // Test the feature test macros defined by <numbers>
 
-/*  Constant                    Value
-    __cpp_lib_math_constants    201907L [C++20]
-*/
+// clang-format off
 
 #include <numbers>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++20"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++20"
-# endif
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++20"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++23"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++23"
-# endif
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++23"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++26"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++26"
-# endif
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++26"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
index 0743c6c71840c..687c343e34e08 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
@@ -5,258 +5,251 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <numeric>
 
 // Test the feature test macros defined by <numeric>
 
-/*  Constant                           Value
-    __cpp_lib_constexpr_numeric        201911L [C++20]
-    __cpp_lib_gcd_lcm                  201606L [C++17]
-    __cpp_lib_interpolate              201902L [C++20]
-    __cpp_lib_parallel_algorithm       201603L [C++17]
-    __cpp_lib_ranges_iota              202202L [C++23]
-    __cpp_lib_saturation_arithmetic    202311L [C++26]
-*/
+// clang-format off
 
 #include <numeric>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++17"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++17"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++17"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++17"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++20"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++20"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++20"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++20"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++20"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++20"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++23"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++23"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++23"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_iota != 202202L
-#   error "__cpp_lib_ranges_iota should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++23"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++23"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++23"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_iota != 202202L
+#    error "__cpp_lib_ranges_iota should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++26"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++26"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++26"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_iota != 202202L
-#   error "__cpp_lib_ranges_iota should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should be defined in c++26"
-# endif
-# if __cpp_lib_saturation_arithmetic != 202311L
-#   error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++26"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++26"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_iota != 202202L
+#    error "__cpp_lib_ranges_iota should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should be defined in c++26"
+#  endif
+#  if __cpp_lib_saturation_arithmetic != 202311L
+#    error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
index 91abbbc77837b..f8ff69f618777 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
@@ -5,174 +5,167 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <optional>
 
 // Test the feature test macros defined by <optional>
 
-/*  Constant                            Value
-    __cpp_lib_constrained_equality      202403L [C++26]
-    __cpp_lib_freestanding_optional     202311L [C++26]
-    __cpp_lib_optional                  201606L [C++17]
-                                        202106L [C++20]
-                                        202110L [C++23]
-    __cpp_lib_optional_range_support    202406L [C++26]
-*/
+// clang-format off
 
 #include <optional>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_optional
-#   error "__cpp_lib_optional should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_optional
+#    error "__cpp_lib_optional should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_optional
-#   error "__cpp_lib_optional should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_optional
+#    error "__cpp_lib_optional should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++17"
-# endif
-# if __cpp_lib_optional != 201606L
-#   error "__cpp_lib_optional should have the value 201606L in c++17"
-# endif
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++17"
+#  endif
+#  if __cpp_lib_optional != 201606L
+#    error "__cpp_lib_optional should have the value 201606L in c++17"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++20"
-# endif
-# if __cpp_lib_optional != 202106L
-#   error "__cpp_lib_optional should have the value 202106L in c++20"
-# endif
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++20"
+#  endif
+#  if __cpp_lib_optional != 202106L
+#    error "__cpp_lib_optional should have the value 202106L in c++20"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++23"
-# endif
-# if __cpp_lib_optional != 202110L
-#   error "__cpp_lib_optional should have the value 202110L in c++23"
-# endif
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++23"
+#  endif
+#  if __cpp_lib_optional != 202110L
+#    error "__cpp_lib_optional should have the value 202110L in c++23"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_constrained_equality != 202403L
-#     error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_optional
-#     error "__cpp_lib_freestanding_optional should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_optional != 202311L
-#     error "__cpp_lib_freestanding_optional should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_optional
-#     error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++26"
-# endif
-# if __cpp_lib_optional != 202110L
-#   error "__cpp_lib_optional should have the value 202110L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_optional_range_support
-#     error "__cpp_lib_optional_range_support should be defined in c++26"
-#   endif
-#   if __cpp_lib_optional_range_support != 202406L
-#     error "__cpp_lib_optional_range_support should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_optional_range_support
-#     error "__cpp_lib_optional_range_support should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_constrained_equality != 202403L
+#      error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_optional
+#      error "__cpp_lib_freestanding_optional should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_optional != 202311L
+#      error "__cpp_lib_freestanding_optional should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_optional
+#      error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++26"
+#  endif
+#  if __cpp_lib_optional != 202110L
+#    error "__cpp_lib_optional should have the value 202110L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_optional_range_support
+#      error "__cpp_lib_optional_range_support should be defined in c++26"
+#    endif
+#    if __cpp_lib_optional_range_support != 202406L
+#      error "__cpp_lib_optional_range_support should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_optional_range_support
+#      error "__cpp_lib_optional_range_support should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
index 61d7747e4b6d1..de0520af18e2a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,118 +15,117 @@
 
 // Test the feature test macros defined by <ostream>
 
-/*  Constant             Value
-    __cpp_lib_char8_t    201907L [C++20]
-    __cpp_lib_print      202207L [C++23]
-*/
+// clang-format off
 
 #include <ostream>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++23"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++23"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++26"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++26"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
index c9743cf41ef1e..263d20ace2fd9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-filesystem
 
@@ -17,66 +15,66 @@
 
 // Test the feature test macros defined by <print>
 
-/*  Constant           Value
-    __cpp_lib_print    202207L [C++23]
-*/
+// clang-format off
 
 #include <print>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++23"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++23"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++26"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++26"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
index 5a5739ff5e7c7..6aff89ae3f95a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
@@ -5,95 +5,92 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <queue>
 
 // Test the feature test macros defined by <queue>
 
-/*  Constant                                       Value
-    __cpp_lib_adaptor_iterator_pair_constructor    202106L [C++23]
-    __cpp_lib_containers_ranges                    202202L [C++23]
-*/
+// clang-format off
 
 #include <queue>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
+#  endif
 
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
+#  endif
 
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
index 2e36c73172cd4..d40d115443977 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
@@ -5,101 +5,98 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <random>
 
 // Test the feature test macros defined by <random>
 
-/*  Constant                     Value
-    __cpp_lib_generate_random    202403L [C++26]
-    __cpp_lib_philox_engine      202406L [C++26]
-*/
+// clang-format off
 
 #include <random>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_generate_random
-#     error "__cpp_lib_generate_random should be defined in c++26"
-#   endif
-#   if __cpp_lib_generate_random != 202403L
-#     error "__cpp_lib_generate_random should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_generate_random
-#     error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_philox_engine
-#     error "__cpp_lib_philox_engine should be defined in c++26"
-#   endif
-#   if __cpp_lib_philox_engine != 202406L
-#     error "__cpp_lib_philox_engine should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_philox_engine
-#     error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_generate_random
+#      error "__cpp_lib_generate_random should be defined in c++26"
+#    endif
+#    if __cpp_lib_generate_random != 202403L
+#      error "__cpp_lib_generate_random should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_generate_random
+#      error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_philox_engine
+#      error "__cpp_lib_philox_engine should be defined in c++26"
+#    endif
+#    if __cpp_lib_philox_engine != 202406L
+#      error "__cpp_lib_philox_engine should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_philox_engine
+#      error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
index 8493505ef0236..c7c8112e123cd 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
@@ -5,475 +5,461 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <ranges>
 
 // Test the feature test macros defined by <ranges>
 
-/*  Constant                                                Value
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_ranges                                        202110L [C++20]
-                                                            202406L [C++23]
-    __cpp_lib_ranges_as_const                               202207L [C++23]
-    __cpp_lib_ranges_as_rvalue                              202207L [C++23]
-    __cpp_lib_ranges_chunk                                  202202L [C++23]
-    __cpp_lib_ranges_chunk_by                               202202L [C++23]
-    __cpp_lib_ranges_concat                                 202403L [C++26]
-    __cpp_lib_ranges_join_with                              202202L [C++23]
-    __cpp_lib_ranges_repeat                                 202207L [C++23]
-    __cpp_lib_ranges_slide                                  202202L [C++23]
-    __cpp_lib_ranges_to_container                           202202L [C++23]
-    __cpp_lib_ranges_zip                                    202110L [C++23]
-*/
+// clang-format off
 
 #include <ranges>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_as_const != 202207L
-#     error "__cpp_lib_ranges_as_const should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_as_rvalue != 202207L
-#   error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_chunk != 202202L
-#     error "__cpp_lib_ranges_chunk should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_chunk_by != 202202L
-#   error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_join_with != 202202L
-#     error "__cpp_lib_ranges_join_with should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_repeat != 202207L
-#   error "__cpp_lib_ranges_repeat should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_slide != 202202L
-#     error "__cpp_lib_ranges_slide should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_to_container != 202202L
-#   error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_as_const != 202207L
+#      error "__cpp_lib_ranges_as_const should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_as_rvalue != 202207L
+#    error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_chunk != 202202L
+#      error "__cpp_lib_ranges_chunk should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_chunk_by != 202202L
+#    error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_join_with != 202202L
+#      error "__cpp_lib_ranges_join_with should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_repeat != 202207L
+#    error "__cpp_lib_ranges_repeat should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_slide != 202202L
+#      error "__cpp_lib_ranges_slide should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_to_container != 202202L
+#    error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_as_const != 202207L
-#     error "__cpp_lib_ranges_as_const should have the value 202207L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_as_rvalue != 202207L
-#   error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_chunk != 202202L
-#     error "__cpp_lib_ranges_chunk should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_chunk_by != 202202L
-#   error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_concat
-#     error "__cpp_lib_ranges_concat should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_concat != 202403L
-#     error "__cpp_lib_ranges_concat should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_concat
-#     error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_join_with != 202202L
-#     error "__cpp_lib_ranges_join_with should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_repeat != 202207L
-#   error "__cpp_lib_ranges_repeat should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_slide != 202202L
-#     error "__cpp_lib_ranges_slide should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_to_container != 202202L
-#   error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_as_const != 202207L
+#      error "__cpp_lib_ranges_as_const should have the value 202207L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_as_rvalue != 202207L
+#    error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_chunk != 202202L
+#      error "__cpp_lib_ranges_chunk should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_chunk_by != 202202L
+#    error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_concat
+#      error "__cpp_lib_ranges_concat should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_concat != 202403L
+#      error "__cpp_lib_ranges_concat should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_concat
+#      error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_join_with != 202202L
+#      error "__cpp_lib_ranges_join_with should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_repeat != 202207L
+#    error "__cpp_lib_ranges_repeat should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_slide != 202202L
+#      error "__cpp_lib_ranges_slide should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_to_container != 202202L
+#    error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
index 38adba62079d7..6507e1c683f24 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
@@ -5,61 +5,59 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <ratio>
 
 // Test the feature test macros defined by <ratio>
 
-/*  Constant           Value
-    __cpp_lib_ratio    202306L [C++26]
-*/
+// clang-format off
 
 #include <ratio>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should be defined in c++26"
-# endif
-# if __cpp_lib_ratio != 202306L
-#   error "__cpp_lib_ratio should have the value 202306L in c++26"
-# endif
+#  ifndef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should be defined in c++26"
+#  endif
+#  if __cpp_lib_ratio != 202306L
+#    error "__cpp_lib_ratio should have the value 202306L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
index 5aa8ae0eba72c..d6acf35d63ab0 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,60 +15,60 @@
 
 // Test the feature test macros defined by <regex>
 
-/*  Constant                                Value
-    __cpp_lib_nonmember_container_access    201411L [C++17]
-*/
+// clang-format off
 
 #include <regex>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
index 7e254ccb1ff4f..4246f2515dc09 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
@@ -5,70 +5,68 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <scoped_allocator>
 
 // Test the feature test macros defined by <scoped_allocator>
 
-/*  Constant                                      Value
-    __cpp_lib_allocator_traits_is_always_equal    201411L [C++17]
-*/
+// clang-format off
 
 #include <scoped_allocator>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
index bdc818ce8d688..fd0f0c51e72b2 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <semaphore>
 
-/*  Constant               Value
-    __cpp_lib_semaphore    201907L [C++20]
-*/
+// clang-format off
 
 #include <semaphore>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++20"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++20"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++23"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++23"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++26"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++26"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
index a733f17c3153c..80eae6e1fd274 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
@@ -5,326 +5,317 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <set>
 
 // Test the feature test macros defined by <set>
 
-/*  Constant                                         Value
-    __cpp_lib_allocator_traits_is_always_equal       201411L [C++17]
-    __cpp_lib_associative_heterogeneous_erasure      202110L [C++23]
-    __cpp_lib_associative_heterogeneous_insertion    202306L [C++26]
-    __cpp_lib_containers_ranges                      202202L [C++23]
-    __cpp_lib_erase_if                               202002L [C++20]
-    __cpp_lib_generic_associative_lookup             201304L [C++14]
-    __cpp_lib_node_extract                           201606L [C++17]
-    __cpp_lib_nonmember_container_access             201411L [C++17]
-*/
+// clang-format off
 
 #include <set>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++14"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++14"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++17"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++17"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++17"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++17"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++20"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++20"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++23"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++23"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_insertion != 202306L
-#     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++26"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_insertion != 202306L
+#      error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++26"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
index 0dd6303cbfd04..4392173ebbb3a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,154 +15,153 @@
 
 // Test the feature test macros defined by <shared_mutex>
 
-/*  Constant                        Value
-    __cpp_lib_shared_mutex          201505L [C++17]
-    __cpp_lib_shared_timed_mutex    201402L [C++14]
-*/
+// clang-format off
 
 #include <shared_mutex>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_shared_mutex
-#   error "__cpp_lib_shared_mutex should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_mutex
+#    error "__cpp_lib_shared_mutex should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_timed_mutex
-#   error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_shared_timed_mutex
+#    error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_shared_mutex
-#   error "__cpp_lib_shared_mutex should not be defined before c++17"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++14"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  ifdef __cpp_lib_shared_mutex
+#    error "__cpp_lib_shared_mutex should not be defined before c++17"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++14"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++17"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++17"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++20"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++20"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++20"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++20"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++23"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++23"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++23"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++23"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++26"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++26"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++26"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++26"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
index 7c5d882a37e61..2b326e2b37832 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
@@ -5,67 +5,65 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <source_location>
 
 // Test the feature test macros defined by <source_location>
 
-/*  Constant                     Value
-    __cpp_lib_source_location    201907L [C++20]
-*/
+// clang-format off
 
 #include <source_location>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++20"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++20"
-# endif
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++20"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++23"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++23"
-# endif
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++23"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++26"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++26"
-# endif
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++26"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
index e1694308f12a7..3c550e0fa676e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
@@ -5,123 +5,119 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <span>
 
 // Test the feature test macros defined by <span>
 
-/*  Constant                           Value
-    __cpp_lib_span                     202002L [C++20]
-    __cpp_lib_span_at                  202311L [C++26]
-    __cpp_lib_span_initializer_list    202311L [C++26]
-*/
+// clang-format off
 
 #include <span>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++20"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++20"
-# endif
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++20"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++20"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++23"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++23"
-# endif
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++23"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++23"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++26"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should be defined in c++26"
-# endif
-# if __cpp_lib_span_at != 202311L
-#   error "__cpp_lib_span_at should have the value 202311L in c++26"
-# endif
-
-# ifndef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should be defined in c++26"
-# endif
-# if __cpp_lib_span_initializer_list != 202311L
-#   error "__cpp_lib_span_initializer_list should have the value 202311L in c++26"
-# endif
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++26"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should be defined in c++26"
+#  endif
+#  if __cpp_lib_span_at != 202311L
+#    error "__cpp_lib_span_at should have the value 202311L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should be defined in c++26"
+#  endif
+#  if __cpp_lib_span_initializer_list != 202311L
+#    error "__cpp_lib_span_initializer_list should have the value 202311L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
index ad3c8e4012ecf..b7650c436128e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,51 +15,51 @@
 
 // Test the feature test macros defined by <sstream>
 
-/*  Constant                              Value
-    __cpp_lib_sstream_from_string_view    202306L [C++26]
-*/
+// clang-format off
 
 #include <sstream>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_sstream_from_string_view != 202306L
-#   error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26"
-# endif
+#  ifndef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_sstream_from_string_view != 202306L
+#    error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
index db51c4782b6ce..1e530ccc3043d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
@@ -5,95 +5,92 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <stack>
 
 // Test the feature test macros defined by <stack>
 
-/*  Constant                                       Value
-    __cpp_lib_adaptor_iterator_pair_constructor    202106L [C++23]
-    __cpp_lib_containers_ranges                    202202L [C++23]
-*/
+// clang-format off
 
 #include <stack>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
+#  endif
 
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
+#  endif
 
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
index c25137adbc156..113ffce2a5d12 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,54 +15,54 @@
 
 // Test the feature test macros defined by <stdatomic.h>
 
-/*  Constant                 Value
-    __cpp_lib_stdatomic_h    202011L [C++23]
-*/
+// clang-format off
 
 #include <stdatomic.h>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should be defined in c++23"
-# endif
-# if __cpp_lib_stdatomic_h != 202011L
-#   error "__cpp_lib_stdatomic_h should have the value 202011L in c++23"
-# endif
+#  ifndef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should be defined in c++23"
+#  endif
+#  if __cpp_lib_stdatomic_h != 202011L
+#    error "__cpp_lib_stdatomic_h should have the value 202011L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should be defined in c++26"
-# endif
-# if __cpp_lib_stdatomic_h != 202011L
-#   error "__cpp_lib_stdatomic_h should have the value 202011L in c++26"
-# endif
+#  ifndef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should be defined in c++26"
+#  endif
+#  if __cpp_lib_stdatomic_h != 202011L
+#    error "__cpp_lib_stdatomic_h should have the value 202011L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
index c4fa735bf4e63..ac70b0c21e018 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <stop_token>
 
-/*  Constant             Value
-    __cpp_lib_jthread    201911L [C++20]
-*/
+// clang-format off
 
 #include <stop_token>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++20"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++20"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++23"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++23"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++26"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++26"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
index 69a938edd1cb9..40a6c07081008 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
@@ -5,501 +5,485 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <string>
 
 // Test the feature test macros defined by <string>
 
-/*  Constant                                                Value
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_char8_t                                       201907L [C++20]
-    __cpp_lib_constexpr_string                              201907L [C++20]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-    __cpp_lib_starts_ends_with                              201711L [C++20]
-    __cpp_lib_string_contains                               202011L [C++23]
-    __cpp_lib_string_resize_and_overwrite                   202110L [C++23]
-    __cpp_lib_string_udls                                   201304L [C++14]
-    __cpp_lib_string_view                                   201606L [C++17]
-                                                            201803L [C++20]
-                                                            202403L [C++26]
-    __cpp_lib_to_string                                     202306L [C++26]
-*/
+// clang-format off
 
 #include <string>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
 
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++14"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++14"
+#  endif
 
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++17"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++17"
-# endif
-# if __cpp_lib_string_view != 201606L
-#   error "__cpp_lib_string_view should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++17"
+#  endif
+#  if __cpp_lib_string_view != 201606L
+#    error "__cpp_lib_string_view should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++20"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++20"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++20"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++20"
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++20"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++20"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++23"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++23"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_string_resize_and_overwrite != 202110L
-#   error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++23"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++23"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++23"
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_resize_and_overwrite != 202110L
+#    error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++26"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++26"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_string_resize_and_overwrite != 202110L
-#   error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++26"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_string_view != 202403L
-#   error "__cpp_lib_string_view should have the value 202403L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_string
-#     error "__cpp_lib_to_string should be defined in c++26"
-#   endif
-#   if __cpp_lib_to_string != 202306L
-#     error "__cpp_lib_to_string should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_string
-#     error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_resize_and_overwrite != 202110L
+#    error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_view != 202403L
+#    error "__cpp_lib_string_view should have the value 202403L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_string
+#      error "__cpp_lib_to_string should be defined in c++26"
+#    endif
+#    if __cpp_lib_to_string != 202306L
+#      error "__cpp_lib_to_string should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_string
+#      error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
index f3c70cf977973..bda523614106c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
@@ -5,257 +5,248 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <string_view>
 
 // Test the feature test macros defined by <string_view>
 
-/*  Constant                              Value
-    __cpp_lib_char8_t                     201907L [C++20]
-    __cpp_lib_constexpr_string_view       201811L [C++20]
-    __cpp_lib_freestanding_string_view    202311L [C++26]
-    __cpp_lib_starts_ends_with            201711L [C++20]
-    __cpp_lib_string_contains             202011L [C++23]
-    __cpp_lib_string_view                 201606L [C++17]
-                                          201803L [C++20]
-                                          202403L [C++26]
-*/
+// clang-format off
 
 #include <string_view>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++17"
-# endif
-# if __cpp_lib_string_view != 201606L
-#   error "__cpp_lib_string_view should have the value 201606L in c++17"
-# endif
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++17"
+#  endif
+#  if __cpp_lib_string_view != 201606L
+#    error "__cpp_lib_string_view should have the value 201606L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++20"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++20"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++20"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++20"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++20"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++23"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++23"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++23"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++23"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_string_view
-#     error "__cpp_lib_freestanding_string_view should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_string_view != 202311L
-#     error "__cpp_lib_freestanding_string_view should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_string_view
-#     error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++26"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++26"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_string_view != 202403L
-#   error "__cpp_lib_string_view should have the value 202403L in c++26"
-# endif
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_string_view
+#      error "__cpp_lib_freestanding_string_view should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_string_view != 202311L
+#      error "__cpp_lib_freestanding_string_view should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_string_view
+#      error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_view != 202403L
+#    error "__cpp_lib_string_view should have the value 202403L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
index 9cf763701ffc0..0eaf9f1aff4fe 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-localization
 
@@ -17,75 +15,75 @@
 
 // Test the feature test macros defined by <syncstream>
 
-/*  Constant             Value
-    __cpp_lib_syncbuf    201803L [C++20]
-*/
+// clang-format off
 
 #include <syncstream>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++20"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++20"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++23"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++23"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++26"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++26"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
index d1a9919afeb37..e6c44a223ee89 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
@@ -5,11 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // UNSUPPORTED: no-threads
 
@@ -17,118 +15,117 @@
 
 // Test the feature test macros defined by <thread>
 
-/*  Constant                Value
-    __cpp_lib_formatters    202302L [C++23]
-    __cpp_lib_jthread       201911L [C++20]
-*/
+// clang-format off
 
 #include <thread>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++20"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++20"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should be defined in c++23"
-#   endif
-#   if __cpp_lib_formatters != 202302L
-#     error "__cpp_lib_formatters should have the value 202302L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++23"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should be defined in c++23"
+#    endif
+#    if __cpp_lib_formatters != 202302L
+#      error "__cpp_lib_formatters should have the value 202302L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++23"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should be defined in c++26"
-#   endif
-#   if __cpp_lib_formatters != 202302L
-#     error "__cpp_lib_formatters should have the value 202302L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++26"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should be defined in c++26"
+#    endif
+#    if __cpp_lib_formatters != 202302L
+#      error "__cpp_lib_formatters should have the value 202302L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++26"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
index 6dd2e968fb8da..f4a2fd8b29f45 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
@@ -5,342 +5,332 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <tuple>
 
 // Test the feature test macros defined by <tuple>
 
-/*  Constant                          Value
-    __cpp_lib_apply                   201603L [C++17]
-    __cpp_lib_constexpr_tuple         201811L [C++20]
-    __cpp_lib_constrained_equality    202403L [C++26]
-    __cpp_lib_make_from_tuple         201606L [C++17]
-    __cpp_lib_ranges_zip              202110L [C++23]
-    __cpp_lib_tuple_element_t         201402L [C++14]
-    __cpp_lib_tuple_like              202207L [C++23]
-                                      202311L [C++26]
-    __cpp_lib_tuples_by_type          201304L [C++14]
-*/
+// clang-format off
 
 #include <tuple>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_apply
-#   error "__cpp_lib_apply should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_apply
+#    error "__cpp_lib_apply should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should not be defined before c++14"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_apply
-#   error "__cpp_lib_apply should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_apply
+#    error "__cpp_lib_apply should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++14"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
-# endif
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++14"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++14"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
-# endif
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++14"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++17"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++17"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++17"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++17"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
-# endif
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++17"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++17"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++17"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++20"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++20"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++20"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++20"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++20"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
-# endif
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++20"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++20"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++23"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++23"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++23"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++23"
-#   endif
-#   if __cpp_lib_tuple_like != 202207L
-#     error "__cpp_lib_tuple_like should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++23"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
-# endif
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++23"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++23"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++23"
+#    endif
+#    if __cpp_lib_tuple_like != 202207L
+#      error "__cpp_lib_tuple_like should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++26"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_constrained_equality != 202403L
-#     error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++26"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++26"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++26"
-#   endif
-#   if __cpp_lib_tuple_like != 202311L
-#     error "__cpp_lib_tuple_like should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++26"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
-# endif
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++26"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_constrained_equality != 202403L
+#      error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++26"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++26"
+#    endif
+#    if __cpp_lib_tuple_like != 202311L
+#      error "__cpp_lib_tuple_like should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
index d9d698ace2b65..45c51b5807c69 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
@@ -5,988 +5,962 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <type_traits>
 
 // Test the feature test macros defined by <type_traits>
 
-/*  Constant                                       Value
-    __cpp_lib_bool_constant                        201505L [C++17]
-    __cpp_lib_bounded_array_traits                 201902L [C++20]
-    __cpp_lib_has_unique_object_representations    201606L [C++17]
-    __cpp_lib_integral_constant_callable           201304L [C++14]
-    __cpp_lib_is_aggregate                         201703L [C++17]
-    __cpp_lib_is_constant_evaluated                201811L [C++20]
-    __cpp_lib_is_final                             201402L [C++14]
-    __cpp_lib_is_implicit_lifetime                 202302L [C++23]
-    __cpp_lib_is_invocable                         201703L [C++17]
-    __cpp_lib_is_layout_compatible                 201907L [C++20]
-    __cpp_lib_is_nothrow_convertible               201806L [C++20]
-    __cpp_lib_is_null_pointer                      201309L [C++14]
-    __cpp_lib_is_pointer_interconvertible          201907L [C++20]
-    __cpp_lib_is_scoped_enum                       202011L [C++23]
-    __cpp_lib_is_swappable                         201603L [C++17]
-    __cpp_lib_is_virtual_base_of                   202406L [C++26]
-    __cpp_lib_is_within_lifetime                   202306L [C++26]
-    __cpp_lib_logical_traits                       201510L [C++17]
-    __cpp_lib_reference_from_temporary             202202L [C++23]
-    __cpp_lib_remove_cvref                         201711L [C++20]
-    __cpp_lib_result_of_sfinae                     201210L [C++14]
-    __cpp_lib_transformation_trait_aliases         201304L [C++14]
-    __cpp_lib_type_identity                        201806L [C++20]
-    __cpp_lib_type_trait_variable_templates        201510L [C++17]
-    __cpp_lib_void_t                               201411L [C++17]
-*/
+// clang-format off
 
 #include <type_traits>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++14"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++14"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++14"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++14"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++14"
-# endif
-
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++14"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++14"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++14"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++14"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++14"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++14"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++14"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++17"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++17"
-# endif
-
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++17"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++17"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++17"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++17"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++17"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++17"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++17"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++17"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++17"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++17"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++17"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++17"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++17"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++17"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++17"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++17"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++17"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++17"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++17"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++17"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++17"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++17"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++20"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++20"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++20"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20"
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++20"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++20"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++20"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++20"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++20"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++20"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++20"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++20"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++20"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++20"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++20"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++20"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++20"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++20"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++20"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++20"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++20"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++20"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++20"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++20"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++20"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++20"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++20"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++20"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++20"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++20"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++20"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++20"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++20"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++20"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++20"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++20"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++20"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++23"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++23"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++23"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++23"
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++23"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++23"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++23"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++23"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++23"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++23"
-# endif
-
-# if __has_builtin(__builtin_is_implicit_lifetime)
-#   ifndef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_implicit_lifetime != 202302L
-#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++23"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++23"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++23"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should be defined in c++23"
-# endif
-# if __cpp_lib_is_scoped_enum != 202011L
-#   error "__cpp_lib_is_scoped_enum should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++23"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++23"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++23"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should be defined in c++23"
-#   endif
-#   if __cpp_lib_reference_from_temporary != 202202L
-#     error "__cpp_lib_reference_from_temporary should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++23"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++23"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++23"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++23"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++23"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++23"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++23"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++23"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++23"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++23"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++23"
+#  endif
+
+#  if __has_builtin(__builtin_is_implicit_lifetime)
+#    ifndef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_implicit_lifetime != 202302L
+#      error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_scoped_enum != 202011L
+#    error "__cpp_lib_is_scoped_enum should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++23"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should be defined in c++23"
+#    endif
+#    if __cpp_lib_reference_from_temporary != 202202L
+#      error "__cpp_lib_reference_from_temporary should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++23"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++23"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++23"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++23"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++23"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++23"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++26"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++26"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++26"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++26"
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++26"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++26"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++26"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++26"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++26"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++26"
-# endif
-
-# if __has_builtin(__builtin_is_implicit_lifetime)
-#   ifndef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_implicit_lifetime != 202302L
-#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++26"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++26"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++26"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should be defined in c++26"
-# endif
-# if __cpp_lib_is_scoped_enum != 202011L
-#   error "__cpp_lib_is_scoped_enum should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++26"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++26"
-# endif
-
-# if __has_builtin(__builtin_is_virtual_base_of)
-#   ifndef __cpp_lib_is_virtual_base_of
-#     error "__cpp_lib_is_virtual_base_of should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_virtual_base_of != 202406L
-#     error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_is_virtual_base_of
-#     error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_within_lifetime
-#     error "__cpp_lib_is_within_lifetime should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_within_lifetime != 202306L
-#     error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_within_lifetime
-#     error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++26"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should be defined in c++26"
-#   endif
-#   if __cpp_lib_reference_from_temporary != 202202L
-#     error "__cpp_lib_reference_from_temporary should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++26"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++26"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++26"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++26"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++26"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++26"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++26"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++26"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++26"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++26"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++26"
+#  endif
+
+#  if __has_builtin(__builtin_is_implicit_lifetime)
+#    ifndef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_implicit_lifetime != 202302L
+#      error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_scoped_enum != 202011L
+#    error "__cpp_lib_is_scoped_enum should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++26"
+#  endif
+
+#  if __has_builtin(__builtin_is_virtual_base_of)
+#    ifndef __cpp_lib_is_virtual_base_of
+#      error "__cpp_lib_is_virtual_base_of should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_virtual_base_of != 202406L
+#      error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_virtual_base_of
+#      error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_within_lifetime
+#      error "__cpp_lib_is_within_lifetime should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_within_lifetime != 202306L
+#      error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_within_lifetime
+#      error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++26"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should be defined in c++26"
+#    endif
+#    if __cpp_lib_reference_from_temporary != 202202L
+#      error "__cpp_lib_reference_from_temporary should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++26"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++26"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++26"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++26"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++26"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++26"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
index aa67917587bfa..0729b0b37ee6a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
@@ -5,64 +5,62 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <typeinfo>
 
 // Test the feature test macros defined by <typeinfo>
 
-/*  Constant                        Value
-    __cpp_lib_constexpr_typeinfo    202106L [C++23]
-*/
+// clang-format off
 
 #include <typeinfo>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-#   error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23"
-# endif
+#  ifndef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_typeinfo != 202106L
+#    error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-#   error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26"
-# endif
+#  ifndef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_typeinfo != 202106L
+#    error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
index 83c12730a671d..74b3c8fff69b3 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
@@ -5,401 +5,389 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <unordered_map>
 
 // Test the feature test macros defined by <unordered_map>
 
-/*  Constant                                         Value
-    __cpp_lib_allocator_traits_is_always_equal       201411L [C++17]
-    __cpp_lib_associative_heterogeneous_erasure      202110L [C++23]
-    __cpp_lib_associative_heterogeneous_insertion    202306L [C++26]
-    __cpp_lib_containers_ranges                      202202L [C++23]
-    __cpp_lib_erase_if                               202002L [C++20]
-    __cpp_lib_generic_unordered_lookup               201811L [C++20]
-    __cpp_lib_node_extract                           201606L [C++17]
-    __cpp_lib_nonmember_container_access             201411L [C++17]
-    __cpp_lib_tuple_like                             202207L [C++23]
-                                                     202311L [C++26]
-    __cpp_lib_unordered_map_try_emplace              201411L [C++17]
-*/
+// clang-format off
 
 #include <unordered_map>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++17"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++17"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++17"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++17"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++20"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++20"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++20"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++20"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++23"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++23"
-#   endif
-#   if __cpp_lib_tuple_like != 202207L
-#     error "__cpp_lib_tuple_like should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++23"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++23"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++23"
+#    endif
+#    if __cpp_lib_tuple_like != 202207L
+#      error "__cpp_lib_tuple_like should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_insertion != 202306L
-#     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++26"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++26"
-#   endif
-#   if __cpp_lib_tuple_like != 202311L
-#     error "__cpp_lib_tuple_like should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++26"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_insertion != 202306L
+#      error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++26"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++26"
+#    endif
+#    if __cpp_lib_tuple_like != 202311L
+#      error "__cpp_lib_tuple_like should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
index 4da49a45698d4..9c400ddd2f657 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
@@ -5,320 +5,311 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <unordered_set>
 
 // Test the feature test macros defined by <unordered_set>
 
-/*  Constant                                         Value
-    __cpp_lib_allocator_traits_is_always_equal       201411L [C++17]
-    __cpp_lib_associative_heterogeneous_erasure      202110L [C++23]
-    __cpp_lib_associative_heterogeneous_insertion    202306L [C++26]
-    __cpp_lib_containers_ranges                      202202L [C++23]
-    __cpp_lib_erase_if                               202002L [C++20]
-    __cpp_lib_generic_unordered_lookup               201811L [C++20]
-    __cpp_lib_node_extract                           201606L [C++17]
-    __cpp_lib_nonmember_container_access             201411L [C++17]
-*/
+// clang-format off
 
 #include <unordered_set>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++17"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++17"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++20"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++20"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++23"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++23"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_insertion != 202306L
-#     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++26"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_insertion != 202306L
+#      error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++26"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
index 2a750addbb95f..e0a83c7813b28 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
@@ -5,507 +5,491 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <utility>
 
 // Test the feature test macros defined by <utility>
 
-/*  Constant                                  Value
-    __cpp_lib_as_const                        201510L [C++17]
-    __cpp_lib_constexpr_algorithms            201806L [C++20]
-                                              202306L [C++26]
-    __cpp_lib_constexpr_utility               201811L [C++20]
-    __cpp_lib_constrained_equality            202403L [C++26]
-    __cpp_lib_exchange_function               201304L [C++14]
-    __cpp_lib_forward_like                    202207L [C++23]
-    __cpp_lib_integer_comparison_functions    202002L [C++20]
-    __cpp_lib_integer_sequence                201304L [C++14]
-    __cpp_lib_ranges_zip                      202110L [C++23]
-    __cpp_lib_to_underlying                   202102L [C++23]
-    __cpp_lib_tuple_like                      202207L [C++23]
-                                              202311L [C++26]
-    __cpp_lib_tuples_by_type                  201304L [C++14]
-    __cpp_lib_unreachable                     202202L [C++23]
-*/
+// clang-format off
 
 #include <utility>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++14"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++14"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++14"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++14"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++14"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++14"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++17"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++17"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++17"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++17"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++17"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++17"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++17"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++17"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++20"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++20"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++20"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++20"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++20"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++20"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++20"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++20"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++20"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++20"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++23"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++23"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should be defined in c++23"
-# endif
-# if __cpp_lib_forward_like != 202207L
-#   error "__cpp_lib_forward_like should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++23"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++23"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should be defined in c++23"
-# endif
-# if __cpp_lib_to_underlying != 202102L
-#   error "__cpp_lib_to_underlying should have the value 202102L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++23"
-#   endif
-#   if __cpp_lib_tuple_like != 202207L
-#     error "__cpp_lib_tuple_like should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++23"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should be defined in c++23"
-# endif
-# if __cpp_lib_unreachable != 202202L
-#   error "__cpp_lib_unreachable should have the value 202202L in c++23"
-# endif
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++23"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++23"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should be defined in c++23"
+#  endif
+#  if __cpp_lib_forward_like != 202207L
+#    error "__cpp_lib_forward_like should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++23"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++23"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_underlying != 202102L
+#    error "__cpp_lib_to_underlying should have the value 202102L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++23"
+#    endif
+#    if __cpp_lib_tuple_like != 202207L
+#      error "__cpp_lib_tuple_like should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should be defined in c++23"
+#  endif
+#  if __cpp_lib_unreachable != 202202L
+#    error "__cpp_lib_unreachable should have the value 202202L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++26"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_algorithms != 202306L
-#   error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_constrained_equality != 202403L
-#     error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++26"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should be defined in c++26"
-# endif
-# if __cpp_lib_forward_like != 202207L
-#   error "__cpp_lib_forward_like should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++26"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++26"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should be defined in c++26"
-# endif
-# if __cpp_lib_to_underlying != 202102L
-#   error "__cpp_lib_to_underlying should have the value 202102L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++26"
-#   endif
-#   if __cpp_lib_tuple_like != 202311L
-#     error "__cpp_lib_tuple_like should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++26"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should be defined in c++26"
-# endif
-# if __cpp_lib_unreachable != 202202L
-#   error "__cpp_lib_unreachable should have the value 202202L in c++26"
-# endif
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++26"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 202306L
+#    error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_constrained_equality != 202403L
+#      error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++26"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should be defined in c++26"
+#  endif
+#  if __cpp_lib_forward_like != 202207L
+#    error "__cpp_lib_forward_like should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++26"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++26"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_underlying != 202102L
+#    error "__cpp_lib_to_underlying should have the value 202102L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++26"
+#    endif
+#    if __cpp_lib_tuple_like != 202311L
+#      error "__cpp_lib_tuple_like should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should be defined in c++26"
+#  endif
+#  if __cpp_lib_unreachable != 202202L
+#    error "__cpp_lib_unreachable should have the value 202202L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
index 598e976bda3cf..dc4af4d09f9e5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
@@ -5,140 +5,134 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <variant>
 
 // Test the feature test macros defined by <variant>
 
-/*  Constant                          Value
-    __cpp_lib_constrained_equality    202403L [C++26]
-    __cpp_lib_freestanding_variant    202311L [C++26]
-    __cpp_lib_variant                 202102L [C++17]
-                                      202106L [C++20]
-                                      202306L [C++26]
-*/
+// clang-format off
 
 #include <variant>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_variant
-#   error "__cpp_lib_variant should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_variant
+#    error "__cpp_lib_variant should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_variant
-#   error "__cpp_lib_variant should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_variant
+#    error "__cpp_lib_variant should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++17"
-# endif
-# if __cpp_lib_variant != 202102L
-#   error "__cpp_lib_variant should have the value 202102L in c++17"
-# endif
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++17"
+#  endif
+#  if __cpp_lib_variant != 202102L
+#    error "__cpp_lib_variant should have the value 202102L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++20"
-# endif
-# if __cpp_lib_variant != 202106L
-#   error "__cpp_lib_variant should have the value 202106L in c++20"
-# endif
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++20"
+#  endif
+#  if __cpp_lib_variant != 202106L
+#    error "__cpp_lib_variant should have the value 202106L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++23"
-# endif
-# if __cpp_lib_variant != 202106L
-#   error "__cpp_lib_variant should have the value 202106L in c++23"
-# endif
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++23"
+#  endif
+#  if __cpp_lib_variant != 202106L
+#    error "__cpp_lib_variant should have the value 202106L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_constrained_equality != 202403L
-#     error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_variant
-#     error "__cpp_lib_freestanding_variant should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_variant != 202311L
-#     error "__cpp_lib_freestanding_variant should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_variant
-#     error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++26"
-# endif
-# if __cpp_lib_variant != 202306L
-#   error "__cpp_lib_variant should have the value 202306L in c++26"
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_constrained_equality != 202403L
+#      error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_variant
+#      error "__cpp_lib_freestanding_variant should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_variant != 202311L
+#      error "__cpp_lib_freestanding_variant should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_variant
+#      error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++26"
+#  endif
+#  if __cpp_lib_variant != 202306L
+#    error "__cpp_lib_variant should have the value 202306L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
index 0eef1e99221e7..c2513ecad8d08 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
@@ -5,277 +5,269 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <vector>
 
 // Test the feature test macros defined by <vector>
 
-/*  Constant                                                Value
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_constexpr_vector                              201907L [C++20]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_incomplete_container_elements                 201505L [C++17]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-*/
+// clang-format off
 
 #include <vector>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++17"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++17"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++20"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++20"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++23"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++23"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++26"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++26"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 9b318f2deabc4..7b2041be4dc86 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -5,8201 +5,7964 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by generate_feature_test_macro_components.py
 // and should not be edited manually.
-//
-// clang-format off
 
 // <version>
 
 // Test the feature test macros defined by <version>
 
-/*  Constant                                                Value
-    __cpp_lib_adaptor_iterator_pair_constructor             202106L [C++23]
-    __cpp_lib_addressof_constexpr                           201603L [C++17]
-    __cpp_lib_allocate_at_least                             202302L [C++23]
-    __cpp_lib_allocator_traits_is_always_equal              201411L [C++17]
-    __cpp_lib_any                                           201606L [C++17]
-    __cpp_lib_apply                                         201603L [C++17]
-    __cpp_lib_array_constexpr                               201603L [C++17]
-                                                            201811L [C++20]
-    __cpp_lib_as_const                                      201510L [C++17]
-    __cpp_lib_associative_heterogeneous_erasure             202110L [C++23]
-    __cpp_lib_associative_heterogeneous_insertion           202306L [C++26]
-    __cpp_lib_assume_aligned                                201811L [C++20]
-    __cpp_lib_atomic_flag_test                              201907L [C++20]
-    __cpp_lib_atomic_float                                  201711L [C++20]
-    __cpp_lib_atomic_is_always_lock_free                    201603L [C++17]
-    __cpp_lib_atomic_lock_free_type_aliases                 201907L [C++20]
-    __cpp_lib_atomic_min_max                                202403L [C++26]
-    __cpp_lib_atomic_ref                                    201806L [C++20]
-    __cpp_lib_atomic_shared_ptr                             201711L [C++20]
-    __cpp_lib_atomic_value_initialization                   201911L [C++20]
-    __cpp_lib_atomic_wait                                   201907L [C++20]
-    __cpp_lib_barrier                                       201907L [C++20]
-    __cpp_lib_bind_back                                     202202L [C++23]
-    __cpp_lib_bind_front                                    201907L [C++20]
-                                                            202306L [C++26]
-    __cpp_lib_bit_cast                                      201806L [C++20]
-    __cpp_lib_bitops                                        201907L [C++20]
-    __cpp_lib_bitset                                        202306L [C++26]
-    __cpp_lib_bool_constant                                 201505L [C++17]
-    __cpp_lib_bounded_array_traits                          201902L [C++20]
-    __cpp_lib_boyer_moore_searcher                          201603L [C++17]
-    __cpp_lib_byte                                          201603L [C++17]
-    __cpp_lib_byteswap                                      202110L [C++23]
-    __cpp_lib_char8_t                                       201907L [C++20]
-    __cpp_lib_chrono                                        201611L [C++17]
-    __cpp_lib_chrono_udls                                   201304L [C++14]
-    __cpp_lib_clamp                                         201603L [C++17]
-    __cpp_lib_complex_udls                                  201309L [C++14]
-    __cpp_lib_concepts                                      202002L [C++20]
-    __cpp_lib_constexpr_algorithms                          201806L [C++20]
-                                                            202306L [C++26]
-    __cpp_lib_constexpr_bitset                              202207L [C++23]
-    __cpp_lib_constexpr_charconv                            202207L [C++23]
-    __cpp_lib_constexpr_cmath                               202202L [C++23]
-    __cpp_lib_constexpr_complex                             201711L [C++20]
-    __cpp_lib_constexpr_dynamic_alloc                       201907L [C++20]
-    __cpp_lib_constexpr_functional                          201907L [C++20]
-    __cpp_lib_constexpr_iterator                            201811L [C++20]
-    __cpp_lib_constexpr_memory                              201811L [C++20]
-                                                            202202L [C++23]
-    __cpp_lib_constexpr_new                                 202406L [C++26]
-    __cpp_lib_constexpr_numeric                             201911L [C++20]
-    __cpp_lib_constexpr_string                              201907L [C++20]
-    __cpp_lib_constexpr_string_view                         201811L [C++20]
-    __cpp_lib_constexpr_tuple                               201811L [C++20]
-    __cpp_lib_constexpr_typeinfo                            202106L [C++23]
-    __cpp_lib_constexpr_utility                             201811L [C++20]
-    __cpp_lib_constexpr_vector                              201907L [C++20]
-    __cpp_lib_constrained_equality                          202403L [C++26]
-    __cpp_lib_containers_ranges                             202202L [C++23]
-    __cpp_lib_copyable_function                             202306L [C++26]
-    __cpp_lib_coroutine                                     201902L [C++20]
-    __cpp_lib_debugging                                     202311L [C++26]
-    __cpp_lib_default_template_type_for_algorithm_values    202403L [C++26]
-    __cpp_lib_destroying_delete                             201806L [C++20]
-    __cpp_lib_enable_shared_from_this                       201603L [C++17]
-    __cpp_lib_endian                                        201907L [C++20]
-    __cpp_lib_erase_if                                      202002L [C++20]
-    __cpp_lib_exchange_function                             201304L [C++14]
-    __cpp_lib_execution                                     201603L [C++17]
-                                                            201902L [C++20]
-    __cpp_lib_expected                                      202211L [C++23]
-    __cpp_lib_filesystem                                    201703L [C++17]
-    __cpp_lib_flat_map                                      202207L [C++23]
-    __cpp_lib_flat_set                                      202207L [C++23]
-    __cpp_lib_format                                        202110L [C++20]
-    __cpp_lib_format_path                                   202403L [C++26]
-    __cpp_lib_format_ranges                                 202207L [C++23]
-    __cpp_lib_format_uchar                                  202311L [C++20]
-    __cpp_lib_formatters                                    202302L [C++23]
-    __cpp_lib_forward_like                                  202207L [C++23]
-    __cpp_lib_freestanding_algorithm                        202311L [C++26]
-    __cpp_lib_freestanding_array                            202311L [C++26]
-    __cpp_lib_freestanding_cstring                          202306L [C++26]
-    __cpp_lib_freestanding_expected                         202311L [C++26]
-    __cpp_lib_freestanding_mdspan                           202311L [C++26]
-    __cpp_lib_freestanding_optional                         202311L [C++26]
-    __cpp_lib_freestanding_string_view                      202311L [C++26]
-    __cpp_lib_freestanding_variant                          202311L [C++26]
-    __cpp_lib_fstream_native_handle                         202306L [C++26]
-    __cpp_lib_function_ref                                  202306L [C++26]
-    __cpp_lib_gcd_lcm                                       201606L [C++17]
-    __cpp_lib_generate_random                               202403L [C++26]
-    __cpp_lib_generic_associative_lookup                    201304L [C++14]
-    __cpp_lib_generic_unordered_lookup                      201811L [C++20]
-    __cpp_lib_hardware_interference_size                    201703L [C++17]
-    __cpp_lib_has_unique_object_representations             201606L [C++17]
-    __cpp_lib_hazard_pointer                                202306L [C++26]
-    __cpp_lib_hypot                                         201603L [C++17]
-    __cpp_lib_incomplete_container_elements                 201505L [C++17]
-    __cpp_lib_inplace_vector                                202406L [C++26]
-    __cpp_lib_int_pow2                                      202002L [C++20]
-    __cpp_lib_integer_comparison_functions                  202002L [C++20]
-    __cpp_lib_integer_sequence                              201304L [C++14]
-    __cpp_lib_integral_constant_callable                    201304L [C++14]
-    __cpp_lib_interpolate                                   201902L [C++20]
-    __cpp_lib_invoke                                        201411L [C++17]
-    __cpp_lib_invoke_r                                      202106L [C++23]
-    __cpp_lib_ios_noreplace                                 202207L [C++23]
-    __cpp_lib_is_aggregate                                  201703L [C++17]
-    __cpp_lib_is_constant_evaluated                         201811L [C++20]
-    __cpp_lib_is_final                                      201402L [C++14]
-    __cpp_lib_is_implicit_lifetime                          202302L [C++23]
-    __cpp_lib_is_invocable                                  201703L [C++17]
-    __cpp_lib_is_layout_compatible                          201907L [C++20]
-    __cpp_lib_is_nothrow_convertible                        201806L [C++20]
-    __cpp_lib_is_null_pointer                               201309L [C++14]
-    __cpp_lib_is_pointer_interconvertible                   201907L [C++20]
-    __cpp_lib_is_scoped_enum                                202011L [C++23]
-    __cpp_lib_is_swappable                                  201603L [C++17]
-    __cpp_lib_is_virtual_base_of                            202406L [C++26]
-    __cpp_lib_is_within_lifetime                            202306L [C++26]
-    __cpp_lib_jthread                                       201911L [C++20]
-    __cpp_lib_latch                                         201907L [C++20]
-    __cpp_lib_launder                                       201606L [C++17]
-    __cpp_lib_linalg                                        202311L [C++26]
-    __cpp_lib_list_remove_return_type                       201806L [C++20]
-    __cpp_lib_logical_traits                                201510L [C++17]
-    __cpp_lib_make_from_tuple                               201606L [C++17]
-    __cpp_lib_make_reverse_iterator                         201402L [C++14]
-    __cpp_lib_make_unique                                   201304L [C++14]
-    __cpp_lib_map_try_emplace                               201411L [C++17]
-    __cpp_lib_math_constants                                201907L [C++20]
-    __cpp_lib_math_special_functions                        201603L [C++17]
-    __cpp_lib_mdspan                                        202207L [C++23]
-                                                            202406L [C++26]
-    __cpp_lib_memory_resource                               201603L [C++17]
-    __cpp_lib_modules                                       202207L [C++23]
-    __cpp_lib_move_iterator_concept                         202207L [C++20]
-    __cpp_lib_move_only_function                            202110L [C++23]
-    __cpp_lib_node_extract                                  201606L [C++17]
-    __cpp_lib_nonmember_container_access                    201411L [C++17]
-    __cpp_lib_not_fn                                        201603L [C++17]
-                                                            202306L [C++26]
-    __cpp_lib_null_iterators                                201304L [C++14]
-    __cpp_lib_optional                                      201606L [C++17]
-                                                            202106L [C++20]
-                                                            202110L [C++23]
-    __cpp_lib_optional_range_support                        202406L [C++26]
-    __cpp_lib_out_ptr                                       202106L [C++23]
-                                                            202311L [C++26]
-    __cpp_lib_parallel_algorithm                            201603L [C++17]
-    __cpp_lib_philox_engine                                 202406L [C++26]
-    __cpp_lib_polymorphic_allocator                         201902L [C++20]
-    __cpp_lib_print                                         202207L [C++23]
-    __cpp_lib_quoted_string_io                              201304L [C++14]
-    __cpp_lib_ranges                                        202110L [C++20]
-                                                            202406L [C++23]
-    __cpp_lib_ranges_as_const                               202207L [C++23]
-    __cpp_lib_ranges_as_rvalue                              202207L [C++23]
-    __cpp_lib_ranges_chunk                                  202202L [C++23]
-    __cpp_lib_ranges_chunk_by                               202202L [C++23]
-    __cpp_lib_ranges_concat                                 202403L [C++26]
-    __cpp_lib_ranges_contains                               202207L [C++23]
-    __cpp_lib_ranges_find_last                              202207L [C++23]
-    __cpp_lib_ranges_iota                                   202202L [C++23]
-    __cpp_lib_ranges_join_with                              202202L [C++23]
-    __cpp_lib_ranges_repeat                                 202207L [C++23]
-    __cpp_lib_ranges_slide                                  202202L [C++23]
-    __cpp_lib_ranges_starts_ends_with                       202106L [C++23]
-    __cpp_lib_ranges_to_container                           202202L [C++23]
-    __cpp_lib_ranges_zip                                    202110L [C++23]
-    __cpp_lib_ratio                                         202306L [C++26]
-    __cpp_lib_raw_memory_algorithms                         201606L [C++17]
-    __cpp_lib_rcu                                           202306L [C++26]
-    __cpp_lib_reference_from_temporary                      202202L [C++23]
-    __cpp_lib_reference_wrapper                             202403L [C++26]
-    __cpp_lib_remove_cvref                                  201711L [C++20]
-    __cpp_lib_result_of_sfinae                              201210L [C++14]
-    __cpp_lib_robust_nonmodifying_seq_ops                   201304L [C++14]
-    __cpp_lib_sample                                        201603L [C++17]
-    __cpp_lib_saturation_arithmetic                         202311L [C++26]
-    __cpp_lib_scoped_lock                                   201703L [C++17]
-    __cpp_lib_semaphore                                     201907L [C++20]
-    __cpp_lib_senders                                       202406L [C++26]
-    __cpp_lib_shared_mutex                                  201505L [C++17]
-    __cpp_lib_shared_ptr_arrays                             201611L [C++17]
-                                                            201707L [C++20]
-    __cpp_lib_shared_ptr_weak_type                          201606L [C++17]
-    __cpp_lib_shared_timed_mutex                            201402L [C++14]
-    __cpp_lib_shift                                         201806L [C++20]
-    __cpp_lib_smart_ptr_for_overwrite                       202002L [C++20]
-    __cpp_lib_smart_ptr_owner_equality                      202306L [C++26]
-    __cpp_lib_source_location                               201907L [C++20]
-    __cpp_lib_span                                          202002L [C++20]
-    __cpp_lib_span_at                                       202311L [C++26]
-    __cpp_lib_span_initializer_list                         202311L [C++26]
-    __cpp_lib_spanstream                                    202106L [C++23]
-    __cpp_lib_ssize                                         201902L [C++20]
-    __cpp_lib_sstream_from_string_view                      202306L [C++26]
-    __cpp_lib_stacktrace                                    202011L [C++23]
-    __cpp_lib_starts_ends_with                              201711L [C++20]
-    __cpp_lib_stdatomic_h                                   202011L [C++23]
-    __cpp_lib_string_contains                               202011L [C++23]
-    __cpp_lib_string_resize_and_overwrite                   202110L [C++23]
-    __cpp_lib_string_udls                                   201304L [C++14]
-    __cpp_lib_string_view                                   201606L [C++17]
-                                                            201803L [C++20]
-                                                            202403L [C++26]
-    __cpp_lib_submdspan                                     202306L [C++26]
-    __cpp_lib_syncbuf                                       201803L [C++20]
-    __cpp_lib_text_encoding                                 202306L [C++26]
-    __cpp_lib_three_way_comparison                          201907L [C++20]
-    __cpp_lib_to_address                                    201711L [C++20]
-    __cpp_lib_to_array                                      201907L [C++20]
-    __cpp_lib_to_chars                                      201611L [C++17]
-                                                            202306L [C++26]
-    __cpp_lib_to_string                                     202306L [C++26]
-    __cpp_lib_to_underlying                                 202102L [C++23]
-    __cpp_lib_transformation_trait_aliases                  201304L [C++14]
-    __cpp_lib_transparent_operators                         201210L [C++14]
-                                                            201510L [C++17]
-    __cpp_lib_tuple_element_t                               201402L [C++14]
-    __cpp_lib_tuple_like                                    202207L [C++23]
-                                                            202311L [C++26]
-    __cpp_lib_tuples_by_type                                201304L [C++14]
-    __cpp_lib_type_identity                                 201806L [C++20]
-    __cpp_lib_type_trait_variable_templates                 201510L [C++17]
-    __cpp_lib_uncaught_exceptions                           201411L [C++17]
-    __cpp_lib_unordered_map_try_emplace                     201411L [C++17]
-    __cpp_lib_unreachable                                   202202L [C++23]
-    __cpp_lib_unwrap_ref                                    201811L [C++20]
-    __cpp_lib_variant                                       202102L [C++17]
-                                                            202106L [C++20]
-                                                            202306L [C++26]
-    __cpp_lib_void_t                                        201411L [C++17]
-*/
+// clang-format off
 
 #include <version>
 #include "test_macros.h"
 
 #if TEST_STD_VER < 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_any
-#   error "__cpp_lib_any should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_apply
-#   error "__cpp_lib_apply should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_apply
+#    error "__cpp_lib_apply should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_byte
-#   error "__cpp_lib_byte should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_byte
+#    error "__cpp_lib_byte should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_debugging
-#   error "__cpp_lib_debugging should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_debugging
+#    error "__cpp_lib_debugging should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_execution
-#   error "__cpp_lib_execution should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_execution
+#    error "__cpp_lib_execution should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_filesystem
-#   error "__cpp_lib_filesystem should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_filesystem
+#    error "__cpp_lib_filesystem should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_hardware_interference_size
-#   error "__cpp_lib_hardware_interference_size should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hardware_interference_size
+#    error "__cpp_lib_hardware_interference_size should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_hazard_pointer
-#   error "__cpp_lib_hazard_pointer should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_hazard_pointer
+#    error "__cpp_lib_hazard_pointer should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_inplace_vector
-#   error "__cpp_lib_inplace_vector should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_inplace_vector
+#    error "__cpp_lib_inplace_vector should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_launder
-#   error "__cpp_lib_launder should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_launder
+#    error "__cpp_lib_launder should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_linalg
-#   error "__cpp_lib_linalg should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_linalg
+#    error "__cpp_lib_linalg should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_math_special_functions
-#   error "__cpp_lib_math_special_functions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_math_special_functions
+#    error "__cpp_lib_math_special_functions should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_memory_resource
-#   error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_memory_resource
+#    error "__cpp_lib_memory_resource should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_modules
-#   error "__cpp_lib_modules should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_modules
+#    error "__cpp_lib_modules should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_optional
-#   error "__cpp_lib_optional should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_optional
+#    error "__cpp_lib_optional should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_quoted_string_io
-#   error "__cpp_lib_quoted_string_io should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_quoted_string_io
+#    error "__cpp_lib_quoted_string_io should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_rcu
-#   error "__cpp_lib_rcu should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_rcu
+#    error "__cpp_lib_rcu should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_sample
-#   error "__cpp_lib_sample should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_scoped_lock
-#   error "__cpp_lib_scoped_lock should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_scoped_lock
+#    error "__cpp_lib_scoped_lock should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_shared_mutex
-#   error "__cpp_lib_shared_mutex should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_mutex
+#    error "__cpp_lib_shared_mutex should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_shared_timed_mutex
-#   error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_shared_timed_mutex
+#    error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_spanstream
-#   error "__cpp_lib_spanstream should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_spanstream
+#    error "__cpp_lib_spanstream should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_stacktrace
-#   error "__cpp_lib_stacktrace should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stacktrace
+#    error "__cpp_lib_stacktrace should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_text_encoding
-#   error "__cpp_lib_text_encoding should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_text_encoding
+#    error "__cpp_lib_text_encoding should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_to_chars
-#   error "__cpp_lib_to_chars should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_to_chars
+#    error "__cpp_lib_to_chars should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should not be defined before c++14"
-# endif
+#  ifdef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should not be defined before c++14"
+#  endif
 
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_variant
-#   error "__cpp_lib_variant should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_variant
+#    error "__cpp_lib_variant should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 14
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_any
-#   error "__cpp_lib_any should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_apply
-#   error "__cpp_lib_apply should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_apply
+#    error "__cpp_lib_apply should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
 
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
 
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_byte
-#   error "__cpp_lib_byte should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should not be defined before c++17"
-# endif
-
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++14"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should not be defined before c++17"
-# endif
-
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++14"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++14"
-# endif
-
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_debugging
-#   error "__cpp_lib_debugging should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_byte
+#    error "__cpp_lib_byte should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should not be defined before c++17"
+#  endif
+
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
+
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_debugging
+#    error "__cpp_lib_debugging should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
-# endif
+#  ifdef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
+#  endif
 
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
 
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
 
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++14"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_execution
-#   error "__cpp_lib_execution should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_filesystem
-#   error "__cpp_lib_filesystem should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++14"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_hardware_interference_size
-#   error "__cpp_lib_hardware_interference_size should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_hazard_pointer
-#   error "__cpp_lib_hazard_pointer should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_inplace_vector
-#   error "__cpp_lib_inplace_vector should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++14"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++14"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++14"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++14"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++14"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++14"
-# endif
-
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_launder
-#   error "__cpp_lib_launder should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_linalg
-#   error "__cpp_lib_linalg should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should not be defined before c++17"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++14"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++14"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_math_special_functions
-#   error "__cpp_lib_math_special_functions should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_memory_resource
-#   error "__cpp_lib_memory_resource should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_modules
-#   error "__cpp_lib_modules should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should not be defined before c++17"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++14"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_optional
-#   error "__cpp_lib_optional should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_parallel_algorithm
-#   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++14"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++14"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_rcu
-#   error "__cpp_lib_rcu should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++14"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_sample
-#   error "__cpp_lib_sample should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_scoped_lock
-#   error "__cpp_lib_scoped_lock should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_shared_mutex
-#   error "__cpp_lib_shared_mutex should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++14"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_spanstream
-#   error "__cpp_lib_spanstream should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_stacktrace
-#   error "__cpp_lib_stacktrace should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++14"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_text_encoding
-#   error "__cpp_lib_text_encoding should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_to_chars
-#   error "__cpp_lib_to_chars should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++14"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++14"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++14"
-# endif
-# if __cpp_lib_transparent_operators != 201210L
-#   error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++14"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++14"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
-# endif
-
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_variant
-#   error "__cpp_lib_variant should not be defined before c++17"
-# endif
-
-# ifdef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should not be defined before c++17"
-# endif
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++14"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_execution
+#    error "__cpp_lib_execution should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_filesystem
+#    error "__cpp_lib_filesystem should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++14"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_hardware_interference_size
+#    error "__cpp_lib_hardware_interference_size should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_hazard_pointer
+#    error "__cpp_lib_hazard_pointer should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_inplace_vector
+#    error "__cpp_lib_inplace_vector should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++14"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++14"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++14"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++14"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_launder
+#    error "__cpp_lib_launder should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_linalg
+#    error "__cpp_lib_linalg should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should not be defined before c++17"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++14"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++14"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_math_special_functions
+#    error "__cpp_lib_math_special_functions should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_memory_resource
+#    error "__cpp_lib_memory_resource should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_modules
+#    error "__cpp_lib_modules should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should not be defined before c++17"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++14"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_optional
+#    error "__cpp_lib_optional should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++14"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++14"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_rcu
+#    error "__cpp_lib_rcu should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++14"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_scoped_lock
+#    error "__cpp_lib_scoped_lock should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_shared_mutex
+#    error "__cpp_lib_shared_mutex should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++14"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_spanstream
+#    error "__cpp_lib_spanstream should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_stacktrace
+#    error "__cpp_lib_stacktrace should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++14"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_text_encoding
+#    error "__cpp_lib_text_encoding should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_chars
+#    error "__cpp_lib_to_chars should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++14"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++14"
+#  endif
+#  if __cpp_lib_transparent_operators != 201210L
+#    error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++14"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++14"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_variant
+#    error "__cpp_lib_variant should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should not be defined before c++17"
+#  endif
 
 #elif TEST_STD_VER == 17
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++17"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
-# endif
-
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++17"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++17"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++17"
-# endif
-# if __cpp_lib_array_constexpr != 201603L
-#   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++17"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++17"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_shared_ptr
-#   error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_wait
-#   error "__cpp_lib_atomic_wait should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_barrier
-#   error "__cpp_lib_barrier should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++17"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++17"
-# endif
-
-# ifdef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++17"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_char8_t
-#   error "__cpp_lib_char8_t should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++17"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++17"
-# endif
-
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++17"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++17"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++17"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++17"
-# endif
-
-# ifdef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_debugging
-#   error "__cpp_lib_debugging should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_destroying_delete
-#   error "__cpp_lib_destroying_delete should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++17"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_endian
-#   error "__cpp_lib_endian should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++17"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++17"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++17"
-#   endif
-#   if __cpp_lib_execution != 201603L
-#     error "__cpp_lib_execution should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++17"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_format
-#   error "__cpp_lib_format should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++17"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++17"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++17"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++17"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_hazard_pointer
-#   error "__cpp_lib_hazard_pointer should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++17"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++17"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
-# endif
-
-# ifdef __cpp_lib_inplace_vector
-#   error "__cpp_lib_inplace_vector should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++17"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++17"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++17"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++17"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++17"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++17"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_layout_compatible
-#   error "__cpp_lib_is_layout_compatible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++17"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_pointer_interconvertible
-#   error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++17"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_jthread
-#   error "__cpp_lib_jthread should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_latch
-#   error "__cpp_lib_latch should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++17"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_linalg
-#   error "__cpp_lib_linalg should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++17"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++17"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++17"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++17"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++17"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++17"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++17"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++17"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_modules
-#   error "__cpp_lib_modules should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++17"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++17"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++17"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++17"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++17"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++17"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++17"
-# endif
-# if __cpp_lib_optional != 201606L
-#   error "__cpp_lib_optional should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++17"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_polymorphic_allocator
-#   error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++17"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++17"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_rcu
-#   error "__cpp_lib_rcu should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++17"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++17"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++17"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++17"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_semaphore
-#   error "__cpp_lib_semaphore should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201611L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++17"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_shift
-#   error "__cpp_lib_shift should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_span
-#   error "__cpp_lib_span should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_spanstream
-#   error "__cpp_lib_spanstream should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_stacktrace
-#   error "__cpp_lib_stacktrace should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++17"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++17"
-# endif
-# if __cpp_lib_string_view != 201606L
-#   error "__cpp_lib_string_view should have the value 201606L in c++17"
-# endif
-
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_syncbuf
-#   error "__cpp_lib_syncbuf should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_text_encoding
-#   error "__cpp_lib_text_encoding should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should not be defined before c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++17"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++17"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++17"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++17"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++17"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++17"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
-# endif
-
-# ifdef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++17"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++17"
-# endif
-
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++17"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++17"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++17"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should not be defined before c++20"
-# endif
-
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++17"
-# endif
-# if __cpp_lib_variant != 202102L
-#   error "__cpp_lib_variant should have the value 202102L in c++17"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++17"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++17"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++17"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++17"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++17"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++17"
+#  endif
+#  if __cpp_lib_array_constexpr != 201603L
+#    error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++17"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_shared_ptr
+#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_wait
+#    error "__cpp_lib_atomic_wait should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_barrier
+#    error "__cpp_lib_barrier should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++17"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++17"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_char8_t
+#    error "__cpp_lib_char8_t should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++17"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++17"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_debugging
+#    error "__cpp_lib_debugging should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_destroying_delete
+#    error "__cpp_lib_destroying_delete should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++17"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_endian
+#    error "__cpp_lib_endian should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++17"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++17"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++17"
+#    endif
+#    if __cpp_lib_execution != 201603L
+#      error "__cpp_lib_execution should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++17"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_format
+#    error "__cpp_lib_format should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++17"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++17"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++17"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++17"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_hazard_pointer
+#    error "__cpp_lib_hazard_pointer should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++17"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++17"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_inplace_vector
+#    error "__cpp_lib_inplace_vector should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++17"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++17"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++17"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_layout_compatible
+#    error "__cpp_lib_is_layout_compatible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_pointer_interconvertible
+#    error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++17"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_jthread
+#    error "__cpp_lib_jthread should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_latch
+#    error "__cpp_lib_latch should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++17"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_linalg
+#    error "__cpp_lib_linalg should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++17"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++17"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++17"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++17"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++17"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_modules
+#    error "__cpp_lib_modules should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++17"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++17"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++17"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++17"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++17"
+#  endif
+#  if __cpp_lib_optional != 201606L
+#    error "__cpp_lib_optional should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++17"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_polymorphic_allocator
+#    error "__cpp_lib_polymorphic_allocator should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++17"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++17"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_rcu
+#    error "__cpp_lib_rcu should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++17"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++17"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++17"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_semaphore
+#    error "__cpp_lib_semaphore should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++17"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201611L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++17"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++17"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_span
+#    error "__cpp_lib_span should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_spanstream
+#    error "__cpp_lib_spanstream should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_stacktrace
+#    error "__cpp_lib_stacktrace should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++17"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++17"
+#  endif
+#  if __cpp_lib_string_view != 201606L
+#    error "__cpp_lib_string_view should have the value 201606L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_syncbuf
+#    error "__cpp_lib_syncbuf should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_text_encoding
+#    error "__cpp_lib_text_encoding should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++17"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++17"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++17"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++17"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++17"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++17"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++17"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++17"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should not be defined before c++20"
+#  endif
+
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++17"
+#  endif
+#  if __cpp_lib_variant != 202102L
+#    error "__cpp_lib_variant should have the value 202102L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++17"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++17"
+#  endif
 
 #elif TEST_STD_VER == 20
 
-# ifdef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++20"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++20"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++20"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++20"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++20"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++20"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_erasure
-#   error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++20"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++20"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++20"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++20"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++20"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++20"
-# endif
-# if __cpp_lib_bind_front != 201907L
-#   error "__cpp_lib_bind_front should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++20"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++20"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++20"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++20"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++20"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++20"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should not be defined before c++23"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++20"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++20"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++20"
-# endif
-
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++20"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++20"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++20"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++20"
-# endif
-
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++20"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_cmath
-#   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_memory != 201811L
-#   error "__cpp_lib_constexpr_memory should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20"
-# endif
-
-# ifdef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++20"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++20"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++20"
-# endif
-
-# ifdef __cpp_lib_debugging
-#   error "__cpp_lib_debugging should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++20"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++20"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++20"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++20"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++20"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++20"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_expected
-#   error "__cpp_lib_expected should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++20"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++20"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++20"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++20"
-# endif
-
-# ifdef __cpp_lib_formatters
-#   error "__cpp_lib_formatters should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++20"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"
-# endif
-
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++20"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++20"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
-# endif
-
-# ifdef __cpp_lib_hazard_pointer
-#   error "__cpp_lib_hazard_pointer should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++20"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++20"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
-# endif
-
-# ifdef __cpp_lib_inplace_vector
-#   error "__cpp_lib_inplace_vector should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++20"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++20"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++20"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++20"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++20"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++20"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++20"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++20"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++20"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++20"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++20"
-# endif
-
-# ifdef __cpp_lib_is_implicit_lifetime
-#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++20"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++20"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++20"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++20"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++20"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++20"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++20"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++20"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++20"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++20"
-# endif
-
-# ifdef __cpp_lib_linalg
-#   error "__cpp_lib_linalg should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++20"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++20"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++20"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++20"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++20"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++20"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++20"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++20"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++20"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_modules
-#   error "__cpp_lib_modules should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++20"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
-# endif
-
-# ifdef __cpp_lib_move_only_function
-#   error "__cpp_lib_move_only_function should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++20"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++20"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++20"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++20"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++20"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++20"
-# endif
-# if __cpp_lib_optional != 202106L
-#   error "__cpp_lib_optional should have the value 202106L in c++20"
-# endif
-
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++20"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++20"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_print
-#   error "__cpp_lib_print should not be defined before c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++20"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++20"
-# endif
-# if __cpp_lib_ranges != 202110L
-#   error "__cpp_lib_ranges should have the value 202110L in c++20"
-# endif
-
-# ifdef __cpp_lib_ranges_as_const
-#   error "__cpp_lib_ranges_as_const should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk
-#   error "__cpp_lib_ranges_chunk should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_join_with
-#   error "__cpp_lib_ranges_join_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_slide
-#   error "__cpp_lib_ranges_slide should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_zip
-#   error "__cpp_lib_ranges_zip should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++20"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++20"
-# endif
-
-# ifdef __cpp_lib_rcu
-#   error "__cpp_lib_rcu should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_reference_from_temporary
-#   error "__cpp_lib_reference_from_temporary should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++20"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++20"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++20"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++20"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++20"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++20"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++20"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++20"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++20"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++20"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++20"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++20"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++20"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++20"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++20"
-# endif
-
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_spanstream
-#   error "__cpp_lib_spanstream should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++20"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++20"
-# endif
-
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_stacktrace
-#   error "__cpp_lib_stacktrace should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++20"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
-# endif
-
-# ifdef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should not be defined before c++23"
-# endif
-
-# ifdef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++20"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++20"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++20"
-# endif
-
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++20"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++20"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_text_encoding
-#   error "__cpp_lib_text_encoding should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++20"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++20"
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++20"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++20"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++20"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++20"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++20"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++20"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++20"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++20"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++20"
-# endif
-
-# ifdef __cpp_lib_tuple_like
-#   error "__cpp_lib_tuple_like should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++20"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++20"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++20"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++20"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++20"
-# endif
-
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++20"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++20"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++20"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++20"
-# endif
-
-# ifdef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should not be defined before c++23"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++20"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
-# endif
-
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++20"
-# endif
-# if __cpp_lib_variant != 202106L
-#   error "__cpp_lib_variant should have the value 202106L in c++20"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++20"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++20"
-# endif
+#  ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++20"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++20"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++20"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++20"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++20"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_erasure
+#    error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++20"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++20"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++20"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++20"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++20"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++20"
+#  endif
+#  if __cpp_lib_bind_front != 201907L
+#    error "__cpp_lib_bind_front should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++20"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++20"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++20"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++20"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++20"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++20"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should not be defined before c++23"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++20"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++20"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++20"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++20"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_cmath
+#    error "__cpp_lib_constexpr_cmath should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_memory != 201811L
+#    error "__cpp_lib_constexpr_memory should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++20"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_debugging
+#    error "__cpp_lib_debugging should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++20"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++20"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++20"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++20"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++20"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++20"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_expected
+#    error "__cpp_lib_expected should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++20"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++20"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++20"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_formatters
+#    error "__cpp_lib_formatters should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++20"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++20"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++20"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++20"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_hazard_pointer
+#    error "__cpp_lib_hazard_pointer should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++20"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++20"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_inplace_vector
+#    error "__cpp_lib_inplace_vector should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++20"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++20"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++20"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++20"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++20"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++20"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_implicit_lifetime
+#    error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++20"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++20"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++20"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++20"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++20"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++20"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_linalg
+#    error "__cpp_lib_linalg should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++20"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++20"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++20"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++20"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++20"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++20"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_modules
+#    error "__cpp_lib_modules should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++20"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_move_only_function
+#    error "__cpp_lib_move_only_function should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++20"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++20"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++20"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++20"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++20"
+#  endif
+#  if __cpp_lib_optional != 202106L
+#    error "__cpp_lib_optional should have the value 202106L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++20"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++20"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_print
+#    error "__cpp_lib_print should not be defined before c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++20"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_const
+#    error "__cpp_lib_ranges_as_const should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk
+#    error "__cpp_lib_ranges_chunk should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_join_with
+#    error "__cpp_lib_ranges_join_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_slide
+#    error "__cpp_lib_ranges_slide should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_zip
+#    error "__cpp_lib_ranges_zip should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_rcu
+#    error "__cpp_lib_rcu should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_reference_from_temporary
+#    error "__cpp_lib_reference_from_temporary should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++20"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++20"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++20"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++20"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++20"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++20"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++20"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++20"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++20"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++20"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++20"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_spanstream
+#    error "__cpp_lib_spanstream should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++20"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_stacktrace
+#    error "__cpp_lib_stacktrace should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++20"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++20"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++20"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++20"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_text_encoding
+#    error "__cpp_lib_text_encoding should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++20"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++20"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++20"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++20"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++20"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++20"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++20"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++20"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_tuple_like
+#    error "__cpp_lib_tuple_like should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++20"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++20"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++20"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++20"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++20"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++20"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++20"
+#  endif
+#  if __cpp_lib_variant != 202106L
+#    error "__cpp_lib_variant should have the value 202106L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++20"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++20"
+#  endif
 
 #elif TEST_STD_VER == 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++23"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should be defined in c++23"
-# endif
-# if __cpp_lib_allocate_at_least != 202302L
-#   error "__cpp_lib_allocate_at_least should have the value 202302L in c++23"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++23"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++23"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++23"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++23"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_associative_heterogeneous_insertion
-#   error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++23"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23"
-# endif
-
-# ifdef __cpp_lib_atomic_min_max
-#   error "__cpp_lib_atomic_min_max should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++23"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++23"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++23"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++23"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should be defined in c++23"
-# endif
-# if __cpp_lib_bind_back != 202202L
-#   error "__cpp_lib_bind_back should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++23"
-# endif
-# if __cpp_lib_bind_front != 201907L
-#   error "__cpp_lib_bind_front should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++23"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++23"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++23"
-# endif
-
-# ifdef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++23"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++23"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++23"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++23"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++23"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should be defined in c++23"
-# endif
-# if __cpp_lib_byteswap != 202110L
-#   error "__cpp_lib_byteswap should have the value 202110L in c++23"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++23"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++23"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++23"
-# endif
-
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++23"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++23"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++23"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++23"
-# endif
-
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++23"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_algorithms != 201806L
-#   error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_bitset != 202207L
-#   error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_charconv != 202207L
-#   error "__cpp_lib_constexpr_charconv should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++23"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_memory != 202202L
-#   error "__cpp_lib_constexpr_memory should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_constexpr_new
-#   error "__cpp_lib_constexpr_new should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-#   error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++23"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++23"
-# endif
-
-# ifdef __cpp_lib_constrained_equality
-#   error "__cpp_lib_constrained_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_copyable_function
-#   error "__cpp_lib_copyable_function should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++23"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++23"
-# endif
-
-# ifdef __cpp_lib_debugging
-#   error "__cpp_lib_debugging should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_default_template_type_for_algorithm_values
-#   error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++23"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++23"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++23"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++23"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++23"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++23"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_expected
-#   error "__cpp_lib_expected should be defined in c++23"
-# endif
-# if __cpp_lib_expected != 202211L
-#   error "__cpp_lib_expected should have the value 202211L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++23"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should be defined in c++23"
-# endif
-# if __cpp_lib_flat_map != 202207L
-#   error "__cpp_lib_flat_map should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should be defined in c++23"
-# endif
-# if __cpp_lib_flat_set != 202207L
-#   error "__cpp_lib_flat_set should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++23"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_format_path
-#   error "__cpp_lib_format_path should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_format_ranges != 202207L
-#   error "__cpp_lib_format_ranges should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++23"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should be defined in c++23"
-#   endif
-#   if __cpp_lib_formatters != 202302L
-#     error "__cpp_lib_formatters should have the value 202302L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should be defined in c++23"
-# endif
-# if __cpp_lib_forward_like != 202207L
-#   error "__cpp_lib_forward_like should have the value 202207L in c++23"
-# endif
-
-# ifdef __cpp_lib_freestanding_algorithm
-#   error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_array
-#   error "__cpp_lib_freestanding_array should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_cstring
-#   error "__cpp_lib_freestanding_cstring should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_expected
-#   error "__cpp_lib_freestanding_expected should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_mdspan
-#   error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_optional
-#   error "__cpp_lib_freestanding_optional should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_string_view
-#   error "__cpp_lib_freestanding_string_view should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_freestanding_variant
-#   error "__cpp_lib_freestanding_variant should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_fstream_native_handle
-#   error "__cpp_lib_fstream_native_handle should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_function_ref
-#   error "__cpp_lib_function_ref should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++23"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"
-# endif
-
-# ifdef __cpp_lib_generate_random
-#   error "__cpp_lib_generate_random should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++23"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++23"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++23"
-# endif
-
-# ifdef __cpp_lib_hazard_pointer
-#   error "__cpp_lib_hazard_pointer should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++23"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++23"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
-# endif
-
-# ifdef __cpp_lib_inplace_vector
-#   error "__cpp_lib_inplace_vector should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++23"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++23"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++23"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++23"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++23"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++23"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++23"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should be defined in c++23"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-#   error "__cpp_lib_invoke_r should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should be defined in c++23"
-# endif
-# if __cpp_lib_ios_noreplace != 202207L
-#   error "__cpp_lib_ios_noreplace should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++23"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++23"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++23"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++23"
-# endif
-
-# if __has_builtin(__builtin_is_implicit_lifetime)
-#   ifndef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_implicit_lifetime != 202302L
-#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++23"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++23"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++23"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++23"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should be defined in c++23"
-# endif
-# if __cpp_lib_is_scoped_enum != 202011L
-#   error "__cpp_lib_is_scoped_enum should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++23"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++23"
-# endif
-
-# ifdef __cpp_lib_is_virtual_base_of
-#   error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_is_within_lifetime
-#   error "__cpp_lib_is_within_lifetime should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++23"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++23"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++23"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++23"
-# endif
-
-# ifdef __cpp_lib_linalg
-#   error "__cpp_lib_linalg should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++23"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++23"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++23"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++23"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++23"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++23"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++23"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++23"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++23"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should be defined in c++23"
-# endif
-# if __cpp_lib_mdspan != 202207L
-#   error "__cpp_lib_mdspan should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++23"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_modules
-#   error "__cpp_lib_modules should be defined in c++23"
-# endif
-# if __cpp_lib_modules != 202207L
-#   error "__cpp_lib_modules should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++23"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should be defined in c++23"
-#   endif
-#   if __cpp_lib_move_only_function != 202110L
-#     error "__cpp_lib_move_only_function should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++23"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++23"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++23"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++23"
-# endif
-# if __cpp_lib_not_fn != 201603L
-#   error "__cpp_lib_not_fn should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++23"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++23"
-# endif
-# if __cpp_lib_optional != 202110L
-#   error "__cpp_lib_optional should have the value 202110L in c++23"
-# endif
-
-# ifdef __cpp_lib_optional_range_support
-#   error "__cpp_lib_optional_range_support should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should be defined in c++23"
-# endif
-# if __cpp_lib_out_ptr != 202106L
-#   error "__cpp_lib_out_ptr should have the value 202106L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++23"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_philox_engine
-#   error "__cpp_lib_philox_engine should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++23"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++23"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++23"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++23"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_as_const != 202207L
-#     error "__cpp_lib_ranges_as_const should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_as_rvalue != 202207L
-#   error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_chunk != 202202L
-#     error "__cpp_lib_ranges_chunk should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_chunk_by != 202202L
-#   error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++23"
-# endif
-
-# ifdef __cpp_lib_ranges_concat
-#   error "__cpp_lib_ranges_concat should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_contains != 202207L
-#   error "__cpp_lib_ranges_contains should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_find_last != 202207L
-#   error "__cpp_lib_ranges_find_last should have the value 202207L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_iota != 202202L
-#   error "__cpp_lib_ranges_iota should have the value 202202L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_join_with != 202202L
-#     error "__cpp_lib_ranges_join_with should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_repeat != 202207L
-#   error "__cpp_lib_ranges_repeat should have the value 202207L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_slide != 202202L
-#     error "__cpp_lib_ranges_slide should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_starts_ends_with != 202106L
-#   error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should be defined in c++23"
-# endif
-# if __cpp_lib_ranges_to_container != 202202L
-#   error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++23"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++23"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++23"
-# endif
-
-# ifdef __cpp_lib_rcu
-#   error "__cpp_lib_rcu should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should be defined in c++23"
-#   endif
-#   if __cpp_lib_reference_from_temporary != 202202L
-#     error "__cpp_lib_reference_from_temporary should have the value 202202L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++23"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++23"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++23"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++23"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++23"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++23"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_senders
-#   error "__cpp_lib_senders should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++23"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++23"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++23"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++23"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++23"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++23"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
-# endif
-
-# ifdef __cpp_lib_smart_ptr_owner_equality
-#   error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++23"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++23"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++23"
-# endif
-
-# ifdef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should not be defined before c++26"
-# endif
-
-# ifdef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_spanstream
-#     error "__cpp_lib_spanstream should be defined in c++23"
-#   endif
-#   if __cpp_lib_spanstream != 202106L
-#     error "__cpp_lib_spanstream should have the value 202106L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_spanstream
-#     error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++23"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++23"
-# endif
-
-# ifdef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_stacktrace
-#     error "__cpp_lib_stacktrace should be defined in c++23"
-#   endif
-#   if __cpp_lib_stacktrace != 202011L
-#     error "__cpp_lib_stacktrace should have the value 202011L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_stacktrace
-#     error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++23"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should be defined in c++23"
-# endif
-# if __cpp_lib_stdatomic_h != 202011L
-#   error "__cpp_lib_stdatomic_h should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++23"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_string_resize_and_overwrite != 202110L
-#   error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++23"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++23"
-# endif
-# if __cpp_lib_string_view != 201803L
-#   error "__cpp_lib_string_view should have the value 201803L in c++23"
-# endif
-
-# ifdef __cpp_lib_submdspan
-#   error "__cpp_lib_submdspan should not be defined before c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++23"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++23"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_text_encoding
-#   error "__cpp_lib_text_encoding should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++23"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++23"
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++23"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++23"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++23"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++23"
-#   endif
-#   if __cpp_lib_to_chars != 201611L
-#     error "__cpp_lib_to_chars should have the value 201611L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifdef __cpp_lib_to_string
-#   error "__cpp_lib_to_string should not be defined before c++26"
-# endif
-
-# ifndef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should be defined in c++23"
-# endif
-# if __cpp_lib_to_underlying != 202102L
-#   error "__cpp_lib_to_underlying should have the value 202102L in c++23"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++23"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++23"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++23"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++23"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++23"
-#   endif
-#   if __cpp_lib_tuple_like != 202207L
-#     error "__cpp_lib_tuple_like should have the value 202207L in c++23"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++23"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++23"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++23"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++23"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++23"
-# endif
-
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++23"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++23"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23"
-# endif
-
-# ifndef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should be defined in c++23"
-# endif
-# if __cpp_lib_unreachable != 202202L
-#   error "__cpp_lib_unreachable should have the value 202202L in c++23"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++23"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
-# endif
-
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++23"
-# endif
-# if __cpp_lib_variant != 202106L
-#   error "__cpp_lib_variant should have the value 202106L in c++23"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++23"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++23"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++23"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocate_at_least != 202302L
+#    error "__cpp_lib_allocate_at_least should have the value 202302L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++23"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++23"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++23"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++23"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_associative_heterogeneous_insertion
+#    error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++23"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_atomic_min_max
+#    error "__cpp_lib_atomic_min_max should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++23"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++23"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++23"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++23"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should be defined in c++23"
+#  endif
+#  if __cpp_lib_bind_back != 202202L
+#    error "__cpp_lib_bind_back should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++23"
+#  endif
+#  if __cpp_lib_bind_front != 201907L
+#    error "__cpp_lib_bind_front should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++23"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++23"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++23"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++23"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++23"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++23"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should be defined in c++23"
+#  endif
+#  if __cpp_lib_byteswap != 202110L
+#    error "__cpp_lib_byteswap should have the value 202110L in c++23"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++23"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++23"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++23"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++23"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_bitset != 202207L
+#    error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_charconv != 202207L
+#    error "__cpp_lib_constexpr_charconv should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++23"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_memory != 202202L
+#    error "__cpp_lib_constexpr_memory should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_new
+#    error "__cpp_lib_constexpr_new should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_typeinfo != 202106L
+#    error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_constrained_equality
+#    error "__cpp_lib_constrained_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_copyable_function
+#    error "__cpp_lib_copyable_function should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++23"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_debugging
+#    error "__cpp_lib_debugging should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++23"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++23"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++23"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++23"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++23"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++23"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_expected
+#    error "__cpp_lib_expected should be defined in c++23"
+#  endif
+#  if __cpp_lib_expected != 202211L
+#    error "__cpp_lib_expected should have the value 202211L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++23"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should be defined in c++23"
+#  endif
+#  if __cpp_lib_flat_map != 202207L
+#    error "__cpp_lib_flat_map should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should be defined in c++23"
+#  endif
+#  if __cpp_lib_flat_set != 202207L
+#    error "__cpp_lib_flat_set should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++23"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_format_path
+#    error "__cpp_lib_format_path should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_format_ranges != 202207L
+#    error "__cpp_lib_format_ranges should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++23"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should be defined in c++23"
+#    endif
+#    if __cpp_lib_formatters != 202302L
+#      error "__cpp_lib_formatters should have the value 202302L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should be defined in c++23"
+#  endif
+#  if __cpp_lib_forward_like != 202207L
+#    error "__cpp_lib_forward_like should have the value 202207L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_cstring
+#    error "__cpp_lib_freestanding_cstring should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_expected
+#    error "__cpp_lib_freestanding_expected should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_mdspan
+#    error "__cpp_lib_freestanding_mdspan should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_optional
+#    error "__cpp_lib_freestanding_optional should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_string_view
+#    error "__cpp_lib_freestanding_string_view should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_variant
+#    error "__cpp_lib_freestanding_variant should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_fstream_native_handle
+#    error "__cpp_lib_fstream_native_handle should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_function_ref
+#    error "__cpp_lib_function_ref should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++23"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_generate_random
+#    error "__cpp_lib_generate_random should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++23"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++23"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++23"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_hazard_pointer
+#    error "__cpp_lib_hazard_pointer should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++23"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++23"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_inplace_vector
+#    error "__cpp_lib_inplace_vector should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++23"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++23"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++23"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++23"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++23"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++23"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should be defined in c++23"
+#  endif
+#  if __cpp_lib_invoke_r != 202106L
+#    error "__cpp_lib_invoke_r should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_ios_noreplace != 202207L
+#    error "__cpp_lib_ios_noreplace should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++23"
+#  endif
+
+#  if __has_builtin(__builtin_is_implicit_lifetime)
+#    ifndef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_implicit_lifetime != 202302L
+#      error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++23"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_scoped_enum != 202011L
+#    error "__cpp_lib_is_scoped_enum should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++23"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_is_virtual_base_of
+#    error "__cpp_lib_is_virtual_base_of should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_is_within_lifetime
+#    error "__cpp_lib_is_within_lifetime should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++23"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++23"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++23"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_linalg
+#    error "__cpp_lib_linalg should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++23"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++23"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++23"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++23"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should be defined in c++23"
+#  endif
+#  if __cpp_lib_mdspan != 202207L
+#    error "__cpp_lib_mdspan should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++23"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_modules
+#    error "__cpp_lib_modules should be defined in c++23"
+#  endif
+#  if __cpp_lib_modules != 202207L
+#    error "__cpp_lib_modules should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++23"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should be defined in c++23"
+#    endif
+#    if __cpp_lib_move_only_function != 202110L
+#      error "__cpp_lib_move_only_function should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++23"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++23"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++23"
+#  endif
+#  if __cpp_lib_not_fn != 201603L
+#    error "__cpp_lib_not_fn should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++23"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++23"
+#  endif
+#  if __cpp_lib_optional != 202110L
+#    error "__cpp_lib_optional should have the value 202110L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_optional_range_support
+#    error "__cpp_lib_optional_range_support should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should be defined in c++23"
+#  endif
+#  if __cpp_lib_out_ptr != 202106L
+#    error "__cpp_lib_out_ptr should have the value 202106L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++23"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_philox_engine
+#    error "__cpp_lib_philox_engine should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++23"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++23"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++23"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_as_const != 202207L
+#      error "__cpp_lib_ranges_as_const should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_as_rvalue != 202207L
+#    error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_chunk != 202202L
+#      error "__cpp_lib_ranges_chunk should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_chunk_by != 202202L
+#    error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_concat
+#    error "__cpp_lib_ranges_concat should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_iota != 202202L
+#    error "__cpp_lib_ranges_iota should have the value 202202L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_join_with != 202202L
+#      error "__cpp_lib_ranges_join_with should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_repeat != 202207L
+#    error "__cpp_lib_ranges_repeat should have the value 202207L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_slide != 202202L
+#      error "__cpp_lib_ranges_slide should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_to_container != 202202L
+#    error "__cpp_lib_ranges_to_container should have the value 202202L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++23"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_rcu
+#    error "__cpp_lib_rcu should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should be defined in c++23"
+#    endif
+#    if __cpp_lib_reference_from_temporary != 202202L
+#      error "__cpp_lib_reference_from_temporary should have the value 202202L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++23"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++23"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++23"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++23"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++23"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_senders
+#    error "__cpp_lib_senders should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++23"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++23"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++23"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++23"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_smart_ptr_owner_equality
+#    error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++23"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++23"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_spanstream
+#      error "__cpp_lib_spanstream should be defined in c++23"
+#    endif
+#    if __cpp_lib_spanstream != 202106L
+#      error "__cpp_lib_spanstream should have the value 202106L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_spanstream
+#      error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++23"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_stacktrace
+#      error "__cpp_lib_stacktrace should be defined in c++23"
+#    endif
+#    if __cpp_lib_stacktrace != 202011L
+#      error "__cpp_lib_stacktrace should have the value 202011L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_stacktrace
+#      error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should be defined in c++23"
+#  endif
+#  if __cpp_lib_stdatomic_h != 202011L
+#    error "__cpp_lib_stdatomic_h should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_resize_and_overwrite != 202110L
+#    error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++23"
+#  endif
+#  if __cpp_lib_string_view != 201803L
+#    error "__cpp_lib_string_view should have the value 201803L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_submdspan
+#    error "__cpp_lib_submdspan should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++23"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_text_encoding
+#    error "__cpp_lib_text_encoding should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++23"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++23"
+#    endif
+#    if __cpp_lib_to_chars != 201611L
+#      error "__cpp_lib_to_chars should have the value 201611L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_to_string
+#    error "__cpp_lib_to_string should not be defined before c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should be defined in c++23"
+#  endif
+#  if __cpp_lib_to_underlying != 202102L
+#    error "__cpp_lib_to_underlying should have the value 202102L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++23"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++23"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++23"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++23"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++23"
+#    endif
+#    if __cpp_lib_tuple_like != 202207L
+#      error "__cpp_lib_tuple_like should have the value 202207L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++23"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++23"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++23"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++23"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++23"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should be defined in c++23"
+#  endif
+#  if __cpp_lib_unreachable != 202202L
+#    error "__cpp_lib_unreachable should have the value 202202L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++23"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++23"
+#  endif
+#  if __cpp_lib_variant != 202106L
+#    error "__cpp_lib_variant should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++23"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++23"
+#  endif
 
 #elif TEST_STD_VER > 23
 
-# ifndef __cpp_lib_adaptor_iterator_pair_constructor
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
-# endif
-# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
-#   error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
-# endif
-
-# ifndef __cpp_lib_addressof_constexpr
-#   error "__cpp_lib_addressof_constexpr should be defined in c++26"
-# endif
-# if __cpp_lib_addressof_constexpr != 201603L
-#   error "__cpp_lib_addressof_constexpr should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_allocate_at_least
-#   error "__cpp_lib_allocate_at_least should be defined in c++26"
-# endif
-# if __cpp_lib_allocate_at_least != 202302L
-#   error "__cpp_lib_allocate_at_least should have the value 202302L in c++26"
-# endif
-
-# ifndef __cpp_lib_allocator_traits_is_always_equal
-#   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
-# endif
-# if __cpp_lib_allocator_traits_is_always_equal != 201411L
-#   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_any
-#   error "__cpp_lib_any should be defined in c++26"
-# endif
-# if __cpp_lib_any != 201606L
-#   error "__cpp_lib_any should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_apply
-#   error "__cpp_lib_apply should be defined in c++26"
-# endif
-# if __cpp_lib_apply != 201603L
-#   error "__cpp_lib_apply should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_array_constexpr
-#   error "__cpp_lib_array_constexpr should be defined in c++26"
-# endif
-# if __cpp_lib_array_constexpr != 201811L
-#   error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_as_const
-#   error "__cpp_lib_as_const should be defined in c++26"
-# endif
-# if __cpp_lib_as_const != 201510L
-#   error "__cpp_lib_as_const should have the value 201510L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_erasure != 202110L
-#     error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_erasure
-#     error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
-#   endif
-#   if __cpp_lib_associative_heterogeneous_insertion != 202306L
-#     error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_associative_heterogeneous_insertion
-#     error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_assume_aligned
-#   error "__cpp_lib_assume_aligned should be defined in c++26"
-# endif
-# if __cpp_lib_assume_aligned != 201811L
-#   error "__cpp_lib_assume_aligned should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_flag_test
-#   error "__cpp_lib_atomic_flag_test should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_flag_test != 201907L
-#   error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_float
-#   error "__cpp_lib_atomic_float should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_float != 201711L
-#   error "__cpp_lib_atomic_float should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_is_always_lock_free
-#   error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_is_always_lock_free != 201603L
-#   error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_atomic_lock_free_type_aliases
-#   error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
-#   error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_min_max
-#     error "__cpp_lib_atomic_min_max should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_min_max != 202403L
-#     error "__cpp_lib_atomic_min_max should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_min_max
-#     error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_ref
-#   error "__cpp_lib_atomic_ref should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_ref != 201806L
-#   error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_shared_ptr != 201711L
-#     error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_atomic_shared_ptr
-#     error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_atomic_value_initialization
-#   error "__cpp_lib_atomic_value_initialization should be defined in c++26"
-# endif
-# if __cpp_lib_atomic_value_initialization != 201911L
-#   error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
-#   ifndef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should be defined in c++26"
-#   endif
-#   if __cpp_lib_atomic_wait != 201907L
-#     error "__cpp_lib_atomic_wait should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_atomic_wait
-#     error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should be defined in c++26"
-#   endif
-#   if __cpp_lib_barrier != 201907L
-#     error "__cpp_lib_barrier should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_barrier
-#     error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_bind_back
-#   error "__cpp_lib_bind_back should be defined in c++26"
-# endif
-# if __cpp_lib_bind_back != 202202L
-#   error "__cpp_lib_bind_back should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_bind_front
-#   error "__cpp_lib_bind_front should be defined in c++26"
-# endif
-# if __cpp_lib_bind_front != 202306L
-#   error "__cpp_lib_bind_front should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_bit_cast
-#   error "__cpp_lib_bit_cast should be defined in c++26"
-# endif
-# if __cpp_lib_bit_cast != 201806L
-#   error "__cpp_lib_bit_cast should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_bitops
-#   error "__cpp_lib_bitops should be defined in c++26"
-# endif
-# if __cpp_lib_bitops != 201907L
-#   error "__cpp_lib_bitops should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_bitset
-#   error "__cpp_lib_bitset should be defined in c++26"
-# endif
-# if __cpp_lib_bitset != 202306L
-#   error "__cpp_lib_bitset should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_bool_constant
-#   error "__cpp_lib_bool_constant should be defined in c++26"
-# endif
-# if __cpp_lib_bool_constant != 201505L
-#   error "__cpp_lib_bool_constant should have the value 201505L in c++26"
-# endif
-
-# ifndef __cpp_lib_bounded_array_traits
-#   error "__cpp_lib_bounded_array_traits should be defined in c++26"
-# endif
-# if __cpp_lib_bounded_array_traits != 201902L
-#   error "__cpp_lib_bounded_array_traits should have the value 201902L in c++26"
-# endif
-
-# ifndef __cpp_lib_boyer_moore_searcher
-#   error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
-# endif
-# if __cpp_lib_boyer_moore_searcher != 201603L
-#   error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_byte
-#   error "__cpp_lib_byte should be defined in c++26"
-# endif
-# if __cpp_lib_byte != 201603L
-#   error "__cpp_lib_byte should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_byteswap
-#   error "__cpp_lib_byteswap should be defined in c++26"
-# endif
-# if __cpp_lib_byteswap != 202110L
-#   error "__cpp_lib_byteswap should have the value 202110L in c++26"
-# endif
-
-# if defined(__cpp_char8_t)
-#   ifndef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should be defined in c++26"
-#   endif
-#   if __cpp_lib_char8_t != 201907L
-#     error "__cpp_lib_char8_t should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_char8_t
-#     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_chrono
-#   error "__cpp_lib_chrono should be defined in c++26"
-# endif
-# if __cpp_lib_chrono != 201611L
-#   error "__cpp_lib_chrono should have the value 201611L in c++26"
-# endif
-
-# ifndef __cpp_lib_chrono_udls
-#   error "__cpp_lib_chrono_udls should be defined in c++26"
-# endif
-# if __cpp_lib_chrono_udls != 201304L
-#   error "__cpp_lib_chrono_udls should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_clamp
-#   error "__cpp_lib_clamp should be defined in c++26"
-# endif
-# if __cpp_lib_clamp != 201603L
-#   error "__cpp_lib_clamp should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_complex_udls
-#   error "__cpp_lib_complex_udls should be defined in c++26"
-# endif
-# if __cpp_lib_complex_udls != 201309L
-#   error "__cpp_lib_complex_udls should have the value 201309L in c++26"
-# endif
-
-# ifndef __cpp_lib_concepts
-#   error "__cpp_lib_concepts should be defined in c++26"
-# endif
-# if __cpp_lib_concepts != 202002L
-#   error "__cpp_lib_concepts should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_algorithms
-#   error "__cpp_lib_constexpr_algorithms should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_algorithms != 202306L
-#   error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_bitset
-#   error "__cpp_lib_constexpr_bitset should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_bitset != 202207L
-#   error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_charconv
-#   error "__cpp_lib_constexpr_charconv should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_charconv != 202207L
-#   error "__cpp_lib_constexpr_charconv should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should be defined in c++26"
-#   endif
-#   if __cpp_lib_constexpr_cmath != 202202L
-#     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_cmath
-#     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_complex
-#   error "__cpp_lib_constexpr_complex should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_complex != 201711L
-#   error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_dynamic_alloc
-#   error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_dynamic_alloc != 201907L
-#   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_functional
-#   error "__cpp_lib_constexpr_functional should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_functional != 201907L
-#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_iterator
-#   error "__cpp_lib_constexpr_iterator should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_iterator != 201811L
-#   error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_memory
-#   error "__cpp_lib_constexpr_memory should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_memory != 202202L
-#   error "__cpp_lib_constexpr_memory should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_ABI_VCRUNTIME)
-#   ifndef __cpp_lib_constexpr_new
-#     error "__cpp_lib_constexpr_new should be defined in c++26"
-#   endif
-#   if __cpp_lib_constexpr_new != 202406L
-#     error "__cpp_lib_constexpr_new should have the value 202406L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_constexpr_new
-#     error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_constexpr_numeric
-#   error "__cpp_lib_constexpr_numeric should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_numeric != 201911L
-#   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_string
-#   error "__cpp_lib_constexpr_string should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_string != 201907L
-#   error "__cpp_lib_constexpr_string should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_string_view
-#   error "__cpp_lib_constexpr_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_string_view != 201811L
-#   error "__cpp_lib_constexpr_string_view should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_tuple
-#   error "__cpp_lib_constexpr_tuple should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_tuple != 201811L
-#   error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_typeinfo
-#   error "__cpp_lib_constexpr_typeinfo should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_typeinfo != 202106L
-#   error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_utility
-#   error "__cpp_lib_constexpr_utility should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_utility != 201811L
-#   error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_constexpr_vector
-#   error "__cpp_lib_constexpr_vector should be defined in c++26"
-# endif
-# if __cpp_lib_constexpr_vector != 201907L
-#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_constrained_equality != 202403L
-#     error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constrained_equality
-#     error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_containers_ranges
-#   error "__cpp_lib_containers_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_containers_ranges != 202202L
-#   error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_copyable_function
-#     error "__cpp_lib_copyable_function should be defined in c++26"
-#   endif
-#   if __cpp_lib_copyable_function != 202306L
-#     error "__cpp_lib_copyable_function should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_copyable_function
-#     error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_coroutine
-#   error "__cpp_lib_coroutine should be defined in c++26"
-# endif
-# if __cpp_lib_coroutine != 201902L
-#   error "__cpp_lib_coroutine should have the value 201902L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_debugging
-#     error "__cpp_lib_debugging should be defined in c++26"
-#   endif
-#   if __cpp_lib_debugging != 202311L
-#     error "__cpp_lib_debugging should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_debugging
-#     error "__cpp_lib_debugging should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
-#   endif
-#   if __cpp_lib_default_template_type_for_algorithm_values != 202403L
-#     error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_default_template_type_for_algorithm_values
-#     error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
-#   ifndef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should be defined in c++26"
-#   endif
-#   if __cpp_lib_destroying_delete != 201806L
-#     error "__cpp_lib_destroying_delete should have the value 201806L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_destroying_delete
-#     error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_enable_shared_from_this
-#   error "__cpp_lib_enable_shared_from_this should be defined in c++26"
-# endif
-# if __cpp_lib_enable_shared_from_this != 201603L
-#   error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_endian
-#   error "__cpp_lib_endian should be defined in c++26"
-# endif
-# if __cpp_lib_endian != 201907L
-#   error "__cpp_lib_endian should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_erase_if
-#   error "__cpp_lib_erase_if should be defined in c++26"
-# endif
-# if __cpp_lib_erase_if != 202002L
-#   error "__cpp_lib_erase_if should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_exchange_function
-#   error "__cpp_lib_exchange_function should be defined in c++26"
-# endif
-# if __cpp_lib_exchange_function != 201304L
-#   error "__cpp_lib_exchange_function should have the value 201304L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_execution
-#     error "__cpp_lib_execution should be defined in c++26"
-#   endif
-#   if __cpp_lib_execution != 201902L
-#     error "__cpp_lib_execution should have the value 201902L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_execution
-#     error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_expected
-#   error "__cpp_lib_expected should be defined in c++26"
-# endif
-# if __cpp_lib_expected != 202211L
-#   error "__cpp_lib_expected should have the value 202211L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
-#   ifndef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should be defined in c++26"
-#   endif
-#   if __cpp_lib_filesystem != 201703L
-#     error "__cpp_lib_filesystem should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_filesystem
-#     error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_flat_map
-#   error "__cpp_lib_flat_map should be defined in c++26"
-# endif
-# if __cpp_lib_flat_map != 202207L
-#   error "__cpp_lib_flat_map should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_flat_set
-#   error "__cpp_lib_flat_set should be defined in c++26"
-# endif
-# if __cpp_lib_flat_set != 202207L
-#   error "__cpp_lib_flat_set should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_format
-#     error "__cpp_lib_format should be defined in c++26"
-#   endif
-#   if __cpp_lib_format != 202110L
-#     error "__cpp_lib_format should have the value 202110L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_format
-#     error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_format_path
-#     error "__cpp_lib_format_path should be defined in c++26"
-#   endif
-#   if __cpp_lib_format_path != 202403L
-#     error "__cpp_lib_format_path should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_format_path
-#     error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_format_ranges
-#   error "__cpp_lib_format_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_format_ranges != 202207L
-#   error "__cpp_lib_format_ranges should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_format_uchar
-#   error "__cpp_lib_format_uchar should be defined in c++26"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-#   error "__cpp_lib_format_uchar should have the value 202311L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should be defined in c++26"
-#   endif
-#   if __cpp_lib_formatters != 202302L
-#     error "__cpp_lib_formatters should have the value 202302L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_formatters
-#     error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_forward_like
-#   error "__cpp_lib_forward_like should be defined in c++26"
-# endif
-# if __cpp_lib_forward_like != 202207L
-#   error "__cpp_lib_forward_like should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_algorithm
-#     error "__cpp_lib_freestanding_algorithm should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_algorithm != 202311L
-#     error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_algorithm
-#     error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_array
-#     error "__cpp_lib_freestanding_array should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_array != 202311L
-#     error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_array
-#     error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_cstring
-#     error "__cpp_lib_freestanding_cstring should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_cstring != 202306L
-#     error "__cpp_lib_freestanding_cstring should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_cstring
-#     error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_expected
-#     error "__cpp_lib_freestanding_expected should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_expected != 202311L
-#     error "__cpp_lib_freestanding_expected should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_expected
-#     error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_mdspan
-#     error "__cpp_lib_freestanding_mdspan should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_mdspan != 202311L
-#     error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_mdspan
-#     error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_optional
-#     error "__cpp_lib_freestanding_optional should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_optional != 202311L
-#     error "__cpp_lib_freestanding_optional should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_optional
-#     error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_string_view
-#     error "__cpp_lib_freestanding_string_view should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_string_view != 202311L
-#     error "__cpp_lib_freestanding_string_view should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_string_view
-#     error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_freestanding_variant
-#     error "__cpp_lib_freestanding_variant should be defined in c++26"
-#   endif
-#   if __cpp_lib_freestanding_variant != 202311L
-#     error "__cpp_lib_freestanding_variant should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_freestanding_variant
-#     error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
-#   ifndef __cpp_lib_fstream_native_handle
-#     error "__cpp_lib_fstream_native_handle should be defined in c++26"
-#   endif
-#   if __cpp_lib_fstream_native_handle != 202306L
-#     error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_fstream_native_handle
-#     error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_function_ref
-#     error "__cpp_lib_function_ref should be defined in c++26"
-#   endif
-#   if __cpp_lib_function_ref != 202306L
-#     error "__cpp_lib_function_ref should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_function_ref
-#     error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_gcd_lcm
-#   error "__cpp_lib_gcd_lcm should be defined in c++26"
-# endif
-# if __cpp_lib_gcd_lcm != 201606L
-#   error "__cpp_lib_gcd_lcm should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_generate_random
-#     error "__cpp_lib_generate_random should be defined in c++26"
-#   endif
-#   if __cpp_lib_generate_random != 202403L
-#     error "__cpp_lib_generate_random should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_generate_random
-#     error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_generic_associative_lookup
-#   error "__cpp_lib_generic_associative_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_associative_lookup != 201304L
-#   error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_generic_unordered_lookup
-#   error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
-# endif
-# if __cpp_lib_generic_unordered_lookup != 201811L
-#   error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
-#   ifndef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should be defined in c++26"
-#   endif
-#   if __cpp_lib_hardware_interference_size != 201703L
-#     error "__cpp_lib_hardware_interference_size should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_hardware_interference_size
-#     error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_has_unique_object_representations
-#   error "__cpp_lib_has_unique_object_representations should be defined in c++26"
-# endif
-# if __cpp_lib_has_unique_object_representations != 201606L
-#   error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_hazard_pointer
-#     error "__cpp_lib_hazard_pointer should be defined in c++26"
-#   endif
-#   if __cpp_lib_hazard_pointer != 202306L
-#     error "__cpp_lib_hazard_pointer should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_hazard_pointer
-#     error "__cpp_lib_hazard_pointer should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_hypot
-#   error "__cpp_lib_hypot should be defined in c++26"
-# endif
-# if __cpp_lib_hypot != 201603L
-#   error "__cpp_lib_hypot should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_incomplete_container_elements
-#   error "__cpp_lib_incomplete_container_elements should be defined in c++26"
-# endif
-# if __cpp_lib_incomplete_container_elements != 201505L
-#   error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_inplace_vector
-#     error "__cpp_lib_inplace_vector should be defined in c++26"
-#   endif
-#   if __cpp_lib_inplace_vector != 202406L
-#     error "__cpp_lib_inplace_vector should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_inplace_vector
-#     error "__cpp_lib_inplace_vector should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_int_pow2
-#   error "__cpp_lib_int_pow2 should be defined in c++26"
-# endif
-# if __cpp_lib_int_pow2 != 202002L
-#   error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_integer_comparison_functions
-#   error "__cpp_lib_integer_comparison_functions should be defined in c++26"
-# endif
-# if __cpp_lib_integer_comparison_functions != 202002L
-#   error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_integer_sequence
-#   error "__cpp_lib_integer_sequence should be defined in c++26"
-# endif
-# if __cpp_lib_integer_sequence != 201304L
-#   error "__cpp_lib_integer_sequence should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_integral_constant_callable
-#   error "__cpp_lib_integral_constant_callable should be defined in c++26"
-# endif
-# if __cpp_lib_integral_constant_callable != 201304L
-#   error "__cpp_lib_integral_constant_callable should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_interpolate
-#   error "__cpp_lib_interpolate should be defined in c++26"
-# endif
-# if __cpp_lib_interpolate != 201902L
-#   error "__cpp_lib_interpolate should have the value 201902L in c++26"
-# endif
-
-# ifndef __cpp_lib_invoke
-#   error "__cpp_lib_invoke should be defined in c++26"
-# endif
-# if __cpp_lib_invoke != 201411L
-#   error "__cpp_lib_invoke should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_invoke_r
-#   error "__cpp_lib_invoke_r should be defined in c++26"
-# endif
-# if __cpp_lib_invoke_r != 202106L
-#   error "__cpp_lib_invoke_r should have the value 202106L in c++26"
-# endif
-
-# ifndef __cpp_lib_ios_noreplace
-#   error "__cpp_lib_ios_noreplace should be defined in c++26"
-# endif
-# if __cpp_lib_ios_noreplace != 202207L
-#   error "__cpp_lib_ios_noreplace should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_aggregate
-#   error "__cpp_lib_is_aggregate should be defined in c++26"
-# endif
-# if __cpp_lib_is_aggregate != 201703L
-#   error "__cpp_lib_is_aggregate should have the value 201703L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_constant_evaluated
-#   error "__cpp_lib_is_constant_evaluated should be defined in c++26"
-# endif
-# if __cpp_lib_is_constant_evaluated != 201811L
-#   error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_final
-#   error "__cpp_lib_is_final should be defined in c++26"
-# endif
-# if __cpp_lib_is_final != 201402L
-#   error "__cpp_lib_is_final should have the value 201402L in c++26"
-# endif
-
-# if __has_builtin(__builtin_is_implicit_lifetime)
-#   ifndef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_implicit_lifetime != 202302L
-#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_is_implicit_lifetime
-#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_invocable
-#   error "__cpp_lib_is_invocable should be defined in c++26"
-# endif
-# if __cpp_lib_is_invocable != 201703L
-#   error "__cpp_lib_is_invocable should have the value 201703L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_layout_compatible != 201907L
-#     error "__cpp_lib_is_layout_compatible should have the value 201907L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_layout_compatible
-#     error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_nothrow_convertible
-#   error "__cpp_lib_is_nothrow_convertible should be defined in c++26"
-# endif
-# if __cpp_lib_is_nothrow_convertible != 201806L
-#   error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_null_pointer
-#   error "__cpp_lib_is_null_pointer should be defined in c++26"
-# endif
-# if __cpp_lib_is_null_pointer != 201309L
-#   error "__cpp_lib_is_null_pointer should have the value 201309L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_pointer_interconvertible != 201907L
-#     error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_pointer_interconvertible
-#     error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_is_scoped_enum
-#   error "__cpp_lib_is_scoped_enum should be defined in c++26"
-# endif
-# if __cpp_lib_is_scoped_enum != 202011L
-#   error "__cpp_lib_is_scoped_enum should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_is_swappable
-#   error "__cpp_lib_is_swappable should be defined in c++26"
-# endif
-# if __cpp_lib_is_swappable != 201603L
-#   error "__cpp_lib_is_swappable should have the value 201603L in c++26"
-# endif
-
-# if __has_builtin(__builtin_is_virtual_base_of)
-#   ifndef __cpp_lib_is_virtual_base_of
-#     error "__cpp_lib_is_virtual_base_of should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_virtual_base_of != 202406L
-#     error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_is_virtual_base_of
-#     error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_is_within_lifetime
-#     error "__cpp_lib_is_within_lifetime should be defined in c++26"
-#   endif
-#   if __cpp_lib_is_within_lifetime != 202306L
-#     error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_is_within_lifetime
-#     error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should be defined in c++26"
-#   endif
-#   if __cpp_lib_jthread != 201911L
-#     error "__cpp_lib_jthread should have the value 201911L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_jthread
-#     error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_latch
-#     error "__cpp_lib_latch should be defined in c++26"
-#   endif
-#   if __cpp_lib_latch != 201907L
-#     error "__cpp_lib_latch should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_latch
-#     error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_launder
-#   error "__cpp_lib_launder should be defined in c++26"
-# endif
-# if __cpp_lib_launder != 201606L
-#   error "__cpp_lib_launder should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_linalg
-#     error "__cpp_lib_linalg should be defined in c++26"
-#   endif
-#   if __cpp_lib_linalg != 202311L
-#     error "__cpp_lib_linalg should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_linalg
-#     error "__cpp_lib_linalg should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_list_remove_return_type
-#   error "__cpp_lib_list_remove_return_type should be defined in c++26"
-# endif
-# if __cpp_lib_list_remove_return_type != 201806L
-#   error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_logical_traits
-#   error "__cpp_lib_logical_traits should be defined in c++26"
-# endif
-# if __cpp_lib_logical_traits != 201510L
-#   error "__cpp_lib_logical_traits should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_make_from_tuple
-#   error "__cpp_lib_make_from_tuple should be defined in c++26"
-# endif
-# if __cpp_lib_make_from_tuple != 201606L
-#   error "__cpp_lib_make_from_tuple should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_make_reverse_iterator
-#   error "__cpp_lib_make_reverse_iterator should be defined in c++26"
-# endif
-# if __cpp_lib_make_reverse_iterator != 201402L
-#   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++26"
-# endif
-
-# ifndef __cpp_lib_make_unique
-#   error "__cpp_lib_make_unique should be defined in c++26"
-# endif
-# if __cpp_lib_make_unique != 201304L
-#   error "__cpp_lib_make_unique should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_map_try_emplace
-#   error "__cpp_lib_map_try_emplace should be defined in c++26"
-# endif
-# if __cpp_lib_map_try_emplace != 201411L
-#   error "__cpp_lib_map_try_emplace should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_math_constants
-#   error "__cpp_lib_math_constants should be defined in c++26"
-# endif
-# if __cpp_lib_math_constants != 201907L
-#   error "__cpp_lib_math_constants should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should be defined in c++26"
-#   endif
-#   if __cpp_lib_math_special_functions != 201603L
-#     error "__cpp_lib_math_special_functions should have the value 201603L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_math_special_functions
-#     error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_mdspan
-#   error "__cpp_lib_mdspan should be defined in c++26"
-# endif
-# if __cpp_lib_mdspan != 202406L
-#   error "__cpp_lib_mdspan should have the value 202406L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should be defined in c++26"
-#   endif
-#   if __cpp_lib_memory_resource != 201603L
-#     error "__cpp_lib_memory_resource should have the value 201603L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_memory_resource
-#     error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_modules
-#   error "__cpp_lib_modules should be defined in c++26"
-# endif
-# if __cpp_lib_modules != 202207L
-#   error "__cpp_lib_modules should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_move_iterator_concept
-#   error "__cpp_lib_move_iterator_concept should be defined in c++26"
-# endif
-# if __cpp_lib_move_iterator_concept != 202207L
-#   error "__cpp_lib_move_iterator_concept should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should be defined in c++26"
-#   endif
-#   if __cpp_lib_move_only_function != 202110L
-#     error "__cpp_lib_move_only_function should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_move_only_function
-#     error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_node_extract
-#   error "__cpp_lib_node_extract should be defined in c++26"
-# endif
-# if __cpp_lib_node_extract != 201606L
-#   error "__cpp_lib_node_extract should have the value 201606L in c++26"
-# endif
-
-# ifndef __cpp_lib_nonmember_container_access
-#   error "__cpp_lib_nonmember_container_access should be defined in c++26"
-# endif
-# if __cpp_lib_nonmember_container_access != 201411L
-#   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_not_fn
-#   error "__cpp_lib_not_fn should be defined in c++26"
-# endif
-# if __cpp_lib_not_fn != 202306L
-#   error "__cpp_lib_not_fn should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_null_iterators
-#   error "__cpp_lib_null_iterators should be defined in c++26"
-# endif
-# if __cpp_lib_null_iterators != 201304L
-#   error "__cpp_lib_null_iterators should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_optional
-#   error "__cpp_lib_optional should be defined in c++26"
-# endif
-# if __cpp_lib_optional != 202110L
-#   error "__cpp_lib_optional should have the value 202110L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_optional_range_support
-#     error "__cpp_lib_optional_range_support should be defined in c++26"
-#   endif
-#   if __cpp_lib_optional_range_support != 202406L
-#     error "__cpp_lib_optional_range_support should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_optional_range_support
-#     error "__cpp_lib_optional_range_support should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_out_ptr
-#   error "__cpp_lib_out_ptr should be defined in c++26"
-# endif
-# if __cpp_lib_out_ptr != 202311L
-#   error "__cpp_lib_out_ptr should have the value 202311L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should be defined in c++26"
-#   endif
-#   if __cpp_lib_parallel_algorithm != 201603L
-#     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_parallel_algorithm
-#     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_philox_engine
-#     error "__cpp_lib_philox_engine should be defined in c++26"
-#   endif
-#   if __cpp_lib_philox_engine != 202406L
-#     error "__cpp_lib_philox_engine should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_philox_engine
-#     error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
-#   ifndef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should be defined in c++26"
-#   endif
-#   if __cpp_lib_polymorphic_allocator != 201902L
-#     error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_polymorphic_allocator
-#     error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
-#   ifndef __cpp_lib_print
-#     error "__cpp_lib_print should be defined in c++26"
-#   endif
-#   if __cpp_lib_print != 202207L
-#     error "__cpp_lib_print should have the value 202207L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_print
-#     error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
-#   ifndef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should be defined in c++26"
-#   endif
-#   if __cpp_lib_quoted_string_io != 201304L
-#     error "__cpp_lib_quoted_string_io should have the value 201304L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_quoted_string_io
-#     error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges
-#   error "__cpp_lib_ranges should be defined in c++26"
-# endif
-# if __cpp_lib_ranges != 202406L
-#   error "__cpp_lib_ranges should have the value 202406L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_as_const != 202207L
-#     error "__cpp_lib_ranges_as_const should have the value 202207L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_as_const
-#     error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_as_rvalue
-#   error "__cpp_lib_ranges_as_rvalue should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_as_rvalue != 202207L
-#   error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_chunk != 202202L
-#     error "__cpp_lib_ranges_chunk should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_chunk
-#     error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_chunk_by
-#   error "__cpp_lib_ranges_chunk_by should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_chunk_by != 202202L
-#   error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_concat
-#     error "__cpp_lib_ranges_concat should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_concat != 202403L
-#     error "__cpp_lib_ranges_concat should have the value 202403L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_concat
-#     error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_contains
-#   error "__cpp_lib_ranges_contains should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_contains != 202207L
-#   error "__cpp_lib_ranges_contains should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_find_last
-#   error "__cpp_lib_ranges_find_last should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_find_last != 202207L
-#   error "__cpp_lib_ranges_find_last should have the value 202207L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_iota
-#   error "__cpp_lib_ranges_iota should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_iota != 202202L
-#   error "__cpp_lib_ranges_iota should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_join_with != 202202L
-#     error "__cpp_lib_ranges_join_with should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_join_with
-#     error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_repeat
-#   error "__cpp_lib_ranges_repeat should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_repeat != 202207L
-#   error "__cpp_lib_ranges_repeat should have the value 202207L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_slide != 202202L
-#     error "__cpp_lib_ranges_slide should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_slide
-#     error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ranges_starts_ends_with
-#   error "__cpp_lib_ranges_starts_ends_with should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_starts_ends_with != 202106L
-#   error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26"
-# endif
-
-# ifndef __cpp_lib_ranges_to_container
-#   error "__cpp_lib_ranges_to_container should be defined in c++26"
-# endif
-# if __cpp_lib_ranges_to_container != 202202L
-#   error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should be defined in c++26"
-#   endif
-#   if __cpp_lib_ranges_zip != 202110L
-#     error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_ranges_zip
-#     error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ratio
-#   error "__cpp_lib_ratio should be defined in c++26"
-# endif
-# if __cpp_lib_ratio != 202306L
-#   error "__cpp_lib_ratio should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_raw_memory_algorithms
-#   error "__cpp_lib_raw_memory_algorithms should be defined in c++26"
-# endif
-# if __cpp_lib_raw_memory_algorithms != 201606L
-#   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_rcu
-#     error "__cpp_lib_rcu should be defined in c++26"
-#   endif
-#   if __cpp_lib_rcu != 202306L
-#     error "__cpp_lib_rcu should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_rcu
-#     error "__cpp_lib_rcu should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should be defined in c++26"
-#   endif
-#   if __cpp_lib_reference_from_temporary != 202202L
-#     error "__cpp_lib_reference_from_temporary should have the value 202202L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_reference_from_temporary
-#     error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_reference_wrapper
-#   error "__cpp_lib_reference_wrapper should be defined in c++26"
-# endif
-# if __cpp_lib_reference_wrapper != 202403L
-#   error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
-# endif
-
-# ifndef __cpp_lib_remove_cvref
-#   error "__cpp_lib_remove_cvref should be defined in c++26"
-# endif
-# if __cpp_lib_remove_cvref != 201711L
-#   error "__cpp_lib_remove_cvref should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_result_of_sfinae
-#   error "__cpp_lib_result_of_sfinae should be defined in c++26"
-# endif
-# if __cpp_lib_result_of_sfinae != 201210L
-#   error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
-# endif
-
-# ifndef __cpp_lib_robust_nonmodifying_seq_ops
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26"
-# endif
-# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
-#   error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_sample
-#   error "__cpp_lib_sample should be defined in c++26"
-# endif
-# if __cpp_lib_sample != 201603L
-#   error "__cpp_lib_sample should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_saturation_arithmetic
-#   error "__cpp_lib_saturation_arithmetic should be defined in c++26"
-# endif
-# if __cpp_lib_saturation_arithmetic != 202311L
-#   error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should be defined in c++26"
-#   endif
-#   if __cpp_lib_scoped_lock != 201703L
-#     error "__cpp_lib_scoped_lock should have the value 201703L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_scoped_lock
-#     error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
-#   ifndef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should be defined in c++26"
-#   endif
-#   if __cpp_lib_semaphore != 201907L
-#     error "__cpp_lib_semaphore should have the value 201907L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_semaphore
-#     error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_senders
-#     error "__cpp_lib_senders should be defined in c++26"
-#   endif
-#   if __cpp_lib_senders != 202406L
-#     error "__cpp_lib_senders should have the value 202406L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_senders
-#     error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should be defined in c++26"
-#   endif
-#   if __cpp_lib_shared_mutex != 201505L
-#     error "__cpp_lib_shared_mutex should have the value 201505L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_mutex
-#     error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shared_ptr_arrays
-#   error "__cpp_lib_shared_ptr_arrays should be defined in c++26"
-# endif
-# if __cpp_lib_shared_ptr_arrays != 201707L
-#   error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++26"
-# endif
-
-# ifndef __cpp_lib_shared_ptr_weak_type
-#   error "__cpp_lib_shared_ptr_weak_type should be defined in c++26"
-# endif
-# if __cpp_lib_shared_ptr_weak_type != 201606L
-#   error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
-#   ifndef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should be defined in c++26"
-#   endif
-#   if __cpp_lib_shared_timed_mutex != 201402L
-#     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_shared_timed_mutex
-#     error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_shift
-#   error "__cpp_lib_shift should be defined in c++26"
-# endif
-# if __cpp_lib_shift != 201806L
-#   error "__cpp_lib_shift should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-#   error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-#   error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_smart_ptr_owner_equality
-#     error "__cpp_lib_smart_ptr_owner_equality should be defined in c++26"
-#   endif
-#   if __cpp_lib_smart_ptr_owner_equality != 202306L
-#     error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_smart_ptr_owner_equality
-#     error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_source_location
-#   error "__cpp_lib_source_location should be defined in c++26"
-# endif
-# if __cpp_lib_source_location != 201907L
-#   error "__cpp_lib_source_location should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_span
-#   error "__cpp_lib_span should be defined in c++26"
-# endif
-# if __cpp_lib_span != 202002L
-#   error "__cpp_lib_span should have the value 202002L in c++26"
-# endif
-
-# ifndef __cpp_lib_span_at
-#   error "__cpp_lib_span_at should be defined in c++26"
-# endif
-# if __cpp_lib_span_at != 202311L
-#   error "__cpp_lib_span_at should have the value 202311L in c++26"
-# endif
-
-# ifndef __cpp_lib_span_initializer_list
-#   error "__cpp_lib_span_initializer_list should be defined in c++26"
-# endif
-# if __cpp_lib_span_initializer_list != 202311L
-#   error "__cpp_lib_span_initializer_list should have the value 202311L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_spanstream
-#     error "__cpp_lib_spanstream should be defined in c++26"
-#   endif
-#   if __cpp_lib_spanstream != 202106L
-#     error "__cpp_lib_spanstream should have the value 202106L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_spanstream
-#     error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_ssize
-#   error "__cpp_lib_ssize should be defined in c++26"
-# endif
-# if __cpp_lib_ssize != 201902L
-#   error "__cpp_lib_ssize should have the value 201902L in c++26"
-# endif
-
-# ifndef __cpp_lib_sstream_from_string_view
-#   error "__cpp_lib_sstream_from_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_sstream_from_string_view != 202306L
-#   error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_stacktrace
-#     error "__cpp_lib_stacktrace should be defined in c++26"
-#   endif
-#   if __cpp_lib_stacktrace != 202011L
-#     error "__cpp_lib_stacktrace should have the value 202011L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_stacktrace
-#     error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_starts_ends_with
-#   error "__cpp_lib_starts_ends_with should be defined in c++26"
-# endif
-# if __cpp_lib_starts_ends_with != 201711L
-#   error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_stdatomic_h
-#   error "__cpp_lib_stdatomic_h should be defined in c++26"
-# endif
-# if __cpp_lib_stdatomic_h != 202011L
-#   error "__cpp_lib_stdatomic_h should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_contains
-#   error "__cpp_lib_string_contains should be defined in c++26"
-# endif
-# if __cpp_lib_string_contains != 202011L
-#   error "__cpp_lib_string_contains should have the value 202011L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_resize_and_overwrite
-#   error "__cpp_lib_string_resize_and_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_string_resize_and_overwrite != 202110L
-#   error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_udls
-#   error "__cpp_lib_string_udls should be defined in c++26"
-# endif
-# if __cpp_lib_string_udls != 201304L
-#   error "__cpp_lib_string_udls should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_string_view
-#   error "__cpp_lib_string_view should be defined in c++26"
-# endif
-# if __cpp_lib_string_view != 202403L
-#   error "__cpp_lib_string_view should have the value 202403L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_submdspan
-#     error "__cpp_lib_submdspan should be defined in c++26"
-#   endif
-#   if __cpp_lib_submdspan != 202306L
-#     error "__cpp_lib_submdspan should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_submdspan
-#     error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
-#   ifndef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should be defined in c++26"
-#   endif
-#   if __cpp_lib_syncbuf != 201803L
-#     error "__cpp_lib_syncbuf should have the value 201803L in c++26"
-#   endif
-# else
-#   ifdef __cpp_lib_syncbuf
-#     error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_text_encoding
-#     error "__cpp_lib_text_encoding should be defined in c++26"
-#   endif
-#   if __cpp_lib_text_encoding != 202306L
-#     error "__cpp_lib_text_encoding should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_text_encoding
-#     error "__cpp_lib_text_encoding should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_three_way_comparison
-#   error "__cpp_lib_three_way_comparison should be defined in c++26"
-# endif
-# if __cpp_lib_three_way_comparison != 201907L
-#   error "__cpp_lib_three_way_comparison should have the value 201907L in c++26"
-# endif
-
-# ifndef __cpp_lib_to_address
-#   error "__cpp_lib_to_address should be defined in c++26"
-# endif
-# if __cpp_lib_to_address != 201711L
-#   error "__cpp_lib_to_address should have the value 201711L in c++26"
-# endif
-
-# ifndef __cpp_lib_to_array
-#   error "__cpp_lib_to_array should be defined in c++26"
-# endif
-# if __cpp_lib_to_array != 201907L
-#   error "__cpp_lib_to_array should have the value 201907L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should be defined in c++26"
-#   endif
-#   if __cpp_lib_to_chars != 202306L
-#     error "__cpp_lib_to_chars should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_chars
-#     error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_to_string
-#     error "__cpp_lib_to_string should be defined in c++26"
-#   endif
-#   if __cpp_lib_to_string != 202306L
-#     error "__cpp_lib_to_string should have the value 202306L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_to_string
-#     error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_to_underlying
-#   error "__cpp_lib_to_underlying should be defined in c++26"
-# endif
-# if __cpp_lib_to_underlying != 202102L
-#   error "__cpp_lib_to_underlying should have the value 202102L in c++26"
-# endif
-
-# ifndef __cpp_lib_transformation_trait_aliases
-#   error "__cpp_lib_transformation_trait_aliases should be defined in c++26"
-# endif
-# if __cpp_lib_transformation_trait_aliases != 201304L
-#   error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_transparent_operators
-#   error "__cpp_lib_transparent_operators should be defined in c++26"
-# endif
-# if __cpp_lib_transparent_operators != 201510L
-#   error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_tuple_element_t
-#   error "__cpp_lib_tuple_element_t should be defined in c++26"
-# endif
-# if __cpp_lib_tuple_element_t != 201402L
-#   error "__cpp_lib_tuple_element_t should have the value 201402L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should be defined in c++26"
-#   endif
-#   if __cpp_lib_tuple_like != 202311L
-#     error "__cpp_lib_tuple_like should have the value 202311L in c++26"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_tuple_like
-#     error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
-
-# ifndef __cpp_lib_tuples_by_type
-#   error "__cpp_lib_tuples_by_type should be defined in c++26"
-# endif
-# if __cpp_lib_tuples_by_type != 201304L
-#   error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
-# endif
-
-# ifndef __cpp_lib_type_identity
-#   error "__cpp_lib_type_identity should be defined in c++26"
-# endif
-# if __cpp_lib_type_identity != 201806L
-#   error "__cpp_lib_type_identity should have the value 201806L in c++26"
-# endif
-
-# ifndef __cpp_lib_type_trait_variable_templates
-#   error "__cpp_lib_type_trait_variable_templates should be defined in c++26"
-# endif
-# if __cpp_lib_type_trait_variable_templates != 201510L
-#   error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++26"
-# endif
-
-# ifndef __cpp_lib_uncaught_exceptions
-#   error "__cpp_lib_uncaught_exceptions should be defined in c++26"
-# endif
-# if __cpp_lib_uncaught_exceptions != 201411L
-#   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_unordered_map_try_emplace
-#   error "__cpp_lib_unordered_map_try_emplace should be defined in c++26"
-# endif
-# if __cpp_lib_unordered_map_try_emplace != 201411L
-#   error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26"
-# endif
-
-# ifndef __cpp_lib_unreachable
-#   error "__cpp_lib_unreachable should be defined in c++26"
-# endif
-# if __cpp_lib_unreachable != 202202L
-#   error "__cpp_lib_unreachable should have the value 202202L in c++26"
-# endif
-
-# ifndef __cpp_lib_unwrap_ref
-#   error "__cpp_lib_unwrap_ref should be defined in c++26"
-# endif
-# if __cpp_lib_unwrap_ref != 201811L
-#   error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
-# endif
-
-# ifndef __cpp_lib_variant
-#   error "__cpp_lib_variant should be defined in c++26"
-# endif
-# if __cpp_lib_variant != 202306L
-#   error "__cpp_lib_variant should have the value 202306L in c++26"
-# endif
-
-# ifndef __cpp_lib_void_t
-#   error "__cpp_lib_void_t should be defined in c++26"
-# endif
-# if __cpp_lib_void_t != 201411L
-#   error "__cpp_lib_void_t should have the value 201411L in c++26"
-# endif
+#  ifndef __cpp_lib_adaptor_iterator_pair_constructor
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
+#  endif
+#  if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+#    error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_addressof_constexpr
+#    error "__cpp_lib_addressof_constexpr should be defined in c++26"
+#  endif
+#  if __cpp_lib_addressof_constexpr != 201603L
+#    error "__cpp_lib_addressof_constexpr should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_allocate_at_least
+#    error "__cpp_lib_allocate_at_least should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocate_at_least != 202302L
+#    error "__cpp_lib_allocate_at_least should have the value 202302L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_allocator_traits_is_always_equal
+#    error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
+#  endif
+#  if __cpp_lib_allocator_traits_is_always_equal != 201411L
+#    error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++26"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_apply
+#    error "__cpp_lib_apply should be defined in c++26"
+#  endif
+#  if __cpp_lib_apply != 201603L
+#    error "__cpp_lib_apply should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should be defined in c++26"
+#  endif
+#  if __cpp_lib_array_constexpr != 201811L
+#    error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_as_const
+#    error "__cpp_lib_as_const should be defined in c++26"
+#  endif
+#  if __cpp_lib_as_const != 201510L
+#    error "__cpp_lib_as_const should have the value 201510L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_erasure != 202110L
+#      error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_erasure
+#      error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26"
+#    endif
+#    if __cpp_lib_associative_heterogeneous_insertion != 202306L
+#      error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_associative_heterogeneous_insertion
+#      error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_assume_aligned
+#    error "__cpp_lib_assume_aligned should be defined in c++26"
+#  endif
+#  if __cpp_lib_assume_aligned != 201811L
+#    error "__cpp_lib_assume_aligned should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_flag_test
+#    error "__cpp_lib_atomic_flag_test should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_flag_test != 201907L
+#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_float
+#    error "__cpp_lib_atomic_float should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_float != 201711L
+#    error "__cpp_lib_atomic_float should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_is_always_lock_free
+#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_is_always_lock_free != 201603L
+#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_atomic_lock_free_type_aliases
+#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_min_max
+#      error "__cpp_lib_atomic_min_max should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_min_max != 202403L
+#      error "__cpp_lib_atomic_min_max should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_min_max
+#      error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_ref
+#    error "__cpp_lib_atomic_ref should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_ref != 201806L
+#    error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_shared_ptr != 201711L
+#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_shared_ptr
+#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_atomic_value_initialization
+#    error "__cpp_lib_atomic_value_initialization should be defined in c++26"
+#  endif
+#  if __cpp_lib_atomic_value_initialization != 201911L
+#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC
+#    ifndef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should be defined in c++26"
+#    endif
+#    if __cpp_lib_atomic_wait != 201907L
+#      error "__cpp_lib_atomic_wait should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_atomic_wait
+#      error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should be defined in c++26"
+#    endif
+#    if __cpp_lib_barrier != 201907L
+#      error "__cpp_lib_barrier should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_barrier
+#      error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_bind_back
+#    error "__cpp_lib_bind_back should be defined in c++26"
+#  endif
+#  if __cpp_lib_bind_back != 202202L
+#    error "__cpp_lib_bind_back should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bind_front
+#    error "__cpp_lib_bind_front should be defined in c++26"
+#  endif
+#  if __cpp_lib_bind_front != 202306L
+#    error "__cpp_lib_bind_front should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bit_cast
+#    error "__cpp_lib_bit_cast should be defined in c++26"
+#  endif
+#  if __cpp_lib_bit_cast != 201806L
+#    error "__cpp_lib_bit_cast should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bitops
+#    error "__cpp_lib_bitops should be defined in c++26"
+#  endif
+#  if __cpp_lib_bitops != 201907L
+#    error "__cpp_lib_bitops should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bitset
+#    error "__cpp_lib_bitset should be defined in c++26"
+#  endif
+#  if __cpp_lib_bitset != 202306L
+#    error "__cpp_lib_bitset should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bool_constant
+#    error "__cpp_lib_bool_constant should be defined in c++26"
+#  endif
+#  if __cpp_lib_bool_constant != 201505L
+#    error "__cpp_lib_bool_constant should have the value 201505L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_bounded_array_traits
+#    error "__cpp_lib_bounded_array_traits should be defined in c++26"
+#  endif
+#  if __cpp_lib_bounded_array_traits != 201902L
+#    error "__cpp_lib_bounded_array_traits should have the value 201902L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_boyer_moore_searcher
+#    error "__cpp_lib_boyer_moore_searcher should be defined in c++26"
+#  endif
+#  if __cpp_lib_boyer_moore_searcher != 201603L
+#    error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_byte
+#    error "__cpp_lib_byte should be defined in c++26"
+#  endif
+#  if __cpp_lib_byte != 201603L
+#    error "__cpp_lib_byte should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_byteswap
+#    error "__cpp_lib_byteswap should be defined in c++26"
+#  endif
+#  if __cpp_lib_byteswap != 202110L
+#    error "__cpp_lib_byteswap should have the value 202110L in c++26"
+#  endif
+
+#  if defined(__cpp_char8_t)
+#    ifndef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should be defined in c++26"
+#    endif
+#    if __cpp_lib_char8_t != 201907L
+#      error "__cpp_lib_char8_t should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_char8_t
+#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_chrono
+#    error "__cpp_lib_chrono should be defined in c++26"
+#  endif
+#  if __cpp_lib_chrono != 201611L
+#    error "__cpp_lib_chrono should have the value 201611L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_chrono_udls
+#    error "__cpp_lib_chrono_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_chrono_udls != 201304L
+#    error "__cpp_lib_chrono_udls should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++26"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_complex_udls
+#    error "__cpp_lib_complex_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_complex_udls != 201309L
+#    error "__cpp_lib_complex_udls should have the value 201309L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_concepts
+#    error "__cpp_lib_concepts should be defined in c++26"
+#  endif
+#  if __cpp_lib_concepts != 202002L
+#    error "__cpp_lib_concepts should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 202306L
+#    error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_bitset
+#    error "__cpp_lib_constexpr_bitset should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_bitset != 202207L
+#    error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_charconv
+#    error "__cpp_lib_constexpr_charconv should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_charconv != 202207L
+#    error "__cpp_lib_constexpr_charconv should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should be defined in c++26"
+#    endif
+#    if __cpp_lib_constexpr_cmath != 202202L
+#      error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_cmath
+#      error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_complex
+#    error "__cpp_lib_constexpr_complex should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_complex != 201711L
+#    error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_dynamic_alloc
+#    error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_dynamic_alloc != 201907L
+#    error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_functional
+#    error "__cpp_lib_constexpr_functional should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_functional != 201907L
+#    error "__cpp_lib_constexpr_functional should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_iterator
+#    error "__cpp_lib_constexpr_iterator should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_iterator != 201811L
+#    error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_memory
+#    error "__cpp_lib_constexpr_memory should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_memory != 202202L
+#    error "__cpp_lib_constexpr_memory should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_ABI_VCRUNTIME)
+#    ifndef __cpp_lib_constexpr_new
+#      error "__cpp_lib_constexpr_new should be defined in c++26"
+#    endif
+#    if __cpp_lib_constexpr_new != 202406L
+#      error "__cpp_lib_constexpr_new should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constexpr_new
+#      error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_constexpr_numeric
+#    error "__cpp_lib_constexpr_numeric should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_numeric != 201911L
+#    error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string
+#    error "__cpp_lib_constexpr_string should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_string != 201907L
+#    error "__cpp_lib_constexpr_string should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_string_view
+#    error "__cpp_lib_constexpr_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_string_view != 201811L
+#    error "__cpp_lib_constexpr_string_view should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_tuple
+#    error "__cpp_lib_constexpr_tuple should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_tuple != 201811L
+#    error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_typeinfo
+#    error "__cpp_lib_constexpr_typeinfo should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_typeinfo != 202106L
+#    error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_utility
+#    error "__cpp_lib_constexpr_utility should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_utility != 201811L
+#    error "__cpp_lib_constexpr_utility should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_vector
+#    error "__cpp_lib_constexpr_vector should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_vector != 201907L
+#    error "__cpp_lib_constexpr_vector should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_constrained_equality != 202403L
+#      error "__cpp_lib_constrained_equality should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_constrained_equality
+#      error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_containers_ranges
+#    error "__cpp_lib_containers_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_containers_ranges != 202202L
+#    error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_copyable_function
+#      error "__cpp_lib_copyable_function should be defined in c++26"
+#    endif
+#    if __cpp_lib_copyable_function != 202306L
+#      error "__cpp_lib_copyable_function should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_copyable_function
+#      error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_coroutine
+#    error "__cpp_lib_coroutine should be defined in c++26"
+#  endif
+#  if __cpp_lib_coroutine != 201902L
+#    error "__cpp_lib_coroutine should have the value 201902L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_debugging
+#      error "__cpp_lib_debugging should be defined in c++26"
+#    endif
+#    if __cpp_lib_debugging != 202311L
+#      error "__cpp_lib_debugging should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_debugging
+#      error "__cpp_lib_debugging should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+#    ifndef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should be defined in c++26"
+#    endif
+#    if __cpp_lib_destroying_delete != 201806L
+#      error "__cpp_lib_destroying_delete should have the value 201806L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_destroying_delete
+#      error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_enable_shared_from_this
+#    error "__cpp_lib_enable_shared_from_this should be defined in c++26"
+#  endif
+#  if __cpp_lib_enable_shared_from_this != 201603L
+#    error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_endian
+#    error "__cpp_lib_endian should be defined in c++26"
+#  endif
+#  if __cpp_lib_endian != 201907L
+#    error "__cpp_lib_endian should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_erase_if
+#    error "__cpp_lib_erase_if should be defined in c++26"
+#  endif
+#  if __cpp_lib_erase_if != 202002L
+#    error "__cpp_lib_erase_if should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_exchange_function
+#    error "__cpp_lib_exchange_function should be defined in c++26"
+#  endif
+#  if __cpp_lib_exchange_function != 201304L
+#    error "__cpp_lib_exchange_function should have the value 201304L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_execution
+#      error "__cpp_lib_execution should be defined in c++26"
+#    endif
+#    if __cpp_lib_execution != 201902L
+#      error "__cpp_lib_execution should have the value 201902L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_execution
+#      error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_expected
+#    error "__cpp_lib_expected should be defined in c++26"
+#  endif
+#  if __cpp_lib_expected != 202211L
+#    error "__cpp_lib_expected should have the value 202211L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)
+#    ifndef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should be defined in c++26"
+#    endif
+#    if __cpp_lib_filesystem != 201703L
+#      error "__cpp_lib_filesystem should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_filesystem
+#      error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_flat_map
+#    error "__cpp_lib_flat_map should be defined in c++26"
+#  endif
+#  if __cpp_lib_flat_map != 202207L
+#    error "__cpp_lib_flat_map should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_flat_set
+#    error "__cpp_lib_flat_set should be defined in c++26"
+#  endif
+#  if __cpp_lib_flat_set != 202207L
+#    error "__cpp_lib_flat_set should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_format
+#      error "__cpp_lib_format should be defined in c++26"
+#    endif
+#    if __cpp_lib_format != 202110L
+#      error "__cpp_lib_format should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_format
+#      error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_format_path
+#      error "__cpp_lib_format_path should be defined in c++26"
+#    endif
+#    if __cpp_lib_format_path != 202403L
+#      error "__cpp_lib_format_path should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_format_path
+#      error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_format_ranges
+#    error "__cpp_lib_format_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_format_ranges != 202207L
+#    error "__cpp_lib_format_ranges should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_format_uchar
+#    error "__cpp_lib_format_uchar should be defined in c++26"
+#  endif
+#  if __cpp_lib_format_uchar != 202311L
+#    error "__cpp_lib_format_uchar should have the value 202311L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should be defined in c++26"
+#    endif
+#    if __cpp_lib_formatters != 202302L
+#      error "__cpp_lib_formatters should have the value 202302L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_formatters
+#      error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_forward_like
+#    error "__cpp_lib_forward_like should be defined in c++26"
+#  endif
+#  if __cpp_lib_forward_like != 202207L
+#    error "__cpp_lib_forward_like should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_algorithm != 202311L
+#      error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_array
+#      error "__cpp_lib_freestanding_array should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_array != 202311L
+#      error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_array
+#      error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_cstring
+#      error "__cpp_lib_freestanding_cstring should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_cstring != 202306L
+#      error "__cpp_lib_freestanding_cstring should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_cstring
+#      error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_expected
+#      error "__cpp_lib_freestanding_expected should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_expected != 202311L
+#      error "__cpp_lib_freestanding_expected should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_expected
+#      error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_mdspan
+#      error "__cpp_lib_freestanding_mdspan should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_mdspan != 202311L
+#      error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_mdspan
+#      error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_optional
+#      error "__cpp_lib_freestanding_optional should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_optional != 202311L
+#      error "__cpp_lib_freestanding_optional should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_optional
+#      error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_string_view
+#      error "__cpp_lib_freestanding_string_view should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_string_view != 202311L
+#      error "__cpp_lib_freestanding_string_view should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_string_view
+#      error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_variant
+#      error "__cpp_lib_freestanding_variant should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_variant != 202311L
+#      error "__cpp_lib_freestanding_variant should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_variant
+#      error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
+#    ifndef __cpp_lib_fstream_native_handle
+#      error "__cpp_lib_fstream_native_handle should be defined in c++26"
+#    endif
+#    if __cpp_lib_fstream_native_handle != 202306L
+#      error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_fstream_native_handle
+#      error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_function_ref
+#      error "__cpp_lib_function_ref should be defined in c++26"
+#    endif
+#    if __cpp_lib_function_ref != 202306L
+#      error "__cpp_lib_function_ref should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_function_ref
+#      error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_gcd_lcm
+#    error "__cpp_lib_gcd_lcm should be defined in c++26"
+#  endif
+#  if __cpp_lib_gcd_lcm != 201606L
+#    error "__cpp_lib_gcd_lcm should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_generate_random
+#      error "__cpp_lib_generate_random should be defined in c++26"
+#    endif
+#    if __cpp_lib_generate_random != 202403L
+#      error "__cpp_lib_generate_random should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_generate_random
+#      error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_generic_associative_lookup
+#    error "__cpp_lib_generic_associative_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_associative_lookup != 201304L
+#    error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_generic_unordered_lookup
+#    error "__cpp_lib_generic_unordered_lookup should be defined in c++26"
+#  endif
+#  if __cpp_lib_generic_unordered_lookup != 201811L
+#    error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))
+#    ifndef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should be defined in c++26"
+#    endif
+#    if __cpp_lib_hardware_interference_size != 201703L
+#      error "__cpp_lib_hardware_interference_size should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_hardware_interference_size
+#      error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_has_unique_object_representations
+#    error "__cpp_lib_has_unique_object_representations should be defined in c++26"
+#  endif
+#  if __cpp_lib_has_unique_object_representations != 201606L
+#    error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_hazard_pointer
+#      error "__cpp_lib_hazard_pointer should be defined in c++26"
+#    endif
+#    if __cpp_lib_hazard_pointer != 202306L
+#      error "__cpp_lib_hazard_pointer should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_hazard_pointer
+#      error "__cpp_lib_hazard_pointer should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_hypot
+#    error "__cpp_lib_hypot should be defined in c++26"
+#  endif
+#  if __cpp_lib_hypot != 201603L
+#    error "__cpp_lib_hypot should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_incomplete_container_elements
+#    error "__cpp_lib_incomplete_container_elements should be defined in c++26"
+#  endif
+#  if __cpp_lib_incomplete_container_elements != 201505L
+#    error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_inplace_vector
+#      error "__cpp_lib_inplace_vector should be defined in c++26"
+#    endif
+#    if __cpp_lib_inplace_vector != 202406L
+#      error "__cpp_lib_inplace_vector should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_inplace_vector
+#      error "__cpp_lib_inplace_vector should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_int_pow2
+#    error "__cpp_lib_int_pow2 should be defined in c++26"
+#  endif
+#  if __cpp_lib_int_pow2 != 202002L
+#    error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integer_comparison_functions
+#    error "__cpp_lib_integer_comparison_functions should be defined in c++26"
+#  endif
+#  if __cpp_lib_integer_comparison_functions != 202002L
+#    error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integer_sequence
+#    error "__cpp_lib_integer_sequence should be defined in c++26"
+#  endif
+#  if __cpp_lib_integer_sequence != 201304L
+#    error "__cpp_lib_integer_sequence should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_integral_constant_callable
+#    error "__cpp_lib_integral_constant_callable should be defined in c++26"
+#  endif
+#  if __cpp_lib_integral_constant_callable != 201304L
+#    error "__cpp_lib_integral_constant_callable should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_interpolate
+#    error "__cpp_lib_interpolate should be defined in c++26"
+#  endif
+#  if __cpp_lib_interpolate != 201902L
+#    error "__cpp_lib_interpolate should have the value 201902L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke
+#    error "__cpp_lib_invoke should be defined in c++26"
+#  endif
+#  if __cpp_lib_invoke != 201411L
+#    error "__cpp_lib_invoke should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_invoke_r
+#    error "__cpp_lib_invoke_r should be defined in c++26"
+#  endif
+#  if __cpp_lib_invoke_r != 202106L
+#    error "__cpp_lib_invoke_r should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ios_noreplace
+#    error "__cpp_lib_ios_noreplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_ios_noreplace != 202207L
+#    error "__cpp_lib_ios_noreplace should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_aggregate
+#    error "__cpp_lib_is_aggregate should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_aggregate != 201703L
+#    error "__cpp_lib_is_aggregate should have the value 201703L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_constant_evaluated
+#    error "__cpp_lib_is_constant_evaluated should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_constant_evaluated != 201811L
+#    error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_final
+#    error "__cpp_lib_is_final should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_final != 201402L
+#    error "__cpp_lib_is_final should have the value 201402L in c++26"
+#  endif
+
+#  if __has_builtin(__builtin_is_implicit_lifetime)
+#    ifndef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_implicit_lifetime != 202302L
+#      error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_implicit_lifetime
+#      error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_invocable
+#    error "__cpp_lib_is_invocable should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_invocable != 201703L
+#    error "__cpp_lib_is_invocable should have the value 201703L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_layout_compatible != 201907L
+#      error "__cpp_lib_is_layout_compatible should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_layout_compatible
+#      error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_nothrow_convertible
+#    error "__cpp_lib_is_nothrow_convertible should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_nothrow_convertible != 201806L
+#    error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_null_pointer
+#    error "__cpp_lib_is_null_pointer should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_null_pointer != 201309L
+#    error "__cpp_lib_is_null_pointer should have the value 201309L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_pointer_interconvertible != 201907L
+#      error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_pointer_interconvertible
+#      error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_is_scoped_enum
+#    error "__cpp_lib_is_scoped_enum should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_scoped_enum != 202011L
+#    error "__cpp_lib_is_scoped_enum should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_is_swappable
+#    error "__cpp_lib_is_swappable should be defined in c++26"
+#  endif
+#  if __cpp_lib_is_swappable != 201603L
+#    error "__cpp_lib_is_swappable should have the value 201603L in c++26"
+#  endif
+
+#  if __has_builtin(__builtin_is_virtual_base_of)
+#    ifndef __cpp_lib_is_virtual_base_of
+#      error "__cpp_lib_is_virtual_base_of should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_virtual_base_of != 202406L
+#      error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_virtual_base_of
+#      error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_is_within_lifetime
+#      error "__cpp_lib_is_within_lifetime should be defined in c++26"
+#    endif
+#    if __cpp_lib_is_within_lifetime != 202306L
+#      error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_is_within_lifetime
+#      error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should be defined in c++26"
+#    endif
+#    if __cpp_lib_jthread != 201911L
+#      error "__cpp_lib_jthread should have the value 201911L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_jthread
+#      error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_latch
+#      error "__cpp_lib_latch should be defined in c++26"
+#    endif
+#    if __cpp_lib_latch != 201907L
+#      error "__cpp_lib_latch should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_latch
+#      error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_launder
+#    error "__cpp_lib_launder should be defined in c++26"
+#  endif
+#  if __cpp_lib_launder != 201606L
+#    error "__cpp_lib_launder should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_linalg
+#      error "__cpp_lib_linalg should be defined in c++26"
+#    endif
+#    if __cpp_lib_linalg != 202311L
+#      error "__cpp_lib_linalg should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_linalg
+#      error "__cpp_lib_linalg should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_list_remove_return_type
+#    error "__cpp_lib_list_remove_return_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_list_remove_return_type != 201806L
+#    error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_logical_traits
+#    error "__cpp_lib_logical_traits should be defined in c++26"
+#  endif
+#  if __cpp_lib_logical_traits != 201510L
+#    error "__cpp_lib_logical_traits should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_from_tuple
+#    error "__cpp_lib_make_from_tuple should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_from_tuple != 201606L
+#    error "__cpp_lib_make_from_tuple should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_reverse_iterator
+#    error "__cpp_lib_make_reverse_iterator should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_reverse_iterator != 201402L
+#    error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_make_unique
+#    error "__cpp_lib_make_unique should be defined in c++26"
+#  endif
+#  if __cpp_lib_make_unique != 201304L
+#    error "__cpp_lib_make_unique should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_map_try_emplace
+#    error "__cpp_lib_map_try_emplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_map_try_emplace != 201411L
+#    error "__cpp_lib_map_try_emplace should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_math_constants
+#    error "__cpp_lib_math_constants should be defined in c++26"
+#  endif
+#  if __cpp_lib_math_constants != 201907L
+#    error "__cpp_lib_math_constants should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should be defined in c++26"
+#    endif
+#    if __cpp_lib_math_special_functions != 201603L
+#      error "__cpp_lib_math_special_functions should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_math_special_functions
+#      error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_mdspan
+#    error "__cpp_lib_mdspan should be defined in c++26"
+#  endif
+#  if __cpp_lib_mdspan != 202406L
+#    error "__cpp_lib_mdspan should have the value 202406L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should be defined in c++26"
+#    endif
+#    if __cpp_lib_memory_resource != 201603L
+#      error "__cpp_lib_memory_resource should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_memory_resource
+#      error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_modules
+#    error "__cpp_lib_modules should be defined in c++26"
+#  endif
+#  if __cpp_lib_modules != 202207L
+#    error "__cpp_lib_modules should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_move_iterator_concept
+#    error "__cpp_lib_move_iterator_concept should be defined in c++26"
+#  endif
+#  if __cpp_lib_move_iterator_concept != 202207L
+#    error "__cpp_lib_move_iterator_concept should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should be defined in c++26"
+#    endif
+#    if __cpp_lib_move_only_function != 202110L
+#      error "__cpp_lib_move_only_function should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_move_only_function
+#      error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_node_extract
+#    error "__cpp_lib_node_extract should be defined in c++26"
+#  endif
+#  if __cpp_lib_node_extract != 201606L
+#    error "__cpp_lib_node_extract should have the value 201606L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should be defined in c++26"
+#  endif
+#  if __cpp_lib_nonmember_container_access != 201411L
+#    error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_not_fn
+#    error "__cpp_lib_not_fn should be defined in c++26"
+#  endif
+#  if __cpp_lib_not_fn != 202306L
+#    error "__cpp_lib_not_fn should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_null_iterators
+#    error "__cpp_lib_null_iterators should be defined in c++26"
+#  endif
+#  if __cpp_lib_null_iterators != 201304L
+#    error "__cpp_lib_null_iterators should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_optional
+#    error "__cpp_lib_optional should be defined in c++26"
+#  endif
+#  if __cpp_lib_optional != 202110L
+#    error "__cpp_lib_optional should have the value 202110L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_optional_range_support
+#      error "__cpp_lib_optional_range_support should be defined in c++26"
+#    endif
+#    if __cpp_lib_optional_range_support != 202406L
+#      error "__cpp_lib_optional_range_support should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_optional_range_support
+#      error "__cpp_lib_optional_range_support should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_out_ptr
+#    error "__cpp_lib_out_ptr should be defined in c++26"
+#  endif
+#  if __cpp_lib_out_ptr != 202311L
+#    error "__cpp_lib_out_ptr should have the value 202311L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_philox_engine
+#      error "__cpp_lib_philox_engine should be defined in c++26"
+#    endif
+#    if __cpp_lib_philox_engine != 202406L
+#      error "__cpp_lib_philox_engine should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_philox_engine
+#      error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+#    ifndef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should be defined in c++26"
+#    endif
+#    if __cpp_lib_polymorphic_allocator != 201902L
+#      error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_polymorphic_allocator
+#      error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+#    ifndef __cpp_lib_print
+#      error "__cpp_lib_print should be defined in c++26"
+#    endif
+#    if __cpp_lib_print != 202207L
+#      error "__cpp_lib_print should have the value 202207L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_print
+#      error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+#    ifndef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should be defined in c++26"
+#    endif
+#    if __cpp_lib_quoted_string_io != 201304L
+#      error "__cpp_lib_quoted_string_io should have the value 201304L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_quoted_string_io
+#      error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_as_const != 202207L
+#      error "__cpp_lib_ranges_as_const should have the value 202207L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_as_const
+#      error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_as_rvalue
+#    error "__cpp_lib_ranges_as_rvalue should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_as_rvalue != 202207L
+#    error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_chunk != 202202L
+#      error "__cpp_lib_ranges_chunk should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_chunk
+#      error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_chunk_by
+#    error "__cpp_lib_ranges_chunk_by should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_chunk_by != 202202L
+#    error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_concat
+#      error "__cpp_lib_ranges_concat should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_concat != 202403L
+#      error "__cpp_lib_ranges_concat should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_concat
+#      error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_iota
+#    error "__cpp_lib_ranges_iota should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_iota != 202202L
+#    error "__cpp_lib_ranges_iota should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_join_with != 202202L
+#      error "__cpp_lib_ranges_join_with should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_join_with
+#      error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_repeat
+#    error "__cpp_lib_ranges_repeat should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_repeat != 202207L
+#    error "__cpp_lib_ranges_repeat should have the value 202207L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_slide != 202202L
+#      error "__cpp_lib_ranges_slide should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_slide
+#      error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_to_container
+#    error "__cpp_lib_ranges_to_container should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_to_container != 202202L
+#    error "__cpp_lib_ranges_to_container should have the value 202202L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should be defined in c++26"
+#    endif
+#    if __cpp_lib_ranges_zip != 202110L
+#      error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_ranges_zip
+#      error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ratio
+#    error "__cpp_lib_ratio should be defined in c++26"
+#  endif
+#  if __cpp_lib_ratio != 202306L
+#    error "__cpp_lib_ratio should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_raw_memory_algorithms
+#    error "__cpp_lib_raw_memory_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_raw_memory_algorithms != 201606L
+#    error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_rcu
+#      error "__cpp_lib_rcu should be defined in c++26"
+#    endif
+#    if __cpp_lib_rcu != 202306L
+#      error "__cpp_lib_rcu should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_rcu
+#      error "__cpp_lib_rcu should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should be defined in c++26"
+#    endif
+#    if __cpp_lib_reference_from_temporary != 202202L
+#      error "__cpp_lib_reference_from_temporary should have the value 202202L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_reference_from_temporary
+#      error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_reference_wrapper
+#    error "__cpp_lib_reference_wrapper should be defined in c++26"
+#  endif
+#  if __cpp_lib_reference_wrapper != 202403L
+#    error "__cpp_lib_reference_wrapper should have the value 202403L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_remove_cvref
+#    error "__cpp_lib_remove_cvref should be defined in c++26"
+#  endif
+#  if __cpp_lib_remove_cvref != 201711L
+#    error "__cpp_lib_remove_cvref should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_result_of_sfinae
+#    error "__cpp_lib_result_of_sfinae should be defined in c++26"
+#  endif
+#  if __cpp_lib_result_of_sfinae != 201210L
+#    error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++26"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_saturation_arithmetic
+#    error "__cpp_lib_saturation_arithmetic should be defined in c++26"
+#  endif
+#  if __cpp_lib_saturation_arithmetic != 202311L
+#    error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should be defined in c++26"
+#    endif
+#    if __cpp_lib_scoped_lock != 201703L
+#      error "__cpp_lib_scoped_lock should have the value 201703L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_scoped_lock
+#      error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)
+#    ifndef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should be defined in c++26"
+#    endif
+#    if __cpp_lib_semaphore != 201907L
+#      error "__cpp_lib_semaphore should have the value 201907L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_semaphore
+#      error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_senders
+#      error "__cpp_lib_senders should be defined in c++26"
+#    endif
+#    if __cpp_lib_senders != 202406L
+#      error "__cpp_lib_senders should have the value 202406L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_senders
+#      error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should be defined in c++26"
+#    endif
+#    if __cpp_lib_shared_mutex != 201505L
+#      error "__cpp_lib_shared_mutex should have the value 201505L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_mutex
+#      error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_arrays
+#    error "__cpp_lib_shared_ptr_arrays should be defined in c++26"
+#  endif
+#  if __cpp_lib_shared_ptr_arrays != 201707L
+#    error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_shared_ptr_weak_type
+#    error "__cpp_lib_shared_ptr_weak_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_shared_ptr_weak_type != 201606L
+#    error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+#    ifndef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should be defined in c++26"
+#    endif
+#    if __cpp_lib_shared_timed_mutex != 201402L
+#      error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_shared_timed_mutex
+#      error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++26"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_smart_ptr_for_overwrite
+#    error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
+#  endif
+#  if __cpp_lib_smart_ptr_for_overwrite != 202002L
+#    error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_smart_ptr_owner_equality
+#      error "__cpp_lib_smart_ptr_owner_equality should be defined in c++26"
+#    endif
+#    if __cpp_lib_smart_ptr_owner_equality != 202306L
+#      error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_smart_ptr_owner_equality
+#      error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_source_location
+#    error "__cpp_lib_source_location should be defined in c++26"
+#  endif
+#  if __cpp_lib_source_location != 201907L
+#    error "__cpp_lib_source_location should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_span
+#    error "__cpp_lib_span should be defined in c++26"
+#  endif
+#  if __cpp_lib_span != 202002L
+#    error "__cpp_lib_span should have the value 202002L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_span_at
+#    error "__cpp_lib_span_at should be defined in c++26"
+#  endif
+#  if __cpp_lib_span_at != 202311L
+#    error "__cpp_lib_span_at should have the value 202311L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_span_initializer_list
+#    error "__cpp_lib_span_initializer_list should be defined in c++26"
+#  endif
+#  if __cpp_lib_span_initializer_list != 202311L
+#    error "__cpp_lib_span_initializer_list should have the value 202311L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_spanstream
+#      error "__cpp_lib_spanstream should be defined in c++26"
+#    endif
+#    if __cpp_lib_spanstream != 202106L
+#      error "__cpp_lib_spanstream should have the value 202106L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_spanstream
+#      error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ssize
+#    error "__cpp_lib_ssize should be defined in c++26"
+#  endif
+#  if __cpp_lib_ssize != 201902L
+#    error "__cpp_lib_ssize should have the value 201902L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_sstream_from_string_view
+#    error "__cpp_lib_sstream_from_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_sstream_from_string_view != 202306L
+#    error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_stacktrace
+#      error "__cpp_lib_stacktrace should be defined in c++26"
+#    endif
+#    if __cpp_lib_stacktrace != 202011L
+#      error "__cpp_lib_stacktrace should have the value 202011L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_stacktrace
+#      error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_starts_ends_with
+#    error "__cpp_lib_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_starts_ends_with != 201711L
+#    error "__cpp_lib_starts_ends_with should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_stdatomic_h
+#    error "__cpp_lib_stdatomic_h should be defined in c++26"
+#  endif
+#  if __cpp_lib_stdatomic_h != 202011L
+#    error "__cpp_lib_stdatomic_h should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_contains
+#    error "__cpp_lib_string_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_contains != 202011L
+#    error "__cpp_lib_string_contains should have the value 202011L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_resize_and_overwrite
+#    error "__cpp_lib_string_resize_and_overwrite should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_resize_and_overwrite != 202110L
+#    error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_udls
+#    error "__cpp_lib_string_udls should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_udls != 201304L
+#    error "__cpp_lib_string_udls should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_string_view
+#    error "__cpp_lib_string_view should be defined in c++26"
+#  endif
+#  if __cpp_lib_string_view != 202403L
+#    error "__cpp_lib_string_view should have the value 202403L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_submdspan
+#      error "__cpp_lib_submdspan should be defined in c++26"
+#    endif
+#    if __cpp_lib_submdspan != 202306L
+#      error "__cpp_lib_submdspan should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_submdspan
+#      error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+#    ifndef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should be defined in c++26"
+#    endif
+#    if __cpp_lib_syncbuf != 201803L
+#      error "__cpp_lib_syncbuf should have the value 201803L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_syncbuf
+#      error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_text_encoding
+#      error "__cpp_lib_text_encoding should be defined in c++26"
+#    endif
+#    if __cpp_lib_text_encoding != 202306L
+#      error "__cpp_lib_text_encoding should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_text_encoding
+#      error "__cpp_lib_text_encoding should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_three_way_comparison
+#    error "__cpp_lib_three_way_comparison should be defined in c++26"
+#  endif
+#  if __cpp_lib_three_way_comparison != 201907L
+#    error "__cpp_lib_three_way_comparison should have the value 201907L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_address
+#    error "__cpp_lib_to_address should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_address != 201711L
+#    error "__cpp_lib_to_address should have the value 201711L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_array != 201907L
+#    error "__cpp_lib_to_array should have the value 201907L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should be defined in c++26"
+#    endif
+#    if __cpp_lib_to_chars != 202306L
+#      error "__cpp_lib_to_chars should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_chars
+#      error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_to_string
+#      error "__cpp_lib_to_string should be defined in c++26"
+#    endif
+#    if __cpp_lib_to_string != 202306L
+#      error "__cpp_lib_to_string should have the value 202306L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_to_string
+#      error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_to_underlying
+#    error "__cpp_lib_to_underlying should be defined in c++26"
+#  endif
+#  if __cpp_lib_to_underlying != 202102L
+#    error "__cpp_lib_to_underlying should have the value 202102L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_transformation_trait_aliases
+#    error "__cpp_lib_transformation_trait_aliases should be defined in c++26"
+#  endif
+#  if __cpp_lib_transformation_trait_aliases != 201304L
+#    error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_transparent_operators
+#    error "__cpp_lib_transparent_operators should be defined in c++26"
+#  endif
+#  if __cpp_lib_transparent_operators != 201510L
+#    error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_tuple_element_t
+#    error "__cpp_lib_tuple_element_t should be defined in c++26"
+#  endif
+#  if __cpp_lib_tuple_element_t != 201402L
+#    error "__cpp_lib_tuple_element_t should have the value 201402L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should be defined in c++26"
+#    endif
+#    if __cpp_lib_tuple_like != 202311L
+#      error "__cpp_lib_tuple_like should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_tuple_like
+#      error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_tuples_by_type
+#    error "__cpp_lib_tuples_by_type should be defined in c++26"
+#  endif
+#  if __cpp_lib_tuples_by_type != 201304L
+#    error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_type_identity
+#    error "__cpp_lib_type_identity should be defined in c++26"
+#  endif
+#  if __cpp_lib_type_identity != 201806L
+#    error "__cpp_lib_type_identity should have the value 201806L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_type_trait_variable_templates
+#    error "__cpp_lib_type_trait_variable_templates should be defined in c++26"
+#  endif
+#  if __cpp_lib_type_trait_variable_templates != 201510L
+#    error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_uncaught_exceptions
+#    error "__cpp_lib_uncaught_exceptions should be defined in c++26"
+#  endif
+#  if __cpp_lib_uncaught_exceptions != 201411L
+#    error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_unordered_map_try_emplace
+#    error "__cpp_lib_unordered_map_try_emplace should be defined in c++26"
+#  endif
+#  if __cpp_lib_unordered_map_try_emplace != 201411L
+#    error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_unreachable
+#    error "__cpp_lib_unreachable should be defined in c++26"
+#  endif
+#  if __cpp_lib_unreachable != 202202L
+#    error "__cpp_lib_unreachable should have the value 202202L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_unwrap_ref
+#    error "__cpp_lib_unwrap_ref should be defined in c++26"
+#  endif
+#  if __cpp_lib_unwrap_ref != 201811L
+#    error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_variant
+#    error "__cpp_lib_variant should be defined in c++26"
+#  endif
+#  if __cpp_lib_variant != 202306L
+#    error "__cpp_lib_variant should have the value 202306L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_void_t
+#    error "__cpp_lib_void_t should be defined in c++26"
+#  endif
+#  if __cpp_lib_void_t != 201411L
+#    error "__cpp_lib_void_t should have the value 201411L in c++26"
+#  endif
 
 #endif // TEST_STD_VER > 23
 
+// clang-format on
+
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index f16841eed9e96..baca05f5e0772 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -1690,45 +1690,45 @@ def produce_version_header():
 
 test_types = {
     "undefined": """
-# ifdef {name}
-#   error "{name} should not be defined before {std_first}"
-# endif
+#  ifdef {name}
+#    error "{name} should not be defined before {std_first}"
+#  endif
 """,
     "test_suite_guard": """
-# if {test_suite_guard}
-#   ifndef {name}
-#     error "{name} should be defined in {std}"
-#   endif
-#   if {name} != {value}
-#     error "{name} should have the value {value} in {std}"
-#   endif
-# else
-#   ifdef {name}
-#     error "{name} should not be defined when the requirement '{test_suite_guard}' is not met!"
-#   endif
-# endif
+#  if {test_suite_guard}
+#    ifndef {name}
+#      error "{name} should be defined in {std}"
+#    endif
+#    if {name} != {value}
+#      error "{name} should have the value {value} in {std}"
+#    endif
+#  else
+#    ifdef {name}
+#      error "{name} should not be defined when the requirement '{test_suite_guard}' is not met!"
+#    endif
+#  endif
 """,
     "unimplemented": """
-# if !defined(_LIBCPP_VERSION)
-#   ifndef {name}
-#     error "{name} should be defined in {std}"
-#   endif
-#   if {name} != {value}
-#     error "{name} should have the value {value} in {std}"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef {name}
-#     error "{name} should not be defined because it is unimplemented in libc++!"
-#   endif
-# endif
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef {name}
+#      error "{name} should be defined in {std}"
+#    endif
+#    if {name} != {value}
+#      error "{name} should have the value {value} in {std}"
+#    endif
+#  else
+#    ifdef {name}
+#      error "{name} should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
 """,
     "defined": """
-# ifndef {name}
-#   error "{name} should be defined in {std}"
-# endif
-# if {name} != {value}
-#   error "{name} should have the value {value} in {std}"
-# endif
+#  ifndef {name}
+#    error "{name} should be defined in {std}"
+#  endif
+#  if {name} != {value}
+#    error "{name} should have the value {value} in {std}"
+#  endif
 """,
 }
 
@@ -1828,28 +1828,27 @@ def produce_tests():
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
+
 // WARNING: This test was generated by {script_name}
 // and should not be edited manually.
-//
-// clang-format off
 {markup}
 // <{header}>
 
 // Test the feature test macros defined by <{header}>
 
-{synopsis}
+// clang-format off
 
 #include <{header}>
 #include "test_macros.h"
 
 {cxx_tests}
 
+// clang-format on
+
 """.format(
             script_name=script_name,
             header=h,
             markup=("\n{}\n".format(markup) if markup else ""),
-            synopsis=generate_synopsis(test_list),
             cxx_tests=generate_std_tests(test_list),
         )
         test_name = "{header}.version.compile.pass.cpp".format(header=h)

>From 98c7e107adafe9a1248866614f27063b6bc38470 Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Fri, 11 Apr 2025 19:59:50 +0200
Subject: [PATCH 76/76] [libc++][CI] Pin the XCode version.

This version is the current version, to avoid unplanned automatic
updates in the future pin this version.
---
 .github/workflows/libcxx-build-and-test.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 326c6f288750a..fce20d6d9de05 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -216,7 +216,8 @@ jobs:
       - uses: actions/checkout at 11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
       - uses: maxim-lobanov/setup-xcode at 60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
         with:
-          xcode-version: 'latest'
+          # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
+          xcode-version: '16.3'
       - uses: seanmiddleditch/gha-setup-ninja at 3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
       - name: Build and test
         run: |



More information about the llvm-branch-commits mailing list