<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/141534>141534</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] Incorrect result with Fujitsu test 1054_0035
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          eugeneepshteyn
      </td>
    </tr>
</table>

<pre>
    Test source: https://github.com/fujitsu/compiler-test-suite/blob/ac5d63a278b47141b51e12bd7ec3b189177d63e9/Fortran/1054/1054_0035.f90#L4

Result:
```
$ flang -fopenmp 1054_0035.f90 && ./a.out
flang-21: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
 NG : xpno(1)= 4
 NG : xpno(2)= 11
 pass
```
The `NG` lines should not be printed for the test to pass. (`pass` should be the only output for the passing test.)

flang version:
```
flang version 21.0.0git (https://github.com/llvm/llvm-project b1017a4b84420894c0aedfe3872ef617f66f087f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: ...
Build config: +assertions
```

I don't see anything obviously wrong with the test, but I hope OpenMP experts could investigate it further.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE2L5DYQ_TXVl6KNJH_2wYeeNF4Gkk0IAzkukl22tVFLRh8z0_8-yD0zye5CYKFBjarqueq9p5Ih6MUS9VA_QH05yBRX53tKC1miLayRbvag3HTrnyhEDC75kaA84xrjFqA8gxhADIuOa1LF6K4ghjl91TEkEMPorps25I-RQjyGpCOBGJRxCsQgx3pqSinaTlUtr7iqOXGhppbGUvHuxNt2ako6gRgG56OXFsTAWV29HV8YK-tiPjEQ5a8VsDOw858Ukom5LXaGhr392BlEhbORdsHj7Day1w2_gUAQDYgGi9xX4VIEdt7zj4LnaV-kt9ou-e_vG9nf_sCQts35iNq-AeuAIWpjkF438vpKNkqDUD8c__rvzdFtUTsL9QXYGT9_woz5ulkHouMgTlBesPoxJN5CnOfYJkP4bsKnlRAa9vkTNAyNthQwrC6ZCa2LqAg3r22kCWfnMa6EWRKMbscqEEQHDdtxG_ZeqWjPdNbc0KW4pfhRnTO1XXaUIve2039n4pl8yCP-oMI3YRS8YAVbdMwf_x87GfP8fhw3777SGFFxxltZqa6qBOtO1cgkTTOVXStobng7N83Muna-d_Yk_UJxZ7NrvjTVMdm_rXuxR6Ntej0uNu0EepITXt1EJqduLuhXYOdHG6I0hqaL9vm-KApg54ekzYSjs7PeXQHiQYZAPmv7vTQZBCdnQbQRAxFKe4trZs-pZ-1SMDd88c4u-KLj-iEOiF9QpYiPuLqN3n23eykGHHeFtH2mEPUiI6GOOCcfV_K5wcPUl9OpPMkD9bytOnFqG94d1r4s54r4PIpTS6pu-cTYNLV8VmPZ8qppDroXTNSsFo0QvCy7QtE0tvxUN3JkvCUFFaOr1KbIkhTOLwcdQqKeV7wuq4ORikzYN4oQu-QgRF4uvt81VGkJUDGjQwz_QkQdzb6G7hX1BeqH-8hQX_DRjs77rLzfX_idqeG-aO5W_njPh-RN_3N-AjHsI4S8Wu5TPPfinwAAAP__r3GX0Q">