1
1
! RUN: %python %S/test_errors.py %s %flang_fc1
2
- ! XFAIL: *
3
2
! This test checks for semantic errors in event_query() subroutine based on the
4
3
! statement specification in section 16.9.72 of the Fortran 2018 standard.
5
4
6
5
program test_event_query
7
6
use iso_fortran_env, only : event_type
8
- implicit none
9
-
10
- ! event_type variables must be coarrays
11
- type (event_type) non_coarray
7
+ implicit none (type,external )
12
8
13
9
type (event_type) concert[* ], occurrences(2 )[* ]
14
10
integer non_event[* ], counter, array(1 ), coarray[* ], sync_status, coindexed[* ], non_scalar(1 )
@@ -33,70 +29,90 @@ program test_event_query
33
29
! ___ non-standard-conforming calls _______
34
30
35
31
! event-variable must be event_type
32
+ ! ERROR: Actual argument for 'event=' has bad type 'INTEGER(4)'
36
33
call event_query(non_event, counter)
37
34
38
- ! event-variable must be a coarray
39
- call event_query(non_coarray, counter)
40
-
41
35
! event-variable must be a scalar variable
36
+ ! ERROR: 'event=' argument has unacceptable rank 1
42
37
call event_query(occurrences, counter)
43
38
44
39
! event-variable must not be coindexed
40
+ ! ERROR: EVENT= argument to EVENT_QUERY must not be coindexed
45
41
call event_query(concert[1 ], counter)
46
42
47
43
! event-variable has an unknown keyword argument
44
+ ! ERROR: unknown keyword argument to intrinsic 'event_query'
48
45
call event_query(events= concert, count= counter)
49
46
50
47
! event-variable has an argument mismatch
48
+ ! ERROR: Actual argument for 'event=' has bad type 'INTEGER(4)'
51
49
call event_query(event= non_event, count= counter)
52
50
53
51
! count must be an integer
52
+ ! ERROR: Actual argument for 'count=' has bad type 'LOGICAL(4)'
54
53
call event_query(concert, non_integer)
55
54
56
55
! count must be an integer scalar
56
+ ! ERROR: 'count=' argument has unacceptable rank 1
57
57
call event_query(concert, non_scalar)
58
58
59
59
! count must be have a decimal exponent range
60
60
! no smaller than that of default integer
61
+ ! ERROR: COUNT= argument to EVENT_QUERY must be an integer with kind >= 4
61
62
call event_query(concert, non_default)
62
63
63
64
! count is an intent(out) argument
65
+ ! ERROR: Actual argument associated with INTENT(OUT) dummy argument 'count=' is not definable
66
+ ! ERROR: '4_4' is not a variable or pointer
64
67
call event_query(concert, 4 )
65
68
66
69
! count has an unknown keyword argument
70
+ ! ERROR: unknown keyword argument to intrinsic 'event_query'
67
71
call event_query(concert, counts= counter)
68
72
69
73
! count has an argument mismatch
74
+ ! ERROR: Actual argument for 'count=' has bad type 'LOGICAL(4)'
70
75
call event_query(concert, count= non_integer)
71
76
72
77
! stat must be an integer
78
+ ! ERROR: Actual argument for 'stat=' has bad type 'LOGICAL(4)'
73
79
call event_query(concert, counter, non_integer)
74
80
75
81
! stat must be an integer scalar
82
+ ! ERROR: 'stat=' argument has unacceptable rank 1
76
83
call event_query(concert, counter, non_scalar)
77
84
78
85
! stat is an intent(out) argument
86
+ ! ERROR: Actual argument associated with INTENT(OUT) dummy argument 'stat=' is not definable
87
+ ! ERROR: '8_4' is not a variable or pointer
79
88
call event_query(concert, counter, 8 )
80
89
81
90
! stat has an unknown keyword argument
91
+ ! ERROR: unknown keyword argument to intrinsic 'event_query'
82
92
call event_query(concert, counter, status= sync_status)
83
93
84
94
! stat has an argument mismatch
95
+ ! ERROR: Actual argument for 'stat=' has bad type 'LOGICAL(4)'
85
96
call event_query(concert, counter, stat= non_integer)
86
97
87
98
! stat must not be coindexed
99
+ ! ERROR: 'stat' argument to 'event_query' may not be a coindexed object
88
100
call event_query(concert, counter, coindexed[1 ])
89
101
90
102
! Too many arguments
103
+ ! ERROR: too many actual arguments for intrinsic 'event_query'
91
104
call event_query(concert, counter, sync_status, array(1 ))
92
105
93
106
! Repeated event keyword
107
+ ! ERROR: repeated keyword argument to intrinsic 'event_query'
94
108
call event_query(event= concert, event= occurrences(1 ), count= counter)
95
109
96
110
! Repeated count keyword
111
+ ! ERROR: repeated keyword argument to intrinsic 'event_query'
97
112
call event_query(event= concert, count= counter, count= array(1 ))
98
113
99
114
! Repeated stat keyword
115
+ ! ERROR: repeated keyword argument to intrinsic 'event_query'
100
116
call event_query(event= concert, count= counter, stat= sync_status, stat= array(1 ))
101
117
102
118
end program test_event_query
0 commit comments