<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68653>68653</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP] Compilation error by a comment line starting with "! $", "c $", or "* $" in the fixed source form
</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 : 18.0.0(cc627828f5176c6d75a25f1756d387d18539c1fb)
```
`! $`, `c $`, and `* $` (having a space before `$`) at the beginning of a line in fixed source form are treated as conditional compilation sentinels by mistake.
According to OpenMP 5.2 specification 3.3.1 (p.70)
`Fixed Source Form Conditional Compilation Sentinels` have the following conditions:
> The sentinel must start in column 1 and appear as a single word with no intervening white space.
Therefore, these lines should be treated as comment lines.
The following are the test program, Flang-new, Gfortran and ifort compilation result.
ompfe1002_new2.f:
```fortran
program main
! $ This is a comment line
C $ This is a comment line
c $ This is a comment line
* $ This is a comment line
end program
```
```
$ flang-new ompfe1002_new2.f -fopenmp
error: Could not parse ompfe1002_new2.f
./ompfe1002_new2.f:2:5: warning: Character in fixed-form label field must be a digit
! $ This is a comment line
^
./ompfe1002_new2.f:3:5: warning: Character in fixed-form label field must be a digit
C $ This is a comment line
^
./ompfe1002_new2.f:4:5: warning: Character in fixed-form label field must be a digit
c $ This is a comment line
^
./ompfe1002_new2.f:5:5: warning: Character in fixed-form label field must be a digit
* $ This is a comment line
^
./ompfe1002_new2.f:2:7: error: expected '('
! $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: statement function definition
! $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: declaration construct
! $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: specification part
! $ This is a comment line
^
./ompfe1002_new2.f:1:7: in the context: main program
program main
^
./ompfe1002_new2.f:3:7: error: expected '('
C $ This is a comment line
^
./ompfe1002_new2.f:3:3: in the context: statement function definition
C $ This is a comment line
^
./ompfe1002_new2.f:3:3: in the context: declaration construct
C $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: specification part
! $ This is a comment line
^
./ompfe1002_new2.f:1:7: in the context: main program
program main
^
./ompfe1002_new2.f:4:7: error: expected '('
c $ This is a comment line
^
./ompfe1002_new2.f:4:3: in the context: statement function definition
c $ This is a comment line
^
./ompfe1002_new2.f:4:3: in the context: declaration construct
c $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: specification part
! $ This is a comment line
^
./ompfe1002_new2.f:1:7: in the context: main program
program main
^
./ompfe1002_new2.f:5:7: error: expected '('
* $ This is a comment line
^
./ompfe1002_new2.f:5:3: in the context: statement function definition
* $ This is a comment line
^
./ompfe1002_new2.f:5:3: in the context: declaration construct
* $ This is a comment line
^
./ompfe1002_new2.f:2:3: in the context: specification part
! $ This is a comment line
^
./ompfe1002_new2.f:1:7: in the context: main program
program main
^
$
```
```
$ gfortran ompfe1002_new2.f -fopenmp
$
```
```
$ ifort ompfe1002_new2.f -qopenmp
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v4zYQ_TX0ZWBBoixZPvjgddY9FS2wi14LmhxJ3EqkSlLx5t8XpGSvPwpbaXzrBkFi0qOZN28ehyKZtbJSiGuSfSLZy4z1rtZmrWul5-W32V6LtzXJ4_E3fiHx5g80VmoFuoSyYaqaKzwASTeQFFEcxYQWnOd0WdCizJJlznOxzBjNymSZ5SItliIpsnTFk3JP6GpweRXhxyRNgNBF-LQFksf8bMiUgPBxM04CoUXNXqWqgIHtGEfYY6kNDmbDcytgDlztv6qkUt5Yl8CgkQpBKijldxRgdW84QqlNC8wgOIPMoQBmgWslpJNasQa4bjvZMD8Ci8pJhY2F_Ru00jr2F0bn-Ww410b4gE7Dbx2qX3-HLKJgO-SylHxwk0Zp5JMuumgZ4J7I2AVkXwZkO49sewZlewblyxGKJ6VmrxgSLnXT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