annotate gcc/testsuite/gfortran.dg/volatile3.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
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-shouldfail "Invalid use of VOLATILE" }
kono
parents:
diff changeset
3 ! Test whether volatile statements and attributes are
kono
parents:
diff changeset
4 ! properly error checked.
kono
parents:
diff changeset
5 ! PR fortran/29601
kono
parents:
diff changeset
6 program volatile_test
kono
parents:
diff changeset
7 implicit none
kono
parents:
diff changeset
8 real, external, volatile :: foo ! { dg-error "VOLATILE attribute conflicts with EXTERNAL attribute" }
kono
parents:
diff changeset
9 real, intrinsic, volatile :: sin ! { dg-error "VOLATILE attribute conflicts with INTRINSIC attribute" }
kono
parents:
diff changeset
10 real, parameter, volatile :: r = 5.5 ! { dg-error "PARAMETER attribute conflicts with VOLATILE attribute" }
kono
parents:
diff changeset
11 real :: l,m
kono
parents:
diff changeset
12 real,volatile :: n
kono
parents:
diff changeset
13 real, volatile,volatile :: r = 3. ! { dg-error "Duplicate VOLATILE attribute" }
kono
parents:
diff changeset
14 volatile :: l,n ! { dg-warning "Duplicate VOLATILE attribute" }
kono
parents:
diff changeset
15 volatile ! { dg-error "Syntax error in VOLATILE statement" }
kono
parents:
diff changeset
16 volatile :: volatile_test ! { dg-error "PROGRAM attribute conflicts with VOLATILE attribute" }
kono
parents:
diff changeset
17 l = 4.0
kono
parents:
diff changeset
18 m = 3.0
kono
parents:
diff changeset
19 contains
kono
parents:
diff changeset
20 subroutine foo(a) ! { dg-error "has no IMPLICIT type" } ! due to error below
kono
parents:
diff changeset
21 integer, intent(in), volatile :: a ! { dg-error "VOLATILE attribute conflicts with INTENT\\(IN\\)" }
kono
parents:
diff changeset
22 end subroutine
kono
parents:
diff changeset
23 end program volatile_test