[flang-commits] [PATCH] D126734: [flang] Add team_type to num_images intrinsic call
Katherine Rasmussen via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Jun 1 17:38:24 PDT 2022
ktras updated this revision to Diff 433600.
ktras edited the summary of this revision.
ktras added a comment.
- In the semantics test, remove section of comment that says "not yet supported" when referring to the `team` argument
- Fix the formatting in the changes in `flang/lib/Evaluate/intrinsics.cpp` after running `git clang-format`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126734/new/
https://reviews.llvm.org/D126734
Files:
flang/lib/Evaluate/intrinsics.cpp
flang/test/Semantics/num_images01.f90
flang/test/Semantics/num_images02.f90
Index: flang/test/Semantics/num_images02.f90
===================================================================
--- flang/test/Semantics/num_images02.f90
+++ flang/test/Semantics/num_images02.f90
@@ -21,12 +21,8 @@
n = num_images(standard_initial_value)
n = num_images(coindexed[1])
- !___ standard-conforming statements with team_type argument present (not yet supported) ___
-
- !ERROR: too many actual arguments for intrinsic 'num_images'
+ !___ standard-conforming statements with team_type argument present ___
n = num_images(home)
-
- !ERROR: unknown keyword argument to intrinsic 'num_images'
n = num_images(team=home)
!___ non-conforming statements ___
Index: flang/test/Semantics/num_images01.f90
===================================================================
--- flang/test/Semantics/num_images01.f90
+++ flang/test/Semantics/num_images01.f90
@@ -2,11 +2,17 @@
! Check for semantic errors in num_images() function calls
subroutine test
+ use iso_fortran_env, only: team_type
+ implicit none
+
+ type(team_type) my_team
! correct calls, should produce no errors
print *, num_images()
print *, num_images(team_number=1)
print *, num_images(1)
+ print *, num_images(my_team)
+ print *, num_images(team=my_team)
! incorrectly typed argument
! the error is seen as too many arguments to the num_images() call with no arguments
@@ -25,6 +31,7 @@
!ERROR: unknown keyword argument to intrinsic 'num_images'
print *, num_images(team_numbers=1)
- !TODO: test num_images() calls related to team_type argument
+ !ERROR: unknown keyword argument to intrinsic 'num_images'
+ print *, num_images(teams=my_team)
end subroutine
Index: flang/lib/Evaluate/intrinsics.cpp
===================================================================
--- flang/lib/Evaluate/intrinsics.cpp
+++ flang/lib/Evaluate/intrinsics.cpp
@@ -629,6 +629,8 @@
// NULL() is a special case handled in Probe() below
{"num_images", {}, DefaultInt, Rank::scalar,
IntrinsicClass::transformationalFunction},
+ {"num_images", {{"team", TeamType, Rank::scalar}}, DefaultInt, Rank::scalar,
+ IntrinsicClass::transformationalFunction},
{"num_images", {{"team_number", AnyInt, Rank::scalar}}, DefaultInt,
Rank::scalar, IntrinsicClass::transformationalFunction},
{"out_of_range",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126734.433600.patch
Type: text/x-patch
Size: 2355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220602/70bfb518/attachment-0001.bin>
More information about the flang-commits
mailing list