Debian Codegraph @

gcc/testsuite/gfortran.fortran-torture/execute/st_function_2.f90

raw
1 ! PR15620
2 ! Check that evaluating a statement function doesn't affect the value of
3 ! its dummy argument variables.
4 program st_function_2
5 integer fn, a, b
6 fn(a, b) = a + b
7 if (foo(1) .ne. 43) STOP 1
8
9 ! Check that values aren't modified when avaluating the arguments.
10 a = 1
11 b = 5
12 if (fn (b + 2, a + 3) .ne. 11) STOP 2
13 contains
14 function foo (x)
15 integer z, y, foo, x
16 bar(z) = z*z
17 z = 42
18 t = bar(x)
19 foo = t + z
20 end function
21 end program