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

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] Flang incorrectly allows multiple data-sharing properties on common block variables.
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          scamp-nvidia
      </td>
    </tr>
</table>

<pre>
    Consider the following code snippet: 

```
      SUBROUTINE example_subroutine()
        COMMON /blk/ a,b
! Incorrect because A is a constituent element of BLK
!$OMP   PARALLEL PRIVATE(/blk/), SHARED(a)
!$OMP   END PARALLEL
      END SUBROUTINE example_subroutine
```

Here 'a' is a part of the common /blk/. In the openmp region, we assign /blk/ to be private but 'a' to be shared. This effectively means we've assigned two different data-sharing properties to a since it's a constituent of /blk/! This should not compile. But - Flang doesn't appear to actually catch this error, while nvhpc 25.7 and gfortran 14 do. 

```
scamp:$ flang -fopenmp -c test.F90 -o test.o
scamp:$ gfortran -fopenmp -c test.F90 -o test.o
test.F90:4:40:
    4 | !$OMP   PARALLEL PRIVATE(/blk/), SHARED(a)
      |                                        1
Error: Symbol ‘a’ present on multiple clauses at (1)
scamp:$ nvfortran -mp -c test.F90 -o test.o
NVFORTRAN-S-0155-a is used in multiple data sharing clauses (test.F90: 4)
  0 inform,   0 warnings,   1 severes, 0 fatal for example_subroutine
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE1v2zgQ_TX0ZWBBosVIPuigJDYabBIHTtrrYiSNLG4pUiApZ_PvF5Rs1y2KdoEKNPjlmTfz-GbQOXnQRAUTt0zcL3D0nbGFq7EflvooG4mLyjQfxZ3RTjZkwXcErVHKvEt9gNo0BE7LYSDPViWwuAzjJj6NuITpe_18u999fnt43gD9i_2g6G83VtaMXmpiPGd8ffkvwN3u6Wn3DIxvK_WV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