diff --git a/flang/test/Semantics/collectives01.f90 b/flang/test/Semantics/collectives01.f90 --- a/flang/test/Semantics/collectives01.f90 +++ b/flang/test/Semantics/collectives01.f90 @@ -33,6 +33,7 @@ ! all arguments present call co_sum(a=i, result_image=1, stat=status, errmsg=message) + call co_sum(result_image=1, a=i, errmsg=message, stat=status) ! one optional argument not present call co_sum(a=i, stat=status, errmsg=message) @@ -95,6 +96,10 @@ ! 'errmsg' argument shall be noncoindexed !ERROR: to be determined call co_sum(c, errmsg=coindexed_character[1]) + + ! 'errmsg' argument shall be a character + !ERROR: to be determined + call co_sum(c, errmsg=i) ! 'errmsg' argument shall be character scalar !ERROR: 'errmsg=' argument has unacceptable rank 1 diff --git a/flang/test/Semantics/collectives02.f90 b/flang/test/Semantics/collectives02.f90 --- a/flang/test/Semantics/collectives02.f90 +++ b/flang/test/Semantics/collectives02.f90 @@ -84,11 +84,19 @@ ! 'stat' argument shall be an integer scalar !ERROR: 'stat=' argument has unacceptable rank 1 call co_min(i, stat=integer_array) - + + ! 'errmsg' argument shall be intent(inout) + !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'errmsg=' must be definable + call co_min(a=i, result_image=1, stat=status, errmsg='c') + ! 'errmsg' argument shall be noncoindexed !ERROR: to be determined call co_min(c, errmsg=coindexed_character[1]) - + + ! 'errmsg' argument shall be a character + !ERROR: to be determined + call co_min(c, errmsg=i) + ! 'errmsg' argument shall be character scalar !ERROR: 'errmsg=' argument has unacceptable rank 1 call co_min(d, errmsg=character_array) diff --git a/flang/test/Semantics/collectives03.f90 b/flang/test/Semantics/collectives03.f90 --- a/flang/test/Semantics/collectives03.f90 +++ b/flang/test/Semantics/collectives03.f90 @@ -85,10 +85,18 @@ !ERROR: 'stat=' argument has unacceptable rank 1 call co_max(i, stat=integer_array) + ! 'errmsg' argument shall be intent(inout) + !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'errmsg=' must be definable + call co_max(a=i, result_image=1, stat=status, errmsg='c') + ! 'errmsg' argument shall be noncoindexed !ERROR: to be determined call co_max(c, errmsg=coindexed_character[1]) - + + ! 'errmsg' argument shall be a character + !ERROR: to be determined + call co_max(c, errmsg=i) + ! 'errmsg' argument shall be character scalar !ERROR: 'errmsg=' argument has unacceptable rank 1 call co_max(d, errmsg=character_array) diff --git a/flang/test/Semantics/collectives04.f90 b/flang/test/Semantics/collectives04.f90 --- a/flang/test/Semantics/collectives04.f90 +++ b/flang/test/Semantics/collectives04.f90 @@ -88,7 +88,15 @@ ! 'errmsg' argument shall be noncoindexed !ERROR: to be determined call co_broadcast(c, errmsg=coindexed_character[1], source_image=1) - + + ! 'errmsg' argument shall be a character + !ERROR: to be determined + call co_broadcast(c, 1, status, i) + + ! 'errmsg' argument shall be a character + !ERROR: to be determined + call co_broadcast(c, errmsg=i, source_image=1) + ! 'errmsg' argument shall be character scalar !ERROR: 'errmsg=' argument has unacceptable rank 1 call co_broadcast(d, errmsg=character_array, source_image=1) diff --git a/flang/test/Semantics/collectives05.f90 b/flang/test/Semantics/collectives05.f90 --- a/flang/test/Semantics/collectives05.f90 +++ b/flang/test/Semantics/collectives05.f90 @@ -52,6 +52,8 @@ call co_reduce(string, operation=char_op, result_image=1, stat=status, errmsg=message) call co_reduce(foo, operation=left, result_image=1, stat=status, errmsg=message) + call co_reduce(result_image=1, operation=left, a=foo, errmsg=message, stat=status) + allocate(foo_t :: polymorphic) ! Test all statically verifiable semantic requirements on co_reduce arguments @@ -160,7 +162,7 @@ !ERROR: to be determined call co_reduce(i, int_op, result_image=1, stat=status, errmsg=conindexed_string[1]) - ! errmsg argument must be a scalar + ! errmsg argument must be a character scalar !ERROR: to be determined call co_reduce(i, int_op, result_image=1, stat=status, errmsg=character_array)