Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gfortran.dg / winapi.f90
blob0ee3920ff947944c43642229e07db12109312228
1 ! { dg-do run { target *-*-cygwin* *-*-mingw* } }
2 ! { dg-options "-lkernel32" }
3 ! Test case provided by Dennis Wassel.
5 PROGRAM winapi
7 USE, INTRINSIC :: iso_c_binding
8 IMPLICIT NONE
10 INTERFACE
11 ! Specifically select the lstrlenA version for ASCII.
12 FUNCTION lstrlen(string) BIND(C, name = "lstrlenA")
13 USE, INTRINSIC :: iso_c_binding
14 IMPLICIT NONE
15 !GCC$ ATTRIBUTES STDCALL :: lstrlen
16 INTEGER (C_INT) :: lstrlen
17 CHARACTER(KIND=C_CHAR), INTENT(in) :: string(*)
18 END FUNCTION lstrlen
19 END INTERFACE
21 IF (lstrlen(C_CHAR_"winapi"//C_NULL_CHAR) /= 6) CALL abort()
23 END PROGRAM winapi