Add execution tests of ARM EXT intrinsics
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray / scalar_alloc_2.f90
blob50c3dfb2ea8ca10f58cf4161bb5ac9e4a1f13432
1 ! { dg-do run }
3 ! Check whether registering allocatable coarrays works
5 type position
6 real :: x, y, z
7 end type position
9 integer, allocatable :: a[:]
10 type(position), allocatable :: p[:]
12 allocate(a[*])
13 a = 7
15 allocate(p[*])
16 p%x = 11
17 p%y = 13
18 p%z = 15
20 if (a /= 7) call abort()
21 a = 88
22 if (a /= 88) call abort()
24 if (p%x /= 11) call abort()
25 p%x = 17
26 if (p%x /= 17) call abort()
28 block
29 integer, allocatable :: b[:]
31 allocate(b[*])
32 b = 8494
34 if (b /= 8494) call abort()
35 end block
37 if (a /= 88) call abort()
38 call test ()
39 end
41 subroutine test()
42 type velocity
43 real :: x, y, z
44 end type velocity
46 real, allocatable :: z[:]
47 type(velocity), allocatable :: v[:]
49 allocate(z[*])
50 z = sqrt(2.0)
52 allocate(v[*])
53 v%x = 21
54 v%y = 23
55 v%z = 25
57 if (z /= sqrt(2.0)) call abort()
58 if (v%x /= 21) call abort()
60 end subroutine test