PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / volatile5.f90
blob180f513c5c56441fb92cc09225b4502873854ae0
1 ! { dg-do compile }
2 ! { dg-options "-O3 -fdump-tree-optimized" }
3 ! Tests whether volatile really works with modules
4 ! PR fortran/29601
5 module volmod
6 implicit none
7 integer, volatile :: a
8 logical :: b,c
9 volatile :: b
10 contains
11 subroutine sample
12 a = 33.
13 if(a /= 432) print *,'aPresent'
15 b = .false.
16 if(b) print *,'bPresent'
18 c = .false.
19 if(c) print *,'cPresent'
20 end subroutine sample
21 end module volmod
23 program main
24 use volmod
25 implicit none
27 a = 432
28 if(a /= 432) print *,'aStillPresent'
30 b = .false.
31 if(b) print *,'bStillPresent'
33 c = .false.
34 if(c) print *,'cStillPresent'
35 end program main
36 ! { dg-final { scan-tree-dump "aPresent" "optimized" } }
37 ! { dg-final { scan-tree-dump "bPresent" "optimized" } }
38 ! { dg-final { scan-tree-dump "aStillPresent" "optimized" } }
39 ! { dg-final { scan-tree-dump "bStillPresent" "optimized" } }
40 ! { dg-final { scan-tree-dump-not "cPresent" "optimized" } }
41 ! { dg-final { scan-tree-dump-not "cStillPresent" "optimized" } }