Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / volatile7.f90
blobd032a6598b1c5f9827226a16b7089dbd223f30a9
1 ! { dg-do compile }
2 ! { dg-options "-O2 -fdump-tree-optimized" }
3 ! Tests whether volatile really works for pointers
4 ! PR fortran/29601
5 logical, pointer, volatile :: t1
6 logical, pointer :: t2
7 integer :: i
9 t1 => NULL(t1)
10 if(associated(t1)) print *, 'VolatileNotOptimizedAway'
11 t2 => NULL(t2)
12 if(associated(t2)) print *, 'NonVolatileNotOptimizedAway'
13 end
14 ! { dg-final { scan-tree-dump "VolatileNotOptimizedAway" "optimized" } }
15 ! { dg-final { scan-tree-dump-not "NonVolatileNotOptimizedAway" "optimized" } }