Skip to content

Commit 3ea441c

Browse files
author
Damian Rouson
committed
Revise team tests and add team_number test
1 parent 9c4176a commit 3ea441c

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

gcc/testsuite/gfortran.dg/team_change_1.f90

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
!
66
use iso_fortran_env, only : team_type
77
implicit none
8-
type(team_type) :: team
9-
integer :: new_team
10-
integer, parameter :: standard_initial_value=-1
11-
12-
if (team_number()/=standard_initial_value) call abort
8+
type(team_type) team
9+
integer new_team
1310

1411
new_team = mod(this_image(),2)+1
1512

@@ -18,5 +15,4 @@
1815
if (team_number()/=new_team) call abort
1916
end team
2017

21-
if (team_number()/=standard_initial_value) call abort
2218
end
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
! { dg-do run }
22
! { dg-options "-fcoarray=single" }
33
!
4-
! Tests if end team reverts this_image value
4+
! Tests if team_number intrinsic fucntion works
55
!
66
use iso_fortran_env, only : team_type
77
implicit none
88
type(team_type) :: team
9-
integer :: orig_i
10-
11-
orig_i = this_image ()
12-
form team (orig_i + 1,team)
13-
change team (team)
14-
end team
15-
if ( orig_i .NE. this_image () ) call abort
16-
end
9+
integer, parameter :: standard_initial_value=-1
1710

11+
associate(new_team => mod(this_image(),2)+1)
12+
form team (new_team,team)
13+
change team (team)
14+
end team
15+
end associate
1816

17+
if (team_number()/=standard_initial_value) call abort
18+
end
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
! { dg-do run }
22
! { dg-options "-fcoarray=single" }
33
!
4+
! Tests if form team works
45
!
56
use iso_fortran_env, only : team_type
67
implicit none
78
type(team_type) :: team
89

9-
form team (this_image(),team)
10+
form team (mod(this_image(),2)+1,team)
1011
end
1112

1213

14+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
! { dg-do run }
2+
! { dg-options "-fcoarray=single" }
3+
!
4+
! Tests if team_number intrinsic fucntion works
5+
!
6+
use iso_fortran_env, only : team_type
7+
implicit none
8+
type(team_type) team
9+
integer, parameter :: standard_initial_value=-1
10+
integer new_team
11+
12+
if (team_number()/=standard_initial_value) call abort
13+
14+
new_team = mod(this_image(),2)+1
15+
form team (new_team,team)
16+
change team (team)
17+
if (team_number()/=new_team) call abort
18+
end team
19+
20+
if (team_number()/=standard_initial_value) call abort
21+
end

0 commit comments

Comments
 (0)