50 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Check for semantic errors in team_number() function calls3 4program team_number_tests5 use iso_fortran_env, only : team_type6 implicit none7 8 type(team_type) home, league(2)9 integer n, non_team_type10 character non_integer11 12 !___ standard-conforming statement with no optional arguments present ___13 n = team_number()14 15 !___ standard-conforming statements with team argument present ___16 n = team_number(home)17 n = team_number(team=home)18 n = team_number(league(1))19 20 !___ non-conforming statements ___21 !ERROR: Actual argument for 'team=' has bad type 'INTEGER(4)'22 n = team_number(non_team_type)23 24 ! non-scalar team_type argument25 !ERROR: 'team=' argument has unacceptable rank 126 n = team_number(team=league)27 28 ! incorrectly typed argument29 !ERROR: Actual argument for 'team=' has bad type 'REAL(4)'30 n = team_number(3.4)31 32 !ERROR: too many actual arguments for intrinsic 'team_number'33 n = team_number(home, league(1))34 35 !ERROR: repeated keyword argument to intrinsic 'team_number'36 n = team_number(team=home, team=league(1))37 38 ! keyword argument with incorrect type39 !ERROR: Actual argument for 'team=' has bad type 'INTEGER(4)'40 n = team_number(team=non_team_type)41 42 ! incorrect keyword argument name but valid type43 !ERROR: unknown keyword argument to intrinsic 'team_number'44 n = team_number(my_team=home)45 46 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types CHARACTER(KIND=1) and INTEGER(4)47 non_integer = team_number(home)48 49end program team_number_tests50