2 ! { dg-options "-O2 -fdump-tree-optimized" }
3 ! Tests whether volatile really works for arrays
5 logical, allocatable
, volatile :: t1(:)
6 logical, allocatable
:: t2(:)
13 if(ubound(t1
,1) /= 1) print *, 'VolatileNotOptimizedAway1'
14 if(ubound(t2
,1) /= 1) print *, 'NonVolatileNotOptimizedAway1'
18 if(t1(1)) print *, 'VolatileNotOptimizedAway2'
20 if(t2(1)) print *, 'NonVolatileNotOptimizedAway2'
22 ! { dg-final { scan-tree-dump "VolatileNotOptimizedAway1" "optimized" } }
23 ! { dg-final { scan-tree-dump "VolatileNotOptimizedAway2" "optimized" } }
24 ! { dg-final { scan-tree-dump-not "NonVolatileNotOptimizedAway1" "optimized" } }
25 ! { dg-final { scan-tree-dump-not "NonVolatileNotOptimizedAway2" "optimized" } }
26 ! { dg-final { cleanup-tree-dump "optimized" } }