2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / volatile7.f90
blob237a08c07a175f223961b8a7c8c59f9fd358399d
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" } }
16 ! { dg-final { cleanup-tree-dump "optimized" } }