File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2
+ ! Tests for the GETCWD intrinsics
3
+
4
+ subroutine bad_kind_error (cwd , status )
5
+ CHARACTER (len= 255 ) :: cwd
6
+ INTEGER (2 ) :: status
7
+ ! ERROR: Actual argument for 'status=' has bad type or kind 'INTEGER(2)'
8
+ call getcwd(cwd, status)
9
+ end subroutine bad_kind_error
10
+
11
+ subroutine bad_args_error ()
12
+ ! ERROR: missing mandatory 'c=' argument
13
+ call getcwd()
14
+ end subroutine bad_args_error
15
+
16
+ subroutine bad_apply_form (cwd )
17
+ CHARACTER (len= 255 ) :: cwd
18
+ INTEGER :: status
19
+ ! Declaration of 'getcwd'
20
+ call getcwd(cwd, status)
21
+ ! ERROR: Cannot call subroutine 'getcwd' like a function
22
+ status = getcwd(cwd)
23
+ end subroutine bad_apply_form
24
+
25
+ subroutine good_subroutine (cwd , status )
26
+ CHARACTER (len= 255 ) :: cwd
27
+ INTEGER :: status
28
+ call getcwd(cwd, status)
29
+ end subroutine good_subroutine
30
+
31
+ subroutine good_function (cwd , status )
32
+ CHARACTER (len= 255 ) :: cwd
33
+ INTEGER :: status
34
+ status = getcwd(cwd)
35
+ end subroutine good_function
You can’t perform that action at this time.
0 commit comments