[clang] [Clang] No longer advertise support for coroutines on x86 windows. (PR #193456)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 03:26:29 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-coroutines

Author: Corentin Jabot (cor3ntin)

<details>
<summary>Changes</summary>

There are a large number of long standing issues with coroutines on x86_32 windows as discussed here

https://github.com/llvm/llvm-project/issues/59382

- #<!-- -->59382
- #<!-- -->58556
- #<!-- -->58543
- #<!-- -->56989
- #<!-- -->193161
- #<!-- -->136481

As such this patches
  - No longer defines `__cpp_impl_coroutine` on that platform
  - Warn when using coroutines on that platform

The reason to not plainly error is that it would break too much valid valid code, ie there are people who probably use coroutines sucessfully.

And we also want to keep testing on that platform, up until the point we were to pull support completely.

Hopefully this is all temporary and someone will feel compelled to improve the situation enough that we can unceremoniously revert this patch.

---

Patch is 27.75 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/193456.diff


39 Files Affected:

- (modified) clang/docs/ReleaseNotes.rst (+4-1) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+4) 
- (modified) clang/lib/Frontend/InitPreprocessor.cpp (+9-3) 
- (modified) clang/lib/Sema/SemaCoroutine.cpp (+8) 
- (modified) clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-co_await-assertion-failure.cpp (+1-1) 
- (modified) clang/test/Analysis/more-dtors-cfg-output.cpp (+2-2) 
- (modified) clang/test/CodeGenCXX/ubsan-coroutines.cpp (+1-1) 
- (modified) clang/test/CodeGenCoroutines/coro-params.cpp (+1-1) 
- (modified) clang/test/CodeGenCoroutines/coro-promise-dtor.cpp (+1-1) 
- (modified) clang/test/Lexer/cxx-features.cpp (+12-2) 
- (modified) clang/test/Modules/coro-await-elidable.cppm (+2-2) 
- (modified) clang/test/PCH/coroutines.cpp (+3-3) 
- (modified) clang/test/Parser/cxx20-coroutines.cpp (+1-1) 
- (modified) clang/test/SemaCXX/addr-label-in-coroutines.cpp (+1-1) 
- (modified) clang/test/SemaCXX/co_await-ast.cpp (+2-2) 
- (modified) clang/test/SemaCXX/coroutine-alloc-2.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-alloc-3.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-alloc-4.cpp (+2-2) 
- (modified) clang/test/SemaCXX/coroutine-allocs.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-builtins.cpp (+2-2) 
- (modified) clang/test/SemaCXX/coroutine-dealloc.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-no-valid-dealloc.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-noreturn.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-promise-ctor.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-rvo.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-traits-undefined-template.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-unevaluate.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutine-vla.cpp (+1-1) 
- (added) clang/test/SemaCXX/coroutine-win32x86.cpp (+35) 
- (modified) clang/test/SemaCXX/coroutine_handle-address-return-type.cpp (+1-1) 
- (modified) clang/test/SemaCXX/coroutines.cpp (+2-2) 
- (modified) clang/test/SemaCXX/cxx20-delayed-typo-correction-crashes.cpp (+1-1) 
- (modified) clang/test/SemaCXX/cxx2b-deducing-this-coro.cpp (+1-1) 
- (modified) clang/test/SemaCXX/thread-safety-coro.cpp (+1-1) 
- (modified) clang/test/SemaCXX/warn-throw-out-noexcept-coro.cpp (+1-1) 
- (modified) clang/test/SemaCXX/warn-unsequenced-coro.cpp (+1-1) 
- (modified) clang/test/SemaCXX/warn-unused-parameters-coroutine.cpp (+1-1) 
- (modified) clang/www/cxx_status.html (+3-2) 


``````````diff
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index b25bc08b033d2..2209299cef6b3 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -86,7 +86,10 @@ Clang Frontend Potentially Breaking Changes
   libraries will need to be recompiled, or used with
   (`--no-offload-new-driver`). This option will be removed in the next release.
 
