brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · e08e4f0 Raw
50 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Check for C1553 and 18.3.4(1)3 4function func1() result(res) bind(c)5  ! ERROR: Interoperable function result may not have ALLOCATABLE or POINTER attribute6  integer, pointer :: res7end8 9function func2() result(res) bind(c)10  ! ERROR: Interoperable function result may not have ALLOCATABLE or POINTER attribute11  integer, allocatable :: res12end13 14function func3() result(res) bind(c)15  !ERROR: Interoperable function result must be scalar16  integer :: res(2)17end18 19function func4() result(res) bind(c)20  ! ERROR: Interoperable character function result must have length one21  character(*) :: res22end23 24function func5(n) result(res) bind(c)25  integer :: n26  ! ERROR: Interoperable character function result must have length one27  character(n) :: res28end29 30function func6() result(res) bind(c)31  ! ERROR: Interoperable character function result must have length one32  character(2) :: res33end34 35function func7() result(res) bind(c)36  integer, parameter :: n = 137  character(n) :: res ! OK38end39 40function func8() result(res) bind(c)41  ! ERROR: Interoperable function result may not have ALLOCATABLE or POINTER attribute42  ! ERROR: Interoperable character function result must have length one43  character(:), pointer :: res44end45 46function func9() result(res) bind(c)47  ! ERROR: Function result may not be a coarray48  integer :: res[10, *]49end50