Files
clang-p2996/flang/test/Lower/main_location.f90
Slava Zakharin 50db7a7d26 [flang] Fixed fir.dummy_scope generation to work for TBAA. (#136382)
The nesting of fir.dummy_scope operations defines the roots
of the TBAA forest. If we do not generate fir.dummy_scope
in functions that do not have any dummy arguments, then
the globals accessed in the function and the dummy arguments
accessed by the callee may end up in different sub-trees
of the same root. The added tbaa-with-dummy-scope2.fir
demonstrates the issue.
2025-04-18 17:19:12 -07:00

29 lines
858 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: fir.dummy_scope : !fir.dscope loc("{{.*}}test1.f90":1:1)
! 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: fir.dummy_scope : !fir.dscope loc("{{.*}}test2.f90":2:1)
! TEST2-NEXT: return loc("{{.*}}test2.f90":4:1)
! TEST2-NEXT: } loc("{{.*}}test2.f90":2:1)