Skip to content

Commit

Permalink
[flang] Fix debug-fn-info.f90 test
Browse files Browse the repository at this point in the history
91a8cb7 was originally written
before 8d53866 landed. The latter
changed how main is emitted which changed the numbering of the
suprograms in the test output.

To fix this I've added a check for the new _QQmain and renumbered
the existing checks.
  • Loading branch information
DavidSpickett committed Apr 30, 2024
1 parent fce0916 commit 21f8ced
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flang/test/Transforms/debug-fn-info.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
! CHECK-DAG: #[[LOG1:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "logical", sizeInBits = 8, encoding = DW_ATE_boolean>
! CHECK-DAG: #[[REAL4:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "real", sizeInBits = 32, encoding = DW_ATE_float>
! CHECK-DAG: #[[LOG4:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "logical", sizeInBits = 32, encoding = DW_ATE_boolean>
! CHECK: #[[TY0:.*]] = #llvm.di_subroutine_type<callingConvention = DW_CC_program>
! CHECK: #[[TY1:.*]] = #llvm.di_subroutine_type<callingConvention = DW_CC_normal, types = #[[INT8]], #[[INT4]], #[[REAL8]], #[[LOG1]]>
! CHECK: #[[TY2:.*]] = #llvm.di_subroutine_type<callingConvention = DW_CC_normal, types = #[[INT4]], #[[INT8]], #[[REAL4]], #[[LOG4]]>

! CHECK: #di_subprogram1 = #llvm.di_subprogram<id = {{.*}}, compileUnit = {{.*}}, scope = {{.*}}, name = "_QQmain", linkageName = "_QQmain", file = {{.*}}, line = [[@LINE+1]], scopeLine = [[@LINE+1]], subprogramFlags = Definition, type = #[[TY0]]>
program mn
integer(kind=4) :: i4
integer(kind=8) :: i8
Expand All @@ -20,7 +22,7 @@ program mn
i8 = fn1(i4, r8, l1)
i4 = fn2(i8, r4, l4)
contains
! CHECK: #di_subprogram1 = #llvm.di_subprogram<id = {{.*}}, compileUnit = {{.*}}, scope = {{.*}}, name = "fn1", linkageName = "_QFPfn1", file = {{.*}}, line = [[@LINE+1]], scopeLine = [[@LINE+1]], subprogramFlags = Definition, type = #[[TY1]]>
! CHECK: #di_subprogram2 = #llvm.di_subprogram<id = {{.*}}, compileUnit = {{.*}}, scope = {{.*}}, name = "fn1", linkageName = "_QFPfn1", file = {{.*}}, line = [[@LINE+1]], scopeLine = [[@LINE+1]], subprogramFlags = Definition, type = #[[TY1]]>
function fn1(a, b, c) result (res)
implicit none
integer(kind=4), intent(in) :: a
Expand All @@ -30,7 +32,7 @@ function fn1(a, b, c) result (res)
res = a + b
end function

! CHECK: #di_subprogram2 = #llvm.di_subprogram<id = {{.*}}, compileUnit = {{.*}}, scope = {{.*}}, name = "fn2", linkageName = "_QFPfn2", file = {{.*}}, line = [[@LINE+1]], scopeLine = [[@LINE+1]], subprogramFlags = Definition, type = #[[TY2]]>
! CHECK: #di_subprogram3 = #llvm.di_subprogram<id = {{.*}}, compileUnit = {{.*}}, scope = {{.*}}, name = "fn2", linkageName = "_QFPfn2", file = {{.*}}, line = [[@LINE+1]], scopeLine = [[@LINE+1]], subprogramFlags = Definition, type = #[[TY2]]>
function fn2(a, b, c) result (res)
implicit none
integer(kind=8), intent(in) :: a
Expand Down

0 comments on commit 21f8ced

Please sign in to comment.