brintos

brintos / llvm-project-archived public Read only

0
0
Text · 962 B · b6ff16e Raw
35 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Tests for the GETCWD intrinsics3 4subroutine bad_kind_error(cwd, status)5  CHARACTER(len=255) :: cwd6  INTEGER(2) :: status7  !ERROR: Actual argument for 'status=' has bad type or kind 'INTEGER(2)'8  call getcwd(cwd, status)9end subroutine bad_kind_error10  11subroutine bad_args_error()12  !ERROR: missing mandatory 'c=' argument13  call getcwd()14end subroutine bad_args_error15 16subroutine bad_apply_form(cwd)17  CHARACTER(len=255) :: cwd18  INTEGER :: status19  !Declaration of 'getcwd'20  call getcwd(cwd, status)21  !ERROR: Cannot call subroutine 'getcwd' like a function22  status = getcwd(cwd)23end subroutine bad_apply_form24 25subroutine good_subroutine(cwd, status)26  CHARACTER(len=255) :: cwd27  INTEGER :: status28  call getcwd(cwd, status)29end subroutine good_subroutine30 31subroutine good_function(cwd, status)32  CHARACTER(len=255) :: cwd33  INTEGER :: status34  status = getcwd(cwd)35end subroutine good_function