annotate gcc/testsuite/gfortran.dg/volatile5.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! { dg-options "-O3 -fdump-tree-optimized" }
kono
parents:
diff changeset
3 ! Tests whether volatile really works with modules
kono
parents:
diff changeset
4 ! PR fortran/29601
kono
parents:
diff changeset
5 module volmod
kono
parents:
diff changeset
6 implicit none
kono
parents:
diff changeset
7 integer, volatile :: a
kono
parents:
diff changeset
8 logical :: b,c
kono
parents:
diff changeset
9 volatile :: b
kono
parents:
diff changeset
10 contains
kono
parents:
diff changeset
11 subroutine sample
kono
parents:
diff changeset
12 a = 33.
kono
parents:
diff changeset
13 if(a /= 432) print *,'aPresent'
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 b = .false.
kono
parents:
diff changeset
16 if(b) print *,'bPresent'
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 c = .false.
kono
parents:
diff changeset
19 if(c) print *,'cPresent'
kono
parents:
diff changeset
20 end subroutine sample
kono
parents:
diff changeset
21 end module volmod
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 program main
kono
parents:
diff changeset
24 use volmod
kono
parents:
diff changeset
25 implicit none
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 a = 432
kono
parents:
diff changeset
28 if(a /= 432) print *,'aStillPresent'
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 b = .false.
kono
parents:
diff changeset
31 if(b) print *,'bStillPresent'
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 c = .false.
kono
parents:
diff changeset
34 if(c) print *,'cStillPresent'
kono
parents:
diff changeset
35 end program main
kono
parents:
diff changeset
36 ! { dg-final { scan-tree-dump "aPresent" "optimized" } }
kono
parents:
diff changeset
37 ! { dg-final { scan-tree-dump "bPresent" "optimized" } }
kono
parents:
diff changeset
38 ! { dg-final { scan-tree-dump "aStillPresent" "optimized" } }
kono
parents:
diff changeset
39 ! { dg-final { scan-tree-dump "bStillPresent" "optimized" } }
kono
parents:
diff changeset
40 ! { dg-final { scan-tree-dump-not "cPresent" "optimized" } }
kono
parents:
diff changeset
41 ! { dg-final { scan-tree-dump-not "cStillPresent" "optimized" } }