mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 14:57:13 +00:00

Take the source position for the anonymous program from its scope. If the first evaluation is a construct or directive, then it has null source position. Author: vdonaldson Differential Revision: https://reviews.llvm.org/D146445
27 lines
716 B
Fortran
27 lines
716 B
Fortran
! RUN: split-file %s %t
|
|
! RUN: bbc %t/test1.f90 -o - --emit-fir --mlir-print-debuginfo | FileCheck %s --check-prefix=TEST1
|
|
! RUN: bbc %t/test2.f90 -o - --emit-fir --mlir-print-debuginfo | FileCheck %s --check-prefix=TEST2
|
|
|
|
! Check that the missing optional program-stmt (R1401)
|
|
! does not result in unknown source location of the corresponding
|
|
! function.
|
|
|
|
!--- test1.f90
|
|
if (.false.) then
|
|
endif
|
|
end
|
|
|
|
! TEST1: func.func @_QQmain() {
|
|
! TEST1-NEXT: return loc("{{.*}}test1.f90":3:1)
|
|
! TEST1-NEXT: } loc("{{.*}}test1.f90":1:1)
|
|
|
|
!--- test2.f90
|
|
!!! keep me here
|
|
if (.true.) then
|
|
endif
|
|
end program
|
|
|
|
! TEST2: func.func @_QQmain() {
|
|
! TEST2-NEXT: return loc("{{.*}}test2.f90":4:1)
|
|
! TEST2-NEXT: } loc("{{.*}}test2.f90":2:1)
|