2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_with_arrayspec_1.f90
blob686b612408a640fde43f027687cdc68e7dda976a
1 ! { dg-do run }
2 ! { dg-options "-fdump-tree-original" }
4 MODULE mo_test
6 integer :: n = 0
7 CONTAINS
9 FUNCTION nquery()
10 INTEGER :: nquery
11 WRITE (0,*) "hello!"
12 n = n + 1
13 nquery = n
14 END FUNCTION nquery
16 END MODULE mo_test
19 ! ----------------------------------------------------------------------
20 ! MAIN PROGRAM
21 ! ----------------------------------------------------------------------
22 PROGRAM example
23 USE mo_test
24 INTEGER, ALLOCATABLE :: query_buf(:)
25 ALLOCATE(query_buf(nquery()))
26 if (n /= 1 .or. size(query_buf) /= n) call abort()
27 END PROGRAM example
29 ! { dg-final { scan-tree-dump-times "nquery" 5 "original" } }