@@ -579,6 +579,11 @@ def check_return(result_array, checks):
579
579
string += hover_req (file_path , 12 , 12 )
580
580
string += hover_req (file_path , 18 , 19 )
581
581
string += hover_req (file_path , 23 , 34 )
582
+ string += hover_req (file_path , 28 , 11 )
583
+ string += hover_req (file_path , 34 , 21 )
584
+ string += hover_req (file_path , 46 , 11 )
585
+ string += hover_req (file_path , 51 , 11 )
586
+ string += hover_req (file_path , 55 , 11 )
582
587
file_path = test_dir / "hover" / "recursive.f90"
583
588
string += hover_req (file_path , 9 , 40 )
584
589
file_path = test_dir / "subdir" / "test_submod.F90"
@@ -604,34 +609,54 @@ def check_return(result_array, checks):
604
609
"DOUBLE PRECISION, PARAMETER :: somevar = 23.12" ,
605
610
"DOUBLE PRECISION, PARAMETER :: some = 1e-19" ,
606
611
"INTEGER, POINTER" ,
607
- """INTEGER FUNCTION fun1(arg) RESULT(fun1)
608
- INTEGER, INTENT(IN) :: arg""" ,
609
- """INTEGER FUNCTION fun2(arg) RESULT(fun2)
610
- INTEGER, INTENT(IN) :: arg""" ,
611
- """INTEGER FUNCTION fun3(arg) RESULT(retval)
612
- INTEGER, INTENT(IN) :: arg""" ,
613
- """INTEGER FUNCTION fun4(arg) RESULT(retval)
614
- INTEGER, INTENT(IN) :: arg""" ,
612
+ """FUNCTION fun1(arg) RESULT(fun1)
613
+ INTEGER, INTENT(IN) :: arg
614
+ INTEGER :: fun1""" ,
615
+ """FUNCTION fun2(arg) RESULT(fun2)
616
+ INTEGER, INTENT(IN) :: arg
617
+ INTEGER :: fun2""" ,
618
+ """FUNCTION fun3(arg) RESULT(retval)
619
+ INTEGER, INTENT(IN) :: arg
620
+ INTEGER :: retval""" ,
621
+ """FUNCTION fun4(arg) RESULT(retval)
622
+ INTEGER, INTENT(IN) :: arg
623
+ INTEGER :: retval""" ,
615
624
# Notice that the order of the modifiers does not match the source code
616
625
# This is part of the test, ideally they would be identical but previously
617
626
# any modifiers before the type would be discarded
618
- """INTEGER PURE ELEMENTAL FUNCTION fun5(arg) RESULT(retval)
619
- INTEGER, INTENT(IN) :: arg""" ,
627
+ """PURE ELEMENTAL FUNCTION fun5(arg) RESULT(retval)
628
+ INTEGER, INTENT(IN) :: arg
629
+ INTEGER :: retval""" ,
630
+ """FUNCTION fun6(arg) RESULT(retval)
631
+ INTEGER, INTENT(IN) :: arg
632
+ INTEGER, DIMENSION(10,10) :: retval""" ,
633
+ """PURE FUNCTION outer_product(x, y) RESULT(outer_product)
634
+ REAL, DIMENSION(:), INTENT(IN) :: x
635
+ REAL, DIMENSION(:), INTENT(IN) :: y
636
+ REAL, DIMENSION(SIZE(X), SIZE(Y)) :: outer_product""" ,
637
+ """FUNCTION dlamch(cmach) RESULT(dlamch)
638
+ CHARACTER :: CMACH""" ,
639
+ """FUNCTION fun7() RESULT(val)
640
+ TYPE(c_ptr) :: val""" ,
641
+ """TYPE(c_ptr) FUNCTION c_loc(x) RESULT(c_loc)""" ,
620
642
"""RECURSIVE SUBROUTINE recursive_assign_descending(node, vector, current_loc)
621
643
TYPE(tree_inode), POINTER, INTENT(IN) :: node
622
644
INTEGER, DIMENSION(:), INTENT(INOUT) :: vector
623
645
INTEGER, INTENT(INOUT) :: current_loc""" ,
624
- # TODO: more tests to add from functions
625
- """REAL FUNCTION point_dist(a, b) RESULT(distance)
646
+ """FUNCTION point_dist(a, b) RESULT(distance)
626
647
TYPE(point), INTENT(IN) :: a
627
- TYPE(point), INTENT(IN) :: b""" ,
628
- """LOGICAL FUNCTION is_point_equal_a(a, b) RESULT(is_point_equal_a)
648
+ TYPE(point), INTENT(IN) :: b
649
+ REAL :: distance""" ,
650
+ """FUNCTION is_point_equal_a(a, b) RESULT(is_point_equal_a)
629
651
TYPE(point), INTENT(IN) :: a
630
- TYPE(point), INTENT(IN) :: b""" ,
631
- """REAL FUNCTION foo2(f, g, h) RESULT(arg3)
632
- REAL FUNCTION f(x) RESULT(z) :: f
633
- REAL FUNCTION g(x) RESULT(z) :: g
634
- REAL FUNCTION h(x) RESULT(z) :: h""" ,
652
+ TYPE(point), INTENT(IN) :: b
653
+ LOGICAL :: is_point_equal_a""" ,
654
+ # Could be subject to change
655
+ """FUNCTION foo2(f, g, h) RESULT(arg3)
656
+ FUNCTION f(x) :: f
657
+ FUNCTION g(x) :: g
658
+ FUNCTION h(x) :: h
659
+ REAL :: arg3""" ,
635
660
)
636
661
assert len (ref_results ) == len (results ) - 1
637
662
check_return (results [1 :], ref_results )
0 commit comments