OSDN Git Service

2009-08-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 02:35:32 +0000 (02:35 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 02:35:32 +0000 (02:35 +0000)
PR fortran/40955
* gfortran.dg/winapi.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150733 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/winapi.f90 [new file with mode: 0644]

index 6719220..bb136c5 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-13  Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+       PR fortran/40955
+       * gfortran.dg/winapi.f90: New test.
+
 2009-08-13  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/40995
diff --git a/gcc/testsuite/gfortran.dg/winapi.f90 b/gcc/testsuite/gfortran.dg/winapi.f90
new file mode 100644 (file)
index 0000000..0ee3920
--- /dev/null
@@ -0,0 +1,23 @@
+! { dg-do run { target *-*-cygwin* *-*-mingw* } }
+! { dg-options "-lkernel32" }
+! Test case provided by Dennis Wassel.
+
+PROGRAM winapi
+
+  USE, INTRINSIC :: iso_c_binding
+  IMPLICIT NONE
+
+  INTERFACE
+     ! Specifically select the lstrlenA version for ASCII.
+     FUNCTION lstrlen(string) BIND(C, name = "lstrlenA")
+       USE, INTRINSIC :: iso_c_binding
+       IMPLICIT NONE
+       !GCC$ ATTRIBUTES STDCALL :: lstrlen
+       INTEGER (C_INT)          :: lstrlen
+       CHARACTER(KIND=C_CHAR), INTENT(in) :: string(*)
+     END FUNCTION lstrlen
+  END INTERFACE
+  
+  IF (lstrlen(C_CHAR_"winapi"//C_NULL_CHAR) /= 6) CALL abort()
+
+END PROGRAM winapi