Closed k-arrows closed 2 weeks ago
@llvm/issue-subscribers-flang-frontend
Author: None (k-arrows)
Shouldn't it be enclosed within the module or submodule?
I get error in other compiler as well:
$ gfortran x.f90 -fopenmp && ./a.out
x.f90:35:8:
35 | module subroutine e()
| 1
Error: MODULE prefix at (1) found outside of a module, submodule, or interface
x.f90:37:3:
37 | end subroutine
| 1
Error: Expecting END PROGRAM statement at (1)
But the following works:
module m
interface
impure elemental module subroutine e()
end subroutine
end interface
end module
The compiler should not crash even if the input is erroneous as a program.
Yes, that's right. I think this can be fixed with similar fix: https://github.com/llvm/llvm-project/pull/71944/files
Compiling the following program with
-fopenmp
causes a crash.Compile with:
flang-new -fopenmp test.f90
Output:
Stack dump (see Godbolt: https://godbolt.org/z/bzY8xPz7Y)