[clang] [Clang] Fix clang crash for fopenmp statement(for) inside lambda function (PR #146772)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 09:57:25 PST 2026


github-actions[bot] wrote:

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

* 86692 tests passed
* 1288 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.OpenMP/for_range_loop_codegen.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/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/23/include -nostdsysteminc -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm  /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --allow-unused-prefixes /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp
# 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/23/include -nostdsysteminc -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --allow-unused-prefixes /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp:40:17: error: CHECK-LABEL: expected string not found in input
# | // CHECK-LABEL: define linkonce_odr noundef i64 @_ZNK4ItermiERKS_(
# |                 ^
# | <stdin>:247:83: note: scanning from here
# | define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4IterdeEv(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 comdat align 2 {
# |                                                                                   ^
# | <stdin>:252:5: note: possible intended match here
# |  %Ptr = getelementptr inbounds nuw %struct.Iter, ptr %this1, i32 0, i32 0
# |     ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/OpenMP/for_range_loop_codegen.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           242:  store ptr %add.ptr, ptr %Ptr, align 8 
# |           243:  ret void 
# |           244: } 
# |           245:  
# |           246: ; Function Attrs: mustprogress noinline nounwind optnone 
# |           247: define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4IterdeEv(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 comdat align 2 { 
# | label:40'0                                                                                       X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |           248: entry: 
# | label:40'0     ~~~~~~~
# |           249:  %this.addr = alloca ptr, align 8 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           250:  store ptr %this, ptr %this.addr, align 8 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           251:  %this1 = load ptr, ptr %this.addr, align 8 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           252:  %Ptr = getelementptr inbounds nuw %struct.Iter, ptr %this1, i32 0, i32 0 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | label:40'1         ?                                                                      possible intended match
# |           253:  %0 = load ptr, ptr %Ptr, align 8 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           254:  ret ptr %0 
# | label:40'0     ~~~~~~~~~~~~
# |           255: } 
# | label:40'0     ~~
# |           256:  
# | label:40'0     ~
# |           257: ; Function Attrs: nounwind 
# | label:40'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/146772


More information about the cfe-commits mailing list