2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / conflicts.f90
blobd17cb041db6dbe6e1e9610657801279aa4a30cd6
1 ! { dg-do compile }
2 ! Check for conflicts
3 ! PR fortran/29657
5 function f1() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
6 implicit none
7 real, save :: f1
8 f1 = 1.0
9 end function f1
11 function f2() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
12 implicit none
13 real :: f2
14 save f2
15 f2 = 1.0
16 end function f2
18 subroutine f3()
19 implicit none
20 dimension f3(3) ! { dg-error "SUBROUTINE attribute conflicts with DIMENSION attribute" }
21 end subroutine f3
23 subroutine f4(b)
24 implicit none
25 real :: b
26 entry b ! { dg-error "DUMMY attribute conflicts with ENTRY attribute" }
27 end subroutine f4
29 function f5(a)
30 implicit none
31 real :: a,f5
32 entry a ! { dg-error "DUMMY attribute conflicts with ENTRY attribute" }
33 f5 = 3.4
34 end function f5
36 subroutine f6(cos)
37 implicit none
38 real :: cos
39 intrinsic cos ! { dg-error "DUMMY attribute conflicts with INTRINSIC attribute" }
40 end subroutine f6
42 subroutine f7(sin)
43 implicit none
44 real :: sin
45 external sin
46 end subroutine f7
48 program test
49 implicit none
50 dimension test(3) ! { dg-error "PROGRAM attribute conflicts with DIMENSION attribute" }
51 end program test