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

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] symbol resolution error for DECLARE SIMD UNIFORM
        </td>
    </tr>

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

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

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

<pre>
    See https://github.com/fujitsu/compiler-test-suite/blob/ac5d63a278b47141b51e12bd7ec3b189177d63e9/Fortran/0489/0489_0069.f90

```
 function add2(a,b,i,fact,alc) result(c)
            !$omp declare simd(add2) uniform(a,b,fact)
            integer :: i
 integer,pointer::alc
            double precision :: a(*),b(*),fact,c
 c = a(i) + b(i) + fact
        end function

print *,'pass'
end
```

Reproduce with `flang -fopenmp`. 

I think the problem here is that DECLARE SIMD is in the specification part before the declarations of the symbols used in the UNIFORM clause.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U02P5CYQ_TXlC5oWLn9gH3zwdK-lkTLZaFY5R2DKbTbYWIA32n8f4XYys3tYCwlDVb3He1AyBHNfiTqonqG6ZXKPs_NdVFbOmXL6e_eFiM0xbgGKHnAAHO4mzru6jG4BHKb9q4lhBxxGt2zGkn-KFOJT2E0kwEFZpwAHOVa6LiSKRpUiL3NV5ZSj0oLGQuVNmwuh64JawGFwPnq5Ag68bNpz-ovzur1MLQfep1Hzc_CeTfs6RuNWJrVGwEYCXhXg1QBeJzlGwKu0I2DLPIXdRsAmrVLphw8wByzdsjFNo5WeWDCLTnAHasv21UzOLx8IHuA_A5k10p08S34VPTMpfO4BXjeX_v0jmI71Y7F2u7LENk-jCUnTiSIBG8A-sR3c74tT4QE0MihuR65JJwZ8Zurj4sh9J6RV_2_ew9fNmzWyA_sKKDYZAqAA3tOqf7IdeP9Gm3d6H4n9Y-LMoOaTleudPU1uo3XZoOYX9kh9YXE2698szkmcU5YWNpMnZgKLs4zs9un6W__2iX15eb2lTbMeuWGj0UxmlMcFb9JHpmhyno7o46aOWGBuelR8X5Szge2B9H8of_7-Mnx-e2WjlXugS6a7QrdFKzPqclEKURW5qLK5a3Rdt0pSqVtCIWRTN1Vd8HoUAkkWPDMdcqx4hTwvq7aoLk1LvCkIm1JgVUkFJadFGnux9ttycf6emRB26vKSizLPrFRkw9FsiIdZUPSnWYipAX2XKp_Ufg9QcmtCDO9Y0UR7tOqjtLpB9fx5o_X1D6hup_L0yJ3dD7_Ie-fZ5PyP9p52ZLu33S9aO9Ge09Pm3VdKD2049ATA4ZT0rcN_AwAA__9UeUaA">