OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_usage_17.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-additional-sources bind_c_usage_17_c.c }
3
!
4
! PR fortran/37201
5
!
6
!
7
!
8
MODULE mod
9
  INTERFACE
10
    FUNCTION cdir() BIND(C,name="cdir") RESULT(r)
11
      USE iso_c_binding
12
      CHARACTER(kind=C_CHAR) :: r
13
    END FUNCTION
14
  END INTERFACE
15
END MODULE
16
 
17
PROGRAM test
18
  USE mod
19
  integer :: i = -43
20
  character(len=1) :: str1
21
  character(len=4) :: str4
22
  str1 = 'x'
23
  str4 = 'xyzz'
24
  str1 = cdir()
25
  if(str1 /= '/') call abort()
26
  str4 = cdir()
27
  if(str4 /= '/' .or. ichar(str4(2:2)) /= 32) call abort()
28
  i   = ICHAR(cdir())
29
  if (i /= 47) call abort()
30
  str4 = 'xyzz'
31
  WRITE(str4,'(a)') cdir()
32
  if(str4 /= '/' .or. ichar(str4(2:2)) /= 32) call abort()
33
  str4 = 'xyzz'
34
  WRITE(str4,'(i0)') ICHAR(cdir())
35
  if(str4 /= '47' .or. ichar(str4(3:3)) /= 32) call abort()
36
END PROGRAM
37
 
38
! { dg-final { cleanup-modules "mod" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.