1! { dg-do compile } 2! { dg-options "-c" } 3! 4! Functions shall not have an initializer. 5! 6! Due to -fwhole-file, the function declaration 7! warnings come before the init warnings; thus 8! the warning for the WRONG lines have been moved to 9! func_decl_5.f90 10! 11 12function f1() 13 integer :: f1 = 42 ! WRONG, see func_decl_5.f90 14end function 15 16function f2() RESULT (r) 17 integer :: r = 42 ! WRONG, see func_decl_5.f90 18end function 19 20function f3() RESULT (f3) ! { dg-error "must be different than function name" } 21 integer :: f3 = 42 22end function ! { dg-error "Expecting END PROGRAM" } 23! { dg-error "Unexpected end of file" "" { target "*-*-*" } 0 } 24