annotate gcc/testsuite/gfortran.dg/dec_parameter_1.f @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-options "-ffixed-form -std=legacy" }
kono
parents:
diff changeset
3 !
kono
parents:
diff changeset
4 ! Test DEC-style PARAMETER statements without parentheses in
kono
parents:
diff changeset
5 ! fixed form.
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 subroutine sub1(t, x, y)
kono
parents:
diff changeset
9 implicit real(8) (A-H,O-Z)
kono
parents:
diff changeset
10 parameter (pi_1 = 3.141592654d0, f_1 = 3.d08)
kono
parents:
diff changeset
11 parameter pi_2 = 3.141592654d0, f_2 = 3.d08
kono
parents:
diff changeset
12 ! Note that if the parameter statements above are matched
kono
parents:
diff changeset
13 ! incorrectly as assignments, the below specification
kono
parents:
diff changeset
14 ! statements will be considered out-of-order and we see
kono
parents:
diff changeset
15 ! 'unexpected specification statement'. A PARAMETER
kono
parents:
diff changeset
16 ! statement should still be a specification statement.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 real(8), intent(in) :: t
kono
parents:
diff changeset
19 real(8), intent(out) :: x, y
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 real(8), volatile :: two
kono
parents:
diff changeset
22 two = 2.0d0
kono
parents:
diff changeset
23 x = two * pi_1 * f_1 * t
kono
parents:
diff changeset
24 y = two * pi_2 * f_2 * t
kono
parents:
diff changeset
25 return
kono
parents:
diff changeset
26 end subroutine
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 subroutine sub2(t, x, y, z)
kono
parents:
diff changeset
29 implicit none
kono
parents:
diff changeset
30 real(8) :: pi_1, pi_2, f_1, f_2
kono
parents:
diff changeset
31 parameter (pi_1 = 3.141592654d0, f_1 = 3.d08)
kono
parents:
diff changeset
32 parameter pi_2 = 3.141592654d0, f_2 = 3.d08
kono
parents:
diff changeset
33 real(8), parameter :: pi_3 = 3.141592654d0, f_3 = 3.d08
kono
parents:
diff changeset
34 ! Ditto sub1
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 real(8), intent(in) :: t
kono
parents:
diff changeset
37 real(8), intent(out) :: x, y, z
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 real(8), volatile :: two
kono
parents:
diff changeset
40 two = 2.0d0
kono
parents:
diff changeset
41 x = two * pi_1 * f_1 * t
kono
parents:
diff changeset
42 y = two * pi_2 * f_2 * t
kono
parents:
diff changeset
43 z = two * pi_3 * f_3 * t
kono
parents:
diff changeset
44 end subroutine
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 implicit none
kono
parents:
diff changeset
47 real(8) :: x1, x2, y1, y2, z2
kono
parents:
diff changeset
48 real(8), volatile :: t
kono
parents:
diff changeset
49 t = 1.5e-6
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 call sub1(t, x1, y1)
kono
parents:
diff changeset
52 call sub2(t, x2, y2, z2)
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 write(*,'(4D18.5)') t, x1, y1
kono
parents:
diff changeset
55 write(*,'(4D18.5)') t, x2, y2, z2
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 if (x1 .ne. x2 .or. y1 .ne. y2
kono
parents:
diff changeset
58 & .or. x1 .ne. y1 .or. x2 .ne. y2
kono
parents:
diff changeset
59 & .or. y2 .ne. z2) then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
60 STOP 1
111
kono
parents:
diff changeset
61 endif
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 end