annotate gcc/testsuite/gfortran.dg/value_3.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 ! Tests the constraints in the patch for PR29642, which requested the
kono
parents:
diff changeset
3 ! implementation of the F2003 VALUE attribute for gfortran.
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 program test_value
kono
parents:
diff changeset
8 integer(8) :: i = 42, j ! { dg-error "not a dummy" }
kono
parents:
diff changeset
9 integer(8), value :: k ! { dg-error "not a dummy" }
kono
parents:
diff changeset
10 value :: j
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 contains
kono
parents:
diff changeset
13 subroutine bar_1 (i)
kono
parents:
diff changeset
14 integer(8) :: i
kono
parents:
diff changeset
15 dimension i(8)
kono
parents:
diff changeset
16 value :: i ! { dg-error "conflicts with DIMENSION" }
kono
parents:
diff changeset
17 i = 0
kono
parents:
diff changeset
18 end subroutine bar_1
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 subroutine bar_2 (i)
kono
parents:
diff changeset
21 integer(8) :: i
kono
parents:
diff changeset
22 pointer :: i
kono
parents:
diff changeset
23 value :: i ! { dg-error "conflicts with POINTER" }
kono
parents:
diff changeset
24 i = 0
kono
parents:
diff changeset
25 end subroutine bar_2
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 integer function bar_3 (i)
kono
parents:
diff changeset
28 integer(8) :: i
kono
parents:
diff changeset
29 dimension i(8)
kono
parents:
diff changeset
30 value :: bar_3 ! { dg-error "conflicts with FUNCTION" }
kono
parents:
diff changeset
31 i = 0
kono
parents:
diff changeset
32 bar_3 = 0
kono
parents:
diff changeset
33 end function bar_3
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 subroutine bar_4 (i, j)
kono
parents:
diff changeset
36 integer(8), intent(inout) :: i
kono
parents:
diff changeset
37 integer(8), intent(out) :: j
kono
parents:
diff changeset
38 value :: i ! { dg-error "conflicts with INTENT" }
kono
parents:
diff changeset
39 value :: j ! { dg-error "conflicts with INTENT" }
kono
parents:
diff changeset
40 i = 0
kono
parents:
diff changeset
41 j = 0
kono
parents:
diff changeset
42 end subroutine bar_4
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 integer function bar_5 ()
kono
parents:
diff changeset
45 integer(8) :: i
kono
parents:
diff changeset
46 external :: i
kono
parents:
diff changeset
47 integer, parameter :: j = 99
kono
parents:
diff changeset
48 value :: i ! { dg-error "conflicts with EXTERNAL" }
kono
parents:
diff changeset
49 value :: j ! { dg-error "PARAMETER attribute conflicts with" }
kono
parents:
diff changeset
50 bar_5 = 0
kono
parents:
diff changeset
51 end function bar_5
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 end program test_value