-
+- Clang no longer defines the ``__cpp_impl_coroutine`` feature test macro under the 32 bits x86 Microsoft ABI,
+  as support for coroutines on this target is incomplete.
+  When using coroutines on this target a warning is emmitted to indicate the lack of full support.
+  That warning can be disabled with ``-Wno-coroutines-unsupported-target``.
 
 Clang Python Bindings Potentially Breaking Changes
 --------------------------------------------------
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 3ab8dd412a7ad..f8dfdb2d76aaa 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -12881,6 +12881,10 @@ def note_redefinition_include_same_file : Note<
 }
 
 let CategoryName = "Coroutines Issue" in {
+def warn_coroutines_x86_windows : Warning<
+  "coroutines support when targeting the 32 bits x86 Microsoft ABI"
+  " is experimental and incomplete">,
+  InGroup<DiagGroup<"coroutines-unsupported-target">>;
 def err_return_in_coroutine : Error<
   "return statement not allowed in coroutine; did you mean 'co_return'?">;
 def note_declared_coroutine_here : Note<
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 1ccd74314f373..1c3fa27f765ef 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -621,7 +621,8 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
 /// Initialize the predefined C++ language feature test macros defined in
 /// ISO/IEC JTC1/SC22/WG21 (C++) SD-6: "SG10 Feature Test Recommendations".
 static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
-                                                 MacroBuilder &Builder) {
+                                                 MacroBuilder &Builder,
+                                                 const TargetInfo &TI) {
   // C++98 features.
   if (LangOpts.RTTI)
     Builder.defineMacro("__cpp_rtti", "199711L");
@@ -714,7 +715,12 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
     Builder.defineMacro("__cpp_consteval", "202211L");
     Builder.defineMacro("__cpp_constexpr_dynamic_alloc", "201907L");
     Builder.defineMacro("__cpp_constinit", "201907L");
-    Builder.defineMacro("__cpp_impl_coroutine", "201902L");
+
+    // Support for coroutines on 32 bits x86 Microsoft platforms is
+    // incomplete, do not advertise it.
+    if (!(TI.getCXXABI().isMicrosoft() && TI.getTriple().isX86_32()))
+      Builder.defineMacro("__cpp_impl_coroutine", "201902L");
+
     Builder.defineMacro("__cpp_designated_initializers", "201707L");
     Builder.defineMacro("__cpp_impl_three_way_comparison", "201907L");
     // Intentionally to set __cpp_modules to 1.
@@ -980,7 +986,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
                       Twine(TI.useSignedCharForObjCBool() ? "0" : "1"));
 
   if (LangOpts.CPlusPlus)
-    InitializeCPlusPlusFeatureTestMacros(LangOpts, Builder);
+    InitializeCPlusPlusFeatureTestMacros(LangOpts, Builder, TI);
 
   // darwin_constant_cfstrings controls this. This is also dependent
   // on other things like the runtime I believe.  This is set even for C code.
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index 07bb6e2161cc7..7f9b1d642cf9d 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -21,6 +21,7 @@
 #include "clang/AST/IgnoreExpr.h"
 #include "clang/AST/StmtCXX.h"
 #include "clang/Basic/Builtins.h"
+#include "clang/Basic/TargetInfo.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Sema/EnterExpressionEvaluationContext.h"
 #include "clang/Sema/Initialization.h"
@@ -693,6 +694,13 @@ bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc,
 
   if (!checkCoroutineContext(*this, KWLoc, Keyword))
     return false;
+
+  // Support for coroutines is not stable on 32 bits windows
+  // Warn about it.
+  if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
+      Context.getTargetInfo().getTriple().isX86_32())
+    Diag(KWLoc, diag::warn_coroutines_x86_windows);
+
   auto *ScopeInfo = getCurFunction();
   assert(ScopeInfo->CoroutinePromise);
 
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-co_await-assertion-failure.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-co_await-assertion-failure.cpp
index a67f45700cd10..0fd9759e925e6 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-co_await-assertion-failure.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-co_await-assertion-failure.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.UncountedLambdaCapturesChecker -std=c++20 -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.UncountedLambdaCapturesChecker -std=c++20 -verify %s -Wno-coroutines-unsupported-target
 // expected-no-diagnostics
 
 template<typename Arg>
