[flang-commits] [PATCH] D128370: [flang] Add semantics test for `get_team`
Katherine Rasmussen via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Jun 29 16:34:12 PDT 2022
ktras updated this revision to Diff 441202.
ktras added a comment.
Remove unused variable from the test.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128370/new/
https://reviews.llvm.org/D128370
Files:
flang/test/Semantics/get_team.f90
Index: flang/test/Semantics/get_team.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/get_team.f90
@@ -0,0 +1,55 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+! Check for semantic errors in get_team(), as defined in
+! section 16.9.85 of the Fortran 2018 standard
+
+program get_team_test
+ use iso_fortran_env, only: team_type, initial_team, current_team, parent_team
+ implicit none
+
+ integer n, array(1), coarray[*]
+ type(team_type) :: result_team
+ logical wrong_result_type, non_integer
+
+ !___ standard-conforming statement with no optional arguments present ___
+ result_team = get_team()
+
+ !___ standard-conforming statements with optional level argument present ___
+ result_team = get_team(-1)
+ result_team = get_team(-2)
+ result_team = get_team(-3)
+ result_team = get_team(initial_team)
+ result_team = get_team(current_team)
+ result_team = get_team(parent_team)
+ result_team = get_team(n)
+ result_team = get_team(array(1))
+ result_team = get_team(array(n))
+ result_team = get_team(coarray[1])
+ result_team = get_team(level=initial_team)
+ result_team = get_team(level=n)
+
+ !___ non-conforming statements ___
+ !ERROR: 'level=' argument has unacceptable rank 1
+ result_team = get_team(array)
+
+ !ERROR: Actual argument for 'level=' has bad type 'LOGICAL(4)'
+ result_team = get_team(non_integer)
+
+ !ERROR: Actual argument for 'level=' has bad type 'REAL(4)'
+ result_team = get_team(3.4)
+
+ !ERROR: too many actual arguments for intrinsic 'get_team'
+ result_team = get_team(current_team, parent_team)
+
+ !ERROR: Actual argument for 'level=' has bad type 'REAL(4)'
+ result_team = get_team(level=3.4)
+
+ !ERROR: unknown keyword argument to intrinsic 'get_team'
+ result_team = get_team(levels=initial_team)
+
+ !ERROR: repeated keyword argument to intrinsic 'get_team'
+ result_team = get_team(level=initial_team, level=parent_team)
+
+ !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types LOGICAL(4) and TYPE(__builtin_team_type)
+ wrong_result_type = get_team()
+
+end program get_team_test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128370.441202.patch
Type: text/x-patch
Size: 2153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220629/f19dd5f0/attachment.bin>
More information about the flang-commits
mailing list