27 lines · plain
1! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s2 3program test_proc_ptr4 implicit none5 procedure(fun1), pointer :: fun_ptr6 7 fun_ptr => fun18 print *, fun_ptr(3)9 10contains11 integer function fun1(x)12 integer :: x13 fun1 = x + 114 end function fun115end program test_proc_ptr16 17! Check that fun_ptr is declared with correct type18! CHECK-DAG: ![[INT:.*]] = !DIBasicType(name: "integer", size: 32, encoding: DW_ATE_signed)19! CHECK-DAG: ![[PTR_INT:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[INT]], size: 64)20 21! Check that fun_ptr variable is a pointer to a subroutine type22! The order is: DILocalVariable -> pointer type -> subroutine type -> {return, params}23! CHECK-DAG: ![[FUN_PTR_VAR:.*]] = !DILocalVariable(name: "fun_ptr", {{.*}}type: ![[PROC_PTR:[0-9]+]]24! CHECK-DAG: ![[PROC_PTR]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[SUBR_TYPE:[0-9]+]], size: 64)25! CHECK-DAG: ![[SUBR_TYPE]] = !DISubroutineType(types: ![[SUBR_TYPES:[0-9]+]])26! CHECK-DAG: ![[SUBR_TYPES]] = !{![[INT]], ![[PTR_INT]]}27