gcc/testsuite/gfortran.dg/value_8.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! PR97491 - Wrong restriction for VALUE arguments of pure procedures |
| 3 | |
| 4 | pure function foo (x) result (ret) |
| 5 | integer :: ret |
| 6 | integer, value :: x |
| 7 | x = x / 2 |
| 8 | ret = x |
| 9 | end function foo |
| 10 | |
| 11 | elemental function foo1 (x) |
| 12 | integer :: foo1 |
| 13 | integer, value :: x |
| 14 | x = x / 2 |
| 15 | foo1 = x |
| 16 | end function foo1 |