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

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP] Compilation error of specifying a pointer in a threadprivate directive
        </td>
    </tr>

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

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

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

<pre>
    ```
Version of flang-new : 19.0.0(dcebe297367f48a71a5ecea3bcdd54671195da1b)/AArch64
```
Specifying a `pointer` in a `threadprivate` directive results in a compilation-time error.

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

snggz274_.f90:
```fortran
subroutine ss2
  external ::a,x
  pointer:: a
!$omp threadprivate(a)
  save a
  a=>x
 call a
end subroutine ss2

subroutine x
end subroutine x

program main
  call ss2
  print *,'pass'
end program main

```

```
$ flang-new -fopenmp snggz274_.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/Metro/FFE_2016_V20L30_11/snggz274_.f90":1:1): 'omp.threadprivate' op failed to verify that all of {sym_addr, tls_addr} have same type
error: Lowering to LLVM IR failed
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/Metro/FFE_2016_V20L30_11/snggz274_.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func
error: failed to create the LLVM module
$
```

```
$ gfortran -fopenmp snggz274_.f90; ./a.out
 pass
$
```

```
$ ifort -qopenmp -diag-disable=10448 snggz274_.f90; ./a.out
 pass
$
```

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