38 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror2! Catch discrepancies between implicit result types and a global definition3 4complex function zbefore()5zbefore = (0.,0.)6end7 8program main9!ERROR: Implicit declaration of function 'zbefore' has a different result type than in previous declaration10print *, zbefore()11print *, zafter()12print *, zafter2()13print *, zafter3()14end15 16subroutine another17implicit integer(z)18!ERROR: Implicit declaration of function 'zafter' has a different result type than in previous declaration19print *, zafter()20end21 22!ERROR: Function 'zafter' has a result type that differs from the implicit type it obtained in a previous reference23complex function zafter()24zafter = (0.,0.)25end26 27function zafter2()28!ERROR: Function 'zafter2' has a result type that differs from the implicit type it obtained in a previous reference29complex zafter230zafter2 = (0.,0.)31end32 33function zafter3() result(res)34!ERROR: Function 'zafter3' has a result type that differs from the implicit type it obtained in a previous reference35complex res36res = (0.,0.)37end38