modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr102458.f90
blob555e4978fdb1cf5e1b16db39267e9434a649b0a1
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=lib" }
3 ! PR fortran/102458 - standard intrinsics excluded in constant expressions
5 subroutine s1
6 integer :: a(command_argument_count()) = 1 ! { dg-error "Automatic array" }
7 print *, a
8 end
10 program p
11 block
12 integer :: a(get_team()) = 1 ! { dg-error "Automatic array" }
13 print *, a
14 end block
15 end
17 subroutine s2
18 integer :: a(num_images()) = 1 ! { dg-error "Automatic array" }
19 print *, a
20 end
22 function f()
23 block
24 integer :: a(team_number()) = 0 ! { dg-error "Automatic array" }
25 a = 1
26 end block
27 end
29 subroutine s3
30 integer :: a(this_image()) = 1 ! { dg-error "Automatic array" }
31 print *, a
32 end
34 subroutine s4
35 integer, parameter :: n = 4
36 integer, parameter :: x(transfer(n, n)) = 1 ! legal
37 integer :: y(transfer(n, n)) = 2 ! legal
38 integer, parameter :: k = size (x) ! ok
39 ! integer, parameter :: m = size (y) ! fails, tracked separately
40 print *, k, x, y
41 if (k /= size (y)) stop 1
42 end