diff --git a/clang/test/Analysis/more-dtors-cfg-output.cpp b/clang/test/Analysis/more-dtors-cfg-output.cpp
index 044e0b7d6dcfd..1759e9d598d94 100644
--- a/clang/test/Analysis/more-dtors-cfg-output.cpp
+++ b/clang/test/Analysis/more-dtors-cfg-output.cpp
@@ -1,6 +1,6 @@
 // RUN: rm -f %t.14 %t.2a
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++14 -DCXX2A=0 -fblocks -Wall -Wno-unused -Werror %s > %t.14 2>&1
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++2a -DCXX2A=1 -fblocks -Wall -Wno-unused -Werror %s > %t.2a 2>&1
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++14 -DCXX2A=0 -fblocks -Wall -Wno-unused -Werror -Wno-coroutines-unsupported-target %s > %t.14 2>&1
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++2a -DCXX2A=1 -fblocks -Wall -Wno-unused -Werror -Wno-coroutines-unsupported-target %s > %t.2a 2>&1
 // RUN: FileCheck --input-file=%t.14 -check-prefixes=CHECK,CXX14 -implicit-check-not=destructor %s
 // RUN: FileCheck --input-file=%t.2a -check-prefixes=CHECK,CXX2A -implicit-check-not=destructor %s
 
diff --git a/clang/test/CodeGenCXX/ubsan-coroutines.cpp b/clang/test/CodeGenCXX/ubsan-coroutines.cpp
index 60c89a47f9046..85fc6ceb523d3 100644
--- a/clang/test/CodeGenCXX/ubsan-coroutines.cpp
+++ b/clang/test/CodeGenCXX/ubsan-coroutines.cpp
@@ -1,6 +1,6 @@
 // This test merely verifies that emitting the object file does not cause a
 // crash when the LLVM coroutines passes are run.
