brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · a536f62 Raw
73 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror2! Test warnings on mismatching interfaces involvingCHARACTER arguments3subroutine constLen(s)4  character(len = 1) s5end6subroutine assumedLen(s)7  character(len = *) s8end9subroutine exprLen(s)10  common n11  character(len = n) s12end13 14module m015  interface ! these are all OK16    subroutine constLen(s)17      character(len=1) s18    end19    subroutine assumedLen(s)20      character(len=*) s21    end22    subroutine exprLen(s)23      common n24      character(len=n) s25    end26  end interface27end28 29module m130  interface31    !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: CHARACTER(KIND=1,LEN=1_8) vs CHARACTER(KIND=1,LEN=2_8)) [-Wexternal-interface-mismatch]32    subroutine constLen(s)33      character(len=2) s34    end35    !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch]36    subroutine assumedLen(s)37      character(len=2) s38    end39    !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) [-Wexternal-interface-mismatch]40    subroutine exprLen(s)41      character(len=2) s42    end43  end interface44end45 46module m247  interface48    !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch]49    subroutine constLen(s)50      character(len=*) s51    end52    !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch]53    subroutine exprLen(s)54      character(len=*) s55    end56  end interface57end58 59module m360  interface61    !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) [-Wexternal-interface-mismatch]62    subroutine constLen(s)63      common n64      character(len=n) s65    end66    !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch]67    subroutine assumedLen(s)68      common n69      character(len=n) s70    end71  end interface72end73