[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / team_number02.f90
blob32f0ea74b566494131ff9b9ebcd9e0f2848e1c4c
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors in team_number() function calls
4 program team_number_tests
5 use iso_fortran_env, only : team_type
6 implicit none
8 type(team_type) home, league(2)
9 integer n, non_team_type
10 character non_integer
12 !___ standard-conforming statement with no optional arguments present ___
13 n = team_number()
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))
20 !___ non-conforming statements ___
21 !ERROR: Actual argument for 'team=' has bad type 'INTEGER(4)'
22 n = team_number(non_team_type)
24 ! non-scalar team_type argument
25 !ERROR: 'team=' argument has unacceptable rank 1
26 n = team_number(team=league)
28 ! incorrectly typed argument
29 !ERROR: Actual argument for 'team=' has bad type 'REAL(4)'
30 n = team_number(3.4)
32 !ERROR: too many actual arguments for intrinsic 'team_number'
33 n = team_number(home, league(1))
35 !ERROR: repeated keyword argument to intrinsic 'team_number'
36 n = team_number(team=home, team=league(1))
38 ! keyword argument with incorrect type
39 !ERROR: Actual argument for 'team=' has bad type 'INTEGER(4)'
40 n = team_number(team=non_team_type)
42 ! incorrect keyword argument name but valid type
43 !ERROR: unknown keyword argument to intrinsic 'team_number'
44 n = team_number(my_team=home)
46 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types CHARACTER(KIND=1) and INTEGER(4)
47 non_integer = team_number(home)
49 end program team_number_tests