111
|
1 ! { dg-do compile }
|
|
2 ! { dg-shouldfail "Invalid use of VOLATILE" }
|
|
3 ! Test whether volatile statements and attributes are
|
|
4 ! properly error checked.
|
|
5 ! PR fortran/29601
|
|
6 program volatile_test
|
|
7 implicit none
|
|
8 real, external, volatile :: foo ! { dg-error "VOLATILE attribute conflicts with EXTERNAL attribute" }
|
|
9 real, intrinsic, volatile :: sin ! { dg-error "VOLATILE attribute conflicts with INTRINSIC attribute" }
|
|
10 real, parameter, volatile :: r = 5.5 ! { dg-error "PARAMETER attribute conflicts with VOLATILE attribute" }
|
|
11 real :: l,m
|
|
12 real,volatile :: n
|
|
13 real, volatile,volatile :: r = 3. ! { dg-error "Duplicate VOLATILE attribute" }
|
|
14 volatile :: l,n ! { dg-warning "Duplicate VOLATILE attribute" }
|
|
15 volatile ! { dg-error "Syntax error in VOLATILE statement" }
|
|
16 volatile :: volatile_test ! { dg-error "PROGRAM attribute conflicts with VOLATILE attribute" }
|
|
17 l = 4.0
|
|
18 m = 3.0
|
|
19 contains
|
|
20 subroutine foo(a) ! { dg-error "has no IMPLICIT type" } ! due to error below
|
|
21 integer, intent(in), volatile :: a ! { dg-error "VOLATILE attribute conflicts with INTENT\\(IN\\)" }
|
|
22 end subroutine
|
|
23 end program volatile_test
|