43 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Tests for the putenv intrinsics.3 4subroutine bad_kind_error(str, status)5 CHARACTER(len=255) :: str6 INTEGER(2) :: status7 !ERROR: Actual argument for 'status=' has bad type or kind 'INTEGER(2)'8 call putenv(str, status)9end subroutine bad_kind_error10 11subroutine bad_args_error()12 !ERROR: missing mandatory 'str=' argument13 call putenv()14end subroutine bad_args_error15 16subroutine bad_function(str)17 CHARACTER(len=255) :: str18 INTEGER :: status19 call putenv(str, status)20 !ERROR: Cannot call subroutine 'putenv' like a function21 status = putenv(str)22end subroutine bad_function23 24subroutine bad_sub(str)25 CHARACTER(len=255) :: str26 INTEGER :: status27 status = putenv(str)28 !ERROR: Cannot call function 'putenv' like a subroutine29 call putenv(str, status)30end subroutine bad_sub31 32subroutine good_subroutine(str, status)33 CHARACTER(len=255) :: str34 INTEGER :: status35 call putenv(str, status)36end subroutine good_subroutine37 38subroutine good_function(str, status)39 CHARACTER(len=255) :: str40 INTEGER :: status41 status = putenv(str)42end subroutine good_function43