Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/c1255a.f90

raw
1 ! { dg-do compile }
2 !
3 ! TS 29113
4 ! C1255a (R1230) A dummy argument of a procedure that has a
5 ! proc-language-binding-spec shall not have both the OPTIONAL and
6 ! VALUE attributes.
7 !
8 ! This file contains code that is expected to produce errors.
9
10 module m
11
12 interface
13
14 ! This one is OK.
15 subroutine s1 (x, y) bind (c)
16 use ISO_C_BINDING
17 implicit none
18 integer(C_INT) :: x
19 integer(C_INT), optional :: y
20 end subroutine
21
22 ! This one is OK too.
23 subroutine s2 (x, y) bind (c)
24 use ISO_C_BINDING
25 implicit none
26 integer(C_INT) :: x
27 integer(C_INT), value :: y
28 end subroutine
29
30 ! This one is bad.
31 subroutine s3 (x, y) bind (c) ! { dg-error "BIND\\(C\\)" }
32 use ISO_C_BINDING
33 implicit none
34 integer(C_INT) :: x
35 integer(C_INT), optional, value :: y
36 end subroutine
37
38 end interface
39
40 end module