<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117693>117693</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] preprocessor removes OPENMP pragmas
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
shivaramaarao
</td>
</tr>
</table>
<pre>
Consider the following program
program main
IMPLICIT NONE
INTEGER:: I
!$ INTEGER :: omp_id
!$OMP PARALLEL DO
DO I=1,100
print *, omp_id
ENDDO
!$OMP END PARALLEL DO
end program
preprocessor output of above program is
flang -E ~/t1.F
#line "/home/shivaram/t1.F" 1
program main
IMPLICIT NONE
INTEGER:: I
DO I=1,100
print *, omp_id
ENDDO
end program
The openmp pragmas are removed.
The expected output is
# 1 "/home/shivaram/t1.F"
program main
IMPLICIT NONE
INTEGER:: I
!$ INTEGER :: omp_id
!$OMP PARALLEL DO
DO I=1,100
print *, omp_id
ENDDO
!$OMP END PARALLEL DO
end program
The expected output is generated only when -fopenmp option is passed. Without -fopenmp also, the expected output should be generated.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslF-LozwUxj9NvDm0JLG29cIL36ovhU5bhoH38iXWU80STUhiZ-dmP_ui_TfLdthdZiEgHp885_jjSYRzsu4QExL9Q6IsEL1vtE1cI0_CilYIK3RQ6uotWenOyQot-AbhqJXSr7KrwVhdW9ESmgLA9Q1aIbtLCWD9tN-sV-sX2O62-b26fcn_zZ9JmJIwhTWhKeGM8Nm7b2chXCS6Nf_L6qbbPe1hnz6nm02-gWx38812sCZhxghfMUqHsrGy80B4Svjq7nJW59ts3Hv3zLfZQ1_sqnc_e17GorH6gM5pC7r3pvegjyBKfcIbC-lgMDkq0dUwyeEb4YVn02LsGirZIRDOCS8a3SLhxZX9VcY5sNsUnwM8ro8wwbXDQ1o3UB_yeGkQtMGuNWCsqFvhQFgEi60-YTWFiwS_Gjx4rK68pDuDAPYrDH8JwmdT9qfkfj9nD5H-zAtq7NCKsdapN3htsIPJ8cJeGy91N8iMcG4A_5_0je79XSKU08OM_oG9a3SvKijx3mV6i05QJWEVh7EIMGGLkM9ZxOc0aJLlIqrmYsFoOcNlTNm8isMDHmlYLjliyQKZcMpnjPE5o5RROl3Oojg8RPMZhjRehAsyo9gKqaZKndqptnUgnesxYWwxj8NAiRKVG28pzsejNAQiygKbDBsmZV87MqNKOu_uFl56NV5t5x1RBj-c2HM0Hez2-fZpf01t0FuVNN4bN0SCF4QXtfRNX04Pekjj4H55TIzVX_DgCS_GaR3hxWXgU8K_BwAA___yso6H">