[clang] [CIR] Add token.none and fix coro.end signature (PR #214125)

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 4 21:05:02 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 92575 tests passed
* 818 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CIR/CodeGenCoroutines/coro-task.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp:729:1: warning: non-void coroutine does not return a value [-Wreturn-type]
# |   729 | }
# |       | ^
# | 1 warning generated.
# `-----------------------------
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -check-prefix=CIR
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -check-prefix=CIR
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp:218:9: error: CIR: expected string not found in input
# | // CIR: cir.coro.intrinsic.end(%[[CoroEndArg0]], %[[CoroEndArg1]], %[[TK_NONE]]) : (!cir.ptr<!void>, !cir.bool, token)
# |         ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: scanning from here
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "CoroEndArg0" equal to "11"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "CoroEndArg1" equal to "20"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "TK_NONE" equal to "18"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:226:8: note: possible intended match here
# |  %16 = cir.coro.intrinsic.begin(%13, %15) : (token, !cir.ptr<!void>) -> !cir.ptr<!void> loc(#loc54)
# |        ^
# | 
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            210:  %7 = cir.alloca "agg.tmp1" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cint3E3A3Apromise_type3E> loc(#loc56) 
# |            211:  %8 = cir.alloca "ref.tmp1" align(1) : !cir.ptr<!rec_std3A3Asuspend_always> loc(#loc56) 
# |            212:  %9 = cir.alloca "agg.tmp2" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cvoid3E> loc(#loc56) 
# |            213:  %10 = cir.alloca "agg.tmp3" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cint3E3A3Apromise_type3E> loc(#loc56) 
# |            214:  cir.store %arg0, %0 : !cir.ptr<!rec_std3A3Astring>, !cir.ptr<!cir.ptr<!rec_std3A3Astring>> loc(#loc54) 
# |            215:  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54) 
# | check:218'0                                                     {               search range start (exclusive)
# | check:218'1                                                                     error: no match found in search range
# | check:218'2                                                                     with "CoroEndArg0" equal to "11"
# | check:218'3                                                                     with "CoroEndArg1" equal to "20"
# | check:218'4                                                                     with "TK_NONE" equal to "18"
# |            216:  %12 = cir.const #cir.int<16> : !u32i loc(#loc54) 
# |            217:  %13 = cir.coro.intrinsic.id(%12, %11, %11, %11) : (!u32i, !cir.ptr<!void>, !cir.ptr<!void>, !cir.ptr<!void>) -> token loc(#loc54) 
# |            218:  %14 = cir.coro.intrinsic.alloc(%13) : (token) -> !cir.bool loc(#loc54) 
# |            219:  cir.store %11, %2 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc54) 
# |            220:  cir.if %14 { 
# |            221:  %21 = cir.coro.intrinsic.size() : () -> !u64i loc(#loc56) 
# |            222:  %22 = cir.call @_Znwm(%21) {allocsize = array<i32: 0>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.nonnull, llvm.noundef}) loc(#loc56) 
# |            223:  cir.store %22, %2 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc54) 
# |            224:  } loc(#loc54) 
# |            225:  %15 = cir.load %2 : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void> loc(#loc54) 
# |            226:  %16 = cir.coro.intrinsic.begin(%13, %15) : (token, !cir.ptr<!void>) -> !cir.ptr<!void> loc(#loc54) 
# | check:218'5            ?                                                                                              possible intended match
# |            227:  cir.cleanup.scope { 
# |            228:  %21 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_std3A3Astring>>, !cir.ptr<!rec_std3A3Astring> loc(#loc55) 
# |            229:  cir.store align(8) %21, %3 : !cir.ptr<!rec_std3A3Astring>, !cir.ptr<!cir.ptr<!rec_std3A3Astring>> loc(#loc55) 
# |            230:  %22 = cir.call @_ZN5folly4coro4TaskIiE12promise_type17get_return_objectEv(%4) nothrow : (!cir.ptr<!rec_folly3A3Acoro3A3ATask3Cint3E3A3Apromise_type> {llvm.align = 1 : i64, llvm.dereferenceable = 1 : i64, llvm.nonnull, llvm.noundef}) -> !rec_folly3A3Acoro3A3ATask3Cint3E loc(#loc56) 
# |            231:  cir.store align(1) %22, %1 : !rec_folly3A3Acoro3A3ATask3Cint3E, !cir.ptr<!rec_folly3A3Acoro3A3ATask3Cint3E> loc(#loc56) 
# |              .
# |              .
# |              .
# |           1903: #loc342 = loc(fused[#loc232, #loc233]) 
# |           1904: #loc343 = loc(fused[#loc236, #loc237]) 
# |           1905: #loc344 = loc(fused[#loc238, #loc239]) 
# |           1906: #loc345 = loc(fused[#loc240, #loc241]) 
# |           1907: #loc346 = loc(fused[#loc244, #loc245]) 
# |           1908: #loc347 = loc(fused[#loc246, #loc245]) 
# | check:218'6                                            } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.CIR/CodeGenCoroutines/coro-task.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp:729:1: warning: non-void coroutine does not return a value [-Wreturn-type]
# |   729 | }
# |       | ^
# | 1 warning generated.
# `-----------------------------
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -check-prefix=CIR
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp -check-prefix=CIR
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp:218:9: error: CIR: expected string not found in input
# | // CIR: cir.coro.intrinsic.end(%[[CoroEndArg0]], %[[CoroEndArg1]], %[[TK_NONE]]) : (!cir.ptr<!void>, !cir.bool, token)
# |         ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: scanning from here
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "CoroEndArg0" equal to "11"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "CoroEndArg1" equal to "20"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:215:50: note: with "TK_NONE" equal to "18"
# |  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54)
# |                                                  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir:226:8: note: possible intended match here
# |  %16 = cir.coro.intrinsic.begin(%13, %15) : (token, !cir.ptr<!void>) -> !cir.ptr<!void> loc(#loc54)
# |        ^
# | 
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGenCoroutines/Output/coro-task.cpp.tmp.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenCoroutines/coro-task.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            210:  %7 = cir.alloca "agg.tmp1" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cint3E3A3Apromise_type3E> loc(#loc56) 
# |            211:  %8 = cir.alloca "ref.tmp1" align(1) : !cir.ptr<!rec_std3A3Asuspend_always> loc(#loc56) 
# |            212:  %9 = cir.alloca "agg.tmp2" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cvoid3E> loc(#loc56) 
# |            213:  %10 = cir.alloca "agg.tmp3" align(1) : !cir.ptr<!rec_std3A3Acoroutine_handle3Cfolly3A3Acoro3A3ATask3Cint3E3A3Apromise_type3E> loc(#loc56) 
# |            214:  cir.store %arg0, %0 : !cir.ptr<!rec_std3A3Astring>, !cir.ptr<!cir.ptr<!rec_std3A3Astring>> loc(#loc54) 
# |            215:  %11 = cir.const #cir.ptr<null> : !cir.ptr<!void> loc(#loc54) 
# | check:218'0                                                     {               search range start (exclusive)
# | check:218'1                                                                     error: no match found in search range
# | check:218'2                                                                     with "CoroEndArg0" equal to "11"
# | check:218'3                                                                     with "CoroEndArg1" equal to "20"
# | check:218'4                                                                     with "TK_NONE" equal to "18"
# |            216:  %12 = cir.const #cir.int<16> : !u32i loc(#loc54) 
# |            217:  %13 = cir.coro.intrinsic.id(%12, %11, %11, %11) : (!u32i, !cir.ptr<!void>, !cir.ptr<!void>, !cir.ptr<!void>) -> token loc(#loc54) 
# |            218:  %14 = cir.coro.intrinsic.alloc(%13) : (token) -> !cir.bool loc(#loc54) 
# |            219:  cir.store %11, %2 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc54) 
# |            220:  cir.if %14 { 
# |            221:  %21 = cir.coro.intrinsic.size() : () -> !u64i loc(#loc56) 
# |            222:  %22 = cir.call @_Znwm(%21) {allocsize = array<i32: 0>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.nonnull, llvm.noundef}) loc(#loc56) 
# |            223:  cir.store %22, %2 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc54) 
# |            224:  } loc(#loc54) 
# |            225:  %15 = cir.load %2 : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void> loc(#loc54) 
# |            226:  %16 = cir.coro.intrinsic.begin(%13, %15) : (token, !cir.ptr<!void>) -> !cir.ptr<!void> loc(#loc54) 
# | check:218'5            ?                                                                                              possible intended match
# |            227:  cir.cleanup.scope { 
# |            228:  %21 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_std3A3Astring>>, !cir.ptr<!rec_std3A3Astring> loc(#loc55) 
# |            229:  cir.store align(8) %21, %3 : !cir.ptr<!rec_std3A3Astring>, !cir.ptr<!cir.ptr<!rec_std3A3Astring>> loc(#loc55) 
# |            230:  %22 = cir.call @_ZN5folly4coro4TaskIiE12promise_type17get_return_objectEv(%4) nothrow : (!cir.ptr<!rec_folly3A3Acoro3A3ATask3Cint3E3A3Apromise_type> {llvm.align = 1 : i64, llvm.dereferenceable = 1 : i64, llvm.nonnull, llvm.noundef}) -> !rec_folly3A3Acoro3A3ATask3Cint3E loc(#loc56) 
# |            231:  cir.store align(1) %22, %1 : !rec_folly3A3Acoro3A3ATask3Cint3E, !cir.ptr<!rec_folly3A3Acoro3A3ATask3Cint3E> loc(#loc56) 
# |              .
# |              .
# |              .
# |           1903: #loc342 = loc(fused[#loc232, #loc233]) 
# |           1904: #loc343 = loc(fused[#loc236, #loc237]) 
# |           1905: #loc344 = loc(fused[#loc238, #loc239]) 
# |           1906: #loc345 = loc(fused[#loc240, #loc241]) 
# |           1907: #loc346 = loc(fused[#loc244, #loc245]) 
# |           1908: #loc347 = loc(fused[#loc246, #loc245]) 
# | check:218'6                                            } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list