[flang-commits] [flang] 21f8ced - [flang] Fix debug-fn-info.f90 test

David Spickett via flang-commits flang-commits at lists.llvm.org
Tue Apr 30 02:03:41 PDT 2024


Author: David Spickett
Date: 2024-04-30T09:01:31Z
New Revision: 21f8cedc4aa542f628035cd5dafd2d2529eb4397

URL: https://github.com/llvm/llvm-project/commit/21f8cedc4aa542f628035cd5dafd2d2529eb4397
DIFF: https://github.com/llvm/llvm-project/commit/21f8cedc4aa542f628035cd5dafd2d2529eb4397.diff

LOG: [flang] Fix debug-fn-info.f90 test

91a8cb781dbc981356207e0c3608d92ed6d26042 was originally written
before 8d5386669ed63548daf1bee415596582d6d78d7d 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.

Added: 
    

Modified: 
    flang/test/Transforms/debug-fn-info.f90

Removed: 
    


################################################################################
diff  --git a/flang/test/Transforms/debug-fn-info.f90 b/flang/test/Transforms/debug-fn-info.f90
index c1a817312c959c..97a34e8676de7f 100644
--- a/flang/test/Transforms/debug-fn-info.f90
+++ b/flang/test/Transforms/debug-fn-info.f90
@@ -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
@@ -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
@@ -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


        


More information about the flang-commits mailing list