File: lockstmt03.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (94 lines) | stat: -rw-r--r-- 3,179 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
! RUN: %python %S/test_errors.py %s %flang_fc1
! XFAIL: *
! This test checks for semantic errors in lock statements based on the
! statement specification in section 11.6.10 of the Fortran 2018 standard.

program test_lock_stmt
  use iso_fortran_env, only: lock_type, event_type
  implicit none

  character(len=128) error_message, msg_array(10), coindexed_msg[*], repeated_msg
  integer status, stat_array(10), coindexed_int[*], non_bool, repeated_stat
  logical non_integer, bool, bool_array(10), non_char, coindexed_logical[*], repeated_bool
  type(lock_type) :: lock_var[*], lock_array(10)[*], non_coarray_lock
  type(event_type) :: not_lock_var[*]

  !___ non-standard-conforming statements ___

! type mismatches

  !ERROR: to be determined
  lock(not_lock_var)

  !ERROR: Must have LOGICAL type, but is INTEGER(4)
  lock(lock_var, acquired_lock=non_bool)

  !ERROR: Must have INTEGER type, but is LOGICAL(4)
  lock(lock_var, stat=non_integer)

  !ERROR: Must have CHARACTER type, but is LOGICAL(4)
  lock(lock_var, errmsg=non_char)

! rank mismatches

  !ERROR: Must be a scalar value, but is a rank-1 array
  lock(lock_array)

  !ERROR: Must be a scalar value, but is a rank-1 array
  lock(lock_var, acquired_lock=bool_array)

  !ERROR: Must be a scalar value, but is a rank-1 array
  lock(lock_var, stat=stat_array)

  !ERROR: Must be a scalar value, but is a rank-1 array
  lock(lock_var, errmsg=msg_array)

! corank mismatch

  !ERROR: to be determined
  lock(non_coarray_lock)

! C1173 - stat-variable and errmsg-variable shall not be a coindexed object

  !ERROR: to be determined
  lock(lock_var, stat=coindexed_int[1])

  !ERROR: to be determined
  lock(lock_var, errmsg=coindexed_msg[1])

  !ERROR: to be determined
  lock(lock_var, acquired_lock=coindexed_logical[1], stat=coindexed_int[1], errmsg=coindexed_msg[1])

! C1181 - No specifier shall appear more than once in a given lock-stat-list

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, acquired_lock=repeated_bool)

  !ERROR: to be determined
  lock(lock_var, stat=status, stat=repeated_stat)

  !ERROR: to be determined
  lock(lock_var, errmsg=error_message, errmsg=repeated_msg)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, acquired_lock=repeated_bool)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, stat=repeated_stat)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, errmsg=repeated_msg)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, acquired_lock=repeated_bool, stat=repeated_stat)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, acquired_lock=repeated_bool, errmsg=repeated_msg)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, stat=repeated_stat, errmsg=repeated_msg)

  !ERROR: to be determined
  lock(lock_var, acquired_lock=bool, stat=status, errmsg=error_message, acquired_lock=repeated_bool, stat=repeated_stat, errmsg=repeated_msg)

end program test_lock_stmt