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

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP]Incorrect execution result of COPYPRIVATE clause specified in SINGLE construct
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp,
            flang:frontend
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 17.0.0(abe9ae6d414e2b729f320626245e03b8bbde6143)
```

`COPYPRIVATE` clause specified in `SINGLE` construct does not seem to be valid.  
The results were the same with or without `COPYPRIVATE`.


The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution.

omp_fp16_sin_cp01_5.f90:
```fortran
program main
  real(4),save::a
!$omp threadprivate(a)
!$omp parallel
!$omp single
  a=1.0
!$omp end single copyprivate(a)
 write(6,*) "a = ", a
  if (a /= 1.0) then
     write(6,*) "NG"
 endif
!$omp end parallel
  print *,'pass'
end program main
```

```
$ export OMP_NUM_THREADS=2; flang-new -fopenmp omp_fp16_sin_cp01_5.f90; ./a.out
 a =  1.
 a =  0.
 NG
 pass
$
```

```
$ export OMP_NUM_THREADS=2; gfortran -fopenmp omp_fp16_sin_cp01_5.f90; ./a.out
 a =    1.00000000
 a = 1.00000000
 pass
$
```

```
$ export OMP_NUM_THREADS=2; ifort -qopenmp omp_fp16_sin_cp01_5.f90; ./a.out
 a =    1.000000
 a = 1.000000
 pass
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2PozgQ_TXmUgoyNpDmwCGdTHpb2v7QTO9Ie4oMFIlHxmZt05n59ysDSU_6Q1ppZ6JI4HLx6r1yuUo4J_casSTZNck2kRj8wdjSHLRZtN-iyjQ_SpLT-U83hK6-onXSaDAttEro_ULjEQhfQbKMaUwJuxIVF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