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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! PR 20851
3
! Dummy arguments are disallowed in initialization expressions in
4
! elemental functions except as arguments to the intrinsic functions
5
! BIT_SIZE, KIND, LEN, or to the numeric inquiry functions listed
6
! in 13.11.8
7
MODULE TT
8
INTEGER M
9
CONTAINS
10
   ELEMENTAL REAL FUNCTION two(N)
11
     INTEGER, INTENT(IN) :: N
12
     INTEGER, DIMENSION(N) :: scr ! { dg-error "Dummy argument 'n' not allowed in expression" }
13
   END FUNCTION
14
 
15
   ELEMENTAL REAL FUNCTION twopointfive(N)
16
     INTEGER, INTENT(IN) :: N
17
     INTEGER, DIMENSION(MAX(N,2)) :: scr ! { dg-error "Dummy argument 'n' not allowed in expression" }
18
   end FUNCTION twopointfive
19
 
20
   REAL FUNCTION three(N)
21
     INTEGER, INTENT(IN) :: N
22
     INTEGER, DIMENSION(N) :: scr ! this time it's valid
23
   END FUNCTION
24
 
25
   ELEMENTAL REAL FUNCTION four(N)
26
     INTEGER, INTENT(IN) :: N
27
     INTEGER, DIMENSION(bit_size(N)) :: scr ! another valid variant
28
   END FUNCTION
29
 
30
   ELEMENTAL REAL FUNCTION gofourit(N)
31
     INTEGER, INTENT(IN) :: N
32
     INTEGER, DIMENSION(MIN(HUGE(N),1)) :: scr ! another valid variant
33
   END FUNCTION
34
 
35
   ELEMENTAL REAL FUNCTION fourplusone(N)
36
     INTEGER, INTENT(IN) :: N
37
     INTEGER, DIMENSION(M) :: scr ! another valid variant
38
   END FUNCTION
39
 
40
   ELEMENTAL REAL FUNCTION five(X)
41
     real, intent(in) :: x
42
     CHARACTER(LEN=PRECISION(X)) :: C ! valid again
43
   END FUNCTION
44
END MODULE
45
END

powered by: WebSVN 2.1.0

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