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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [implied_shape_3.f08] - Blame information for rev 749

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-std=f2008" }
3
 
4
! Test for errors with implied-shape declarations.
5
 
6
! Contributed by Daniel Kraft, d@domob.eu.
7
 
8
PROGRAM main
9
  IMPLICIT NONE
10
 
11
  INTEGER :: n
12
  INTEGER, PARAMETER :: mat(2, 2) = RESHAPE ((/ 1, 2, 3, 4 /), (/ 2, 2 /))
13
 
14
  ! Malformed declaration.
15
  INTEGER, PARAMETER :: arr1(*, *, 5) = mat ! { dg-error "Bad array specification for implied-shape array" }
16
 
17
  ! Rank mismatch in initialization.
18
  INTEGER, PARAMETER :: arr2(*, *) = (/ 1, 2, 3, 4 /) ! { dg-error "Incompatible ranks" }
19
 
20
  ! Non-PARAMETER implied-shape, with and without initializer.
21
  INTEGER :: arr3(*, *) ! { dg-error "Non-PARAMETER" }
22
  INTEGER :: arr4(*, *) = mat ! { dg-error "Non-PARAMETER" }
23
 
24
  ! Missing initializer.
25
  INTEGER, PARAMETER :: arr5(*) ! { dg-error "is missing an initializer" }
26
 
27
  ! Initialization from scalar.
28
  INTEGER, PARAMETER :: arr6(*) = 0 ! { dg-error "with scalar" }
29
 
30
  ! Automatic bounds.
31
  n = 2
32
  BLOCK
33
    INTEGER, PARAMETER :: arr7(n:*) = (/ 2, 3, 4 /) ! { dg-error "Non-constant lower bound" }
34
  END BLOCK
35
END PROGRAM main

powered by: WebSVN 2.1.0

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