brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · 5457330 Raw
127 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! There are sync-stat-lists in critical-stmt, sync-all-stmt,3! sync-images-stmt, sync-memory-stmt, sync-team-stmt,4! event-post-stmt, unlock-stmt, change-team-stmt, and end-change-team-stmt.5!6! Some of these statements have their sync-stat-lists tested in other tests.7! This test contains the statements that do not, namely critical-stmt, unlock-stmt,8! change-team-stmt, and end-change-team-stmt.9 10program test_sync_stat_list11  use iso_fortran_env, only: team_type, lock_type12 13  implicit none14 15  integer coarray[*], sync_status, non_scalar(2), superfluous_stat, coindexed_integer[*]16  character(len=128) error_message, superfluous_errmsg, coindexed_character[*]17  logical invalid_type18  type(team_type) :: home19  type(lock_type) :: latch[*]20 21  ! valid22  change team (home, stat=sync_status, errmsg=error_message)23  end team (stat=sync_status, errmsg=error_message)24 25  !ERROR: Must be a scalar value, but is a rank-1 array26  change team (home, stat=non_scalar, errmsg=error_message)27  end team28 29  !ERROR: Must have INTEGER type, but is LOGICAL(4)30  change team (home, stat=invalid_type, errmsg=error_message)31  end team32 33  !ERROR: Must have CHARACTER type, but is LOGICAL(4)34  change team (home, stat=sync_status, errmsg=invalid_type)35  end team36 37  change team (home)38  !ERROR: Must be a scalar value, but is a rank-1 array39  end team (stat=non_scalar, errmsg=error_message)40 41  change team (home)42  !ERROR: Must have INTEGER type, but is LOGICAL(4)43  end team (stat=invalid_type, errmsg=error_message)44 45  change team (home)46  !ERROR: Must have CHARACTER type, but is LOGICAL(4)47  end team (stat=sync_status, errmsg=invalid_type)48 49  !ERROR: The stat-variable in a sync-stat-list may not be repeated50  change team (home, stat=sync_status, errmsg=error_message, stat=superfluous_stat)51  end team52 53  !ERROR: The errmsg-variable in a sync-stat-list may not be repeated54  change team (home, stat=sync_status, errmsg=error_message, errmsg=superfluous_errmsg)55  end team56 57  change team (home)58  !ERROR: The stat-variable in a sync-stat-list may not be repeated59  end team (stat=sync_status, errmsg=error_message, stat=superfluous_stat)60 61  change team (home)62  !ERROR: The errmsg-variable in a sync-stat-list may not be repeated63  end team (stat=sync_status, errmsg=error_message, errmsg=superfluous_errmsg)64 65  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object66  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object67  change team (home, stat=coindexed_integer[1], errmsg=coindexed_character[1])68  end team69 70  change team (home)71  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object72  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object73  end team (stat=coindexed_integer[1], errmsg=coindexed_character[1])74 75  ! valid76  unlock (latch, stat=sync_status, errmsg=error_message)77 78  !ERROR: Must be a scalar value, but is a rank-1 array79  unlock (latch, stat=non_scalar, errmsg=error_message)80 81  !ERROR: Must have INTEGER type, but is LOGICAL(4)82  unlock (latch, stat=invalid_type, errmsg=error_message)83 84  !ERROR: Must have CHARACTER type, but is LOGICAL(4)85  unlock (latch, stat=sync_status, errmsg=invalid_type)86 87  !ERROR: The stat-variable in a sync-stat-list may not be repeated88  unlock (latch, stat=sync_status, stat=superfluous_stat)89 90  !ERROR: The errmsg-variable in a sync-stat-list may not be repeated91  unlock (latch, stat=sync_status, errmsg=error_message, errmsg=superfluous_errmsg)92 93  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object94  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object95  unlock (latch, stat=coindexed_integer[1], errmsg=coindexed_character[1])96 97  ! valid98  critical (stat=sync_status, errmsg=error_message)99  end critical100 101  !ERROR: Must be a scalar value, but is a rank-1 array102  critical (stat=non_scalar, errmsg=error_message)103  end critical104 105  !ERROR: Must have INTEGER type, but is LOGICAL(4)106  critical (stat=invalid_type, errmsg=error_message)107  end critical108 109  !ERROR: Must have CHARACTER type, but is LOGICAL(4)110  critical (stat=sync_status, errmsg=invalid_type)111  end critical112 113  !ERROR: The stat-variable in a sync-stat-list may not be repeated114  critical (stat=sync_status, errmsg=error_message, stat=superfluous_stat)115  end critical116 117  !ERROR: The errmsg-variable in a sync-stat-list may not be repeated118  critical (stat=sync_status, errmsg=error_message, errmsg=superfluous_errmsg)119  end critical120 121  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object122  !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object123  critical (stat=coindexed_integer[1], errmsg=coindexed_character[1])124  end critical125 126end program test_sync_stat_list127