OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [structure_constructor_2.f03] - Rev 324

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do run }
! Structure constructor with component naming.

PROGRAM test
  IMPLICIT NONE

  ! Structure of basic data types
  TYPE :: basics_t
    INTEGER :: i
    REAL :: r
    COMPLEX :: c
    LOGICAL :: l
  END TYPE basics_t

  TYPE(basics_t) :: basics

  basics = basics_t (42, -1.5, c=(.5, .5), l=.FALSE.)
  IF (basics%i /= 42 .OR. basics%r /= -1.5 &
      .OR. basics%c /= (.5, .5) .OR. basics%l) THEN
    CALL abort()
  END IF

  basics = basics_t (r=-1.5, i=42, l=.FALSE., c=(.5, .5))
  IF (basics%i /= 42 .OR. basics%r /= -1.5 &
      .OR. basics%c /= (.5, .5) .OR. basics%l) THEN
    CALL abort()
  END IF

END PROGRAM test

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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