-// RUN: %clang_cc1 -emit-obj -std=c++2a -fsanitize=null %s -o %t.o
+// RUN: %clang_cc1 -emit-obj -std=c++2a -fsanitize=null -Wno-coroutines-unsupported-target %s -o %t.o
 // UNSUPPORTED: target={{.*}}-zos{{.*}}
 
 namespace std {
diff --git a/clang/test/CodeGenCoroutines/coro-params.cpp b/clang/test/CodeGenCoroutines/coro-params.cpp
index 79e77a21017fa..173f63fb394e5 100644
--- a/clang/test/CodeGenCoroutines/coro-params.cpp
+++ b/clang/test/CodeGenCoroutines/coro-params.cpp
@@ -3,7 +3,7 @@
 // Vefifies that parameter copies are used in the body of the coroutine
 // Verifies that parameter copies are used to construct the promise type, if that type has a matching constructor
 // RUN: %clang_cc1 -std=c++20 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -disable-llvm-passes -fexceptions | FileCheck %s
-// RUN: %clang_cc1 -std=c++20 -triple=x86_64-pc-win32          -emit-llvm -o - %s -disable-llvm-passes -fexceptions | FileCheck %s --check-prefix=MSABI
+// RUN: %clang_cc1 -std=c++20 -triple=x86_64-pc-win32          -emit-llvm -o - %s -disable-llvm-passes -fexceptions -Wno-coroutines-unsupported-target | FileCheck %s --check-prefix=MSABI
 
 namespace std {
 template <typename... T> struct coroutine_traits;
diff --git a/clang/test/CodeGenCoroutines/coro-promise-dtor.cpp b/clang/test/CodeGenCoroutines/coro-promise-dtor.cpp
index afaaf876a8103..902ed7d315edf 100644
--- a/clang/test/CodeGenCoroutines/coro-promise-dtor.cpp
+++ b/clang/test/CodeGenCoroutines/coro-promise-dtor.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++20 -triple=x86_64-pc-windows-msvc18.0.0 -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s
+// RUN: %clang_cc1 -std=c++20 -triple=x86_64-pc-windows-msvc18.0.0 -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes -Wno-coroutines-unsupported-target | FileCheck %s
 // -triple=x86_64-unknown-linux-gnu
 
 #include "Inputs/coroutine.h"
diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp
index 8eb9ea032879c..171ef99cee5b7 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -6,6 +6,11 @@
 // RUN: %clang_cc1 -std=c++23 -fcxx-exceptions -verify %s
 // RUN: %clang_cc1 -std=c++2c -fcxx-exceptions -verify %s
 
+// RUN: %clang_cc1 -std=c++20 -fcxx-exceptions -verify -triple i686-unknown-windows-msvc -DX86_MSVC_TARGET %s
+// RUN: %clang_cc1 -std=c++23 -fcxx-exceptions -verify -triple i686-unknown-windows-msvc -DX86_MSVC_TARGET %s
+// RUN: %clang_cc1 -std=c++2c -fcxx-exceptions -verify -triple i686-unknown-windows-msvc -DX86_MSVC_TARGET %s
+
+
 //
 // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -DCONCEPTS_TS=1 -verify %s
 // RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS
@@ -142,8 +147,13 @@
 #error "wrong value for __cpp_impl_three_way_comparison"
 #endif
 
-#if check(impl_coroutine, 0, 0, 0, 0, 201902L, 201902L, 201902L)
-#error "wrong value for __cpp_impl_coroutine"
+
+#if X86_MSVC_TARGET
+#   if check(impl_coroutine, 0, 0, 0, 0, 0, 0, 0)
+#       error "wrong value for __cpp_impl_coroutine"
+#   endif
+#elif !(__i386__ && _WIN32) &&  check(impl_coroutine, 0, 0, 0, 0, 201902, 201902, 201902)
+#   error "wrong value for __cpp_impl_coroutine" __cpp_impl_coroutine
 #endif
 
 // init_captures checked below
diff --git a/clang/test/Modules/coro-await-elidable.cppm b/clang/test/Modules/coro-await-elidable.cppm
index 2d635c6efa88b..e7bb97afb71d3 100644
--- a/clang/test/Modules/coro-await-elidable.cppm
+++ b/clang/test/Modules/coro-await-elidable.cppm
@@ -1,8 +1,8 @@
 // RUN: rm -rf %t
 // RUN: split-file %s %t
 
-// RUN: %clang_cc1 -std=c++20 %t/task.cppm -I%t -emit-reduced-module-interface -o %t/task.pcm
-// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/user.cpp -verify -fsyntax-only
+// RUN: %clang_cc1 -std=c++20 %t/task.cppm -I%t -emit-reduced-module-interface -o %t/task.pcm -Wno-coroutines-unsupported-target
+// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/user.cpp -verify -fsyntax-only -Wno-coroutines-unsupported-target
 
 //--- coroutine.h
 
diff --git a/clang/test/PCH/coroutines.cpp b/clang/test/PCH/coroutines.cpp
index 55c098bc27a70..5bf77f6c83dd9 100644
--- a/clang/test/PCH/coroutines.cpp
+++ b/clang/test/PCH/coroutines.cpp
@@ -1,9 +1,9 @@
 // Test this without pch.
-// RUN: %clang_cc1 -include %s -verify -std=c++20 %s
+// RUN: %clang_cc1 -include %s -verify -std=c++20 %s -Wno-coroutines-unsupported-target
 
 // Test with pch.
-// RUN: %clang_cc1 -std=c++20  -emit-pch -o %t %s
-// RUN: %clang_cc1 -include-pch %t -verify -std=c++20 %s
+// RUN: %clang_cc1 -std=c++20  -emit-pch -o %t %s -Wno-coroutines-unsupported-target
+// RUN: %clang_cc1 -include-pch %t -verify -std=c++20 %s -Wno-coroutines-unsupported-target
 
 #ifndef HEADER
 #define HEADER
diff --git a/clang/test/Parser/cxx20-coroutines.cpp b/clang/test/Parser/cxx20-coroutines.cpp
index 7207fb98587ab..6e774a5712874 100644
--- a/clang/test/Parser/cxx20-coroutines.cpp
+++ b/clang/test/Parser/cxx20-coroutines.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++20 %s -verify
+// RUN: %clang_cc1 -std=c++20 %s -verify -Wno-coroutines-unsupported-target
 
 template<typename T, typename U>
 U f(T t) {
diff --git a/clang/test/SemaCXX/addr-label-in-coroutines.cpp b/clang/test/SemaCXX/addr-label-in-coroutines.cpp
index 65d78636e5cdd..82ca2afc473f5 100644
--- a/clang/test/SemaCXX/addr-label-in-coroutines.cpp
+++ b/clang/test/SemaCXX/addr-label-in-coroutines.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -Wno-coroutines-unsupported-target %s
 
 #include "Inputs/std-coroutine.h"
 
diff --git a/clang/test/SemaCXX/co_await-ast.cpp b/clang/test/SemaCXX/co_await-ast.cpp
index 5be2004eb1072..90683cd08d482 100644
--- a/clang/test/SemaCXX/co_await-ast.cpp
+++ b/clang/test/SemaCXX/co_await-ast.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++20 -ast-dump -ast-dump-filter=foo %s | FileCheck %s --strict-whitespace
-// RUN: %clang_cc1 -std=c++20 -triple i386-windows-pc -ast-dump -ast-dump-filter=foo %s | FileCheck %s --strict-whitespace
+// RUN: %clang_cc1 -std=c++20 -ast-dump -ast-dump-filter=foo %s -Wno-coroutines-unsupported-target | FileCheck %s --strict-whitespace
+// RUN: %clang_cc1 -std=c++20 -triple i386-windows-pc -ast-dump -ast-dump-filter=foo %s -Wno-coroutines-unsupported-target | FileCheck %s --strict-whitespace
 
 namespace std {
 template <typename, typename...> struct coroutine_traits;
diff --git a/clang/test/SemaCXX/coroutine-alloc-2.cpp b/clang/test/SemaCXX/coroutine-alloc-2.cpp
index bcebadc0a1f53..28b8723a4765e 100644
--- a/clang/test/SemaCXX/coroutine-alloc-2.cpp
+++ b/clang/test/SemaCXX/coroutine-alloc-2.cpp
@@ -1,5 +1,5 @@
 // Tests that we wouldn't generate an allocation call in promise_type with (std::size_t, std::nothrow_t) in case we find promsie_type::get_return_object_on_allocation_failure;
-// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++20 -Wno-coroutines-unsupported-target %s -fsyntax-only -verify
 
 namespace std {
 template <typename... T>
diff --git a/clang/test/SemaCXX/coroutine-alloc-3.cpp b/clang/test/SemaCXX/coroutine-alloc-3.cpp
index 629ac88a3df8e..644548e2fe89f 100644
--- a/clang/test/SemaCXX/coroutine-alloc-3.cpp
+++ b/clang/test/SemaCXX/coroutine-alloc-3.cpp
@@ -1,5 +1,5 @@
 // Tests that we'll emit the proper diagnostic message if we failed to find `::operator new(size_­t, nothrow_­t)`.
-// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++20 -Wno-coroutines-unsupported-target %s -fsyntax-only -verify
 
 namespace std {
 template <typename... T>
diff --git a/clang/test/SemaCXX/coroutine-alloc-4.cpp b/clang/test/SemaCXX/coroutine-alloc-4.cpp
index 262c163fb1789..8cc555431c569 100644
--- a/clang/test/SemaCXX/coroutine-alloc-4.cpp
+++ b/clang/test/SemaCXX/coroutine-alloc-4.cpp
@@ -1,5 +1,5 @@
 // Tests that we'll find aligned allocation function properly.
-// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify -fcoro-aligned-allocation
+// RUN: %clang_cc1 %s -std=c++20 %s -Wno-coroutines-unsupported-target -fsyntax-only -verify -fcoro-aligned-allocation
 
 #include "Inputs/std-coroutine.h"
 
@@ -109,7 +109,7 @@ task6 f5() { // expected-error 1+{{unable to find '::operator new(size_t, align_
     co_return 43;
 }
 
-void *operator new(std::size_t, std::align_val_t, std::nothrow_t) noexcept; 
+void *operator new(std::size_t, std::align_val_t, std::nothrow_t) noexcept;
 
 task6 f6() {
     co_return 43;
diff --git a/clang/test/SemaCXX/coroutine-allocs.cpp b/clang/test/SemaCXX/coroutine-allocs.cpp
index e6b086bd1c720..703c422f985a8 100644
--- a/clang/test/SemaCXX/coroutine-allocs.cpp
+++ b/clang/test/SemaCXX/coroutine-allocs.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++20 -Wno-coroutines-unsupported-target -fsyntax-only -verify
 #include "Inputs/std-coroutine.h"
 
 namespace std {
diff --git a/clang/test/SemaCXX/coroutine-builtins.cpp b/clang/test/SemaCXX/coroutine-builtins.cpp
index f2d0eda37d707..9c31024f33c40 100644
--- a/clang/test/SemaCXX/coroutine-builtins.cpp
+++ b/clang/test/SemaCXX/coroutine-builtins.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -DERRORS %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-coroutines-unsupported-target -std=c++20 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-coroutines-unsupported-target -DERRORS %s
 
 // Check that we don't crash when using __builtin_coro_* without the fcoroutine-ts or -std=c++20 option
 
diff --git a/clang/test/SemaCXX/coroutine-dealloc.cpp b/clang/test/SemaCXX/coroutine-dealloc.cpp
index 762a14465b297..7f8f57d9cd37b 100644
--- a/clang/test/SemaCXX/coroutine-dealloc.cpp
+++ b/clang/test/SemaCXX/coroutine-dealloc.cpp
@@ -1,5 +1,5 @@
 // Tests that the behavior will be good if there are multiple operator delete in the promise_type.
-// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++20 -Wno-coroutines-unsupported-target %s -fsyntax-only -verify
 // expected-no-diagnostics
 
 #include "Inputs/std-coroutine.h"
diff --git a/clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp b/clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp
index 35c00b84ea398..7ec46b3715c09 100644
--- a/clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp
+++ b/clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp
@@ -1,7 +1,7 @@
 // This file contains references to sections of the Coroutines TS, which can be
 // found at http://wg21.link/coroutines.
 
-// RUN: %clang_cc1 -std=c++20 -verify %s -fcxx-exceptions -fexceptions -Wunused-result
+// RUN: %clang_cc1 -std=c++20 -verify %s -fcxx-exceptions -fexceptions -Wunused-result -Wno-coroutines-unsupported-target
 
 namespace std {
 
diff --git a/clang/test/SemaCXX/coroutine-no-valid-dealloc.cpp b/clang/test/SemaCXX/coroutine-no-valid-dealloc.cpp
index a5727d6f003bf..548c3b49e21d2 100644
--- a/clang/test/SemaCXX/coroutine-no-valid-dealloc.cpp
+++ b/clang/test/SemaCXX/coroutine-no-valid-dealloc.cpp
@@ -1,6 +1,6 @@
 // Test that if the compiler will emit error message if the promise_type contain
 // operator delete but none of them are available. This is required by the standard.
-// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify -Wno-coroutines-unsupported-target
 
 #include "Inputs/std-coroutine.h"
 
diff --git a/clang/test/SemaCXX/coroutine-noreturn.cpp b/clang/test/SemaCXX/coroutine-noreturn.cpp
index 4516b4e720ec0..f89ce12966991 100644
--- a/clang/test/SemaCXX/coroutine-noreturn.cpp
+++ b/clang/test/SemaCXX/coroutine-noreturn.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -Winvalid-noreturn -verify
+// RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -Winvalid-noreturn -verify -Wno-coroutines-unsupported-target
 
 #include "Inputs/std-coroutine.h"
 
diff --git a/clang/test/SemaCXX/coroutine-promise-ctor.cpp b/clang/test/SemaCXX/coroutine-promise-ctor.cpp
index 7a06299712cb7..da4ba8675697d 100644
--- a/clang/test/SemaCXX/coroutine-promise-ctor.cpp
+++ b/clang/test/SemaCXX/coroutine-promise-ctor.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++20 -ast-dump %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++20 -Wno-coroutines-unsupported-target -ast-dump %s | FileCheck %s
 #include "Inputs/std-coroutine.h"
 
 // Github issue: https://github.com/llvm/llvm-project/issues/78290
diff --git a/clang/test/SemaCXX/coroutine-rvo.cpp b/clang/test/SemaCXX/coroutine-rvo.cpp
index 6bf1dee67557c..bdbb407c6efed 100644
--- a/clang/test/SemaCXX/coroutine-rvo.cpp
+++ b/clang/test/SemaCXX/coroutine-rvo.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s
+// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only -Wno-coroutines-unsupported-target %s
 
 namespace std {
 template <class Promise = void> struct coroutine_handle {
diff --git a/clang/test/SemaCXX/coroutine-traits-undefined-template.cpp b/clang/test/SemaCXX/coroutine-traits-undefined-template.cpp
index e7de0c80d7343..c07dd6628f25b 100644
--- a/clang/test/SemaCXX/coroutine-traits-undefined-template.cpp
+++ b/clang/test/SemaCXX/coroutine-traits-undefined-template.cpp
@@ -1,7 +1,7 @@
 // This file contains references to sections of the Coroutines TS, which can be
 // found at http://wg21.link/coroutines.
 
-// RUN: %clang_cc1 -std=c++20 -verify %s -fcxx-exceptions -fex...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/193456


More information about the cfe-commits mailing list