2 ! { dg-options "-fno-automatic -finit-local-zero -fdump-tree-original" }
6 ! Make sure variables are saved with -fno-automatic except in
7 ! functions marked RECURSIVE, and that they are still initialized with
14 integer a
! should be SAVEd
15 a
= a
+ x
! should increment by y every time
26 integer a
! should be SAVEd
27 a
= a
+ x
! should increment by y every time
35 recursive function g (x
)
38 integer b
! should be automatic
39 b
= b
+ x
! should be set to y every time
44 recursive function g2 (x
)
50 integer b
! should be automatic
51 b
= b
+ x
! should be set to y every time
62 ! Should return static value of a; accumulates y
63 if ( f(3) .ne
. 3 ) STOP 1
64 if ( f(4) .ne
. 7 ) STOP 2
65 if ( f(2) .ne
. 9 ) STOP 3
67 if ( f2(3) .ne
. 3 ) STOP 4
68 if ( f2(4) .ne
. 7 ) STOP 5
69 if ( f2(2) .ne
. 9 ) STOP 6
71 ! Should return automatic value of a; equal to y each time
72 if ( g(3) .ne
. 3 ) STOP 7
73 if ( g(4) .ne
. 4 ) STOP 8
74 if ( g(2) .ne
. 2 ) STOP 9
76 if ( g2(3) .ne
. 3 ) STOP 10
77 if ( g2(4) .ne
. 4 ) STOP 11
78 if ( g2(2) .ne
. 2 ) STOP 12
82 ! { dg-final { scan-tree-dump-times " static integer\\\(kind=4\\\) a = 0;" 2 "original" } }
83 ! { dg-final { scan-tree-dump-times " b = 0;" 2 "original" } }