OSDN Git Service

2010-04-24 Kai Tietz <kai.tietz@onevision.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / volatile8.f90
1 ! Check for compatibily of actual arguments
2 ! with dummy arguments marked as volatile
3
4 ! Contributed by Steven Correll.
5 !
6 ! PR fortran/30520
7
8 ! { dg-do compile }
9
10    subroutine s8()
11     implicit none
12     interface
13       subroutine sub8(dummy8)
14         integer, volatile, dimension(3) :: dummy8
15       end subroutine sub8
16       subroutine sub8a(dummy8a)
17         integer, volatile, dimension(:) :: dummy8a
18       end subroutine sub8a
19     end interface
20     integer, dimension(8) :: a
21     call sub8 (a(1:5:2)) ! { dg-error "Array-section actual argument" }
22     call sub8a(a(1:5:2))
23   end subroutine s8 
24
25   subroutine s9(s9dummy)
26     implicit none
27     integer, dimension(:) :: s9dummy
28     interface
29       subroutine sub9(dummy9)
30         integer, volatile, dimension(3) :: dummy9
31       end subroutine sub9
32       subroutine sub9a(dummy9a)
33         integer, volatile, dimension(:) :: dummy9a
34       end subroutine sub9a
35     end interface
36     integer, dimension(9) :: a
37     call sub9 (s9dummy) ! { dg-error "Assumed-shape actual argument" }
38     call sub9a(s9dummy)
39   end subroutine s9 
40
41   subroutine s10()
42     implicit none
43     interface
44       subroutine sub10(dummy10)
45         integer, volatile, dimension(3) :: dummy10
46       end subroutine sub10
47       subroutine sub10a(dummy10a)
48         integer, volatile, dimension(:) :: dummy10a
49       end subroutine sub10a
50       subroutine sub10b(dummy10b)
51         integer, volatile, dimension(:), pointer :: dummy10b
52       end subroutine sub10b
53     end interface
54     integer, dimension(:), pointer :: a
55     call sub10 (a) ! { dg-error "Pointer-array actual argument" }
56     call sub10a(a)
57     call sub10b(a)
58   end subroutine s10