hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr91497_2.f90
blob28aa4bd1872f166d31b06971be8eb19bdfce68d9
1 ! { dg-do compile }
2 ! { dg-options "-Wall" }
3 ! Code contributed by Manfred Schwarb <manfred99 at gmx dot ch>
4 ! PR fortran/91497
6 ! Prior to applying the patch for this PR, the following code
7 ! would generate numerous conversion warnings.
8 ! Additional test case to cover all targets.
10 program foo
12 real(4) a, aa
13 real(8) b, bb
14 integer(2) e, ee
15 integer(4) f, ff
16 integer(8) g, gg
17 complex(4) ww
18 complex(8) xx
19 PARAMETER(a=3.1415927_4)
20 PARAMETER(b=3.1415927_8)
21 PARAMETER(e=123_2)
22 PARAMETER(f=123_4)
23 PARAMETER(g=123_8)
25 aa=REAL(b) ! was: Change of value in conversion from 'REAL(8)' to 'REAL(4)'
26 aa=REAL(e)
27 aa=REAL(f)
28 aa=REAL(g)
29 aa=REAL(b, kind=4) ! was: Change of value in conversion from 'REAL(8)' to 'REAL(4)'
30 bb=REAL(a, kind=8)
32 aa=FLOAT(f)
33 bb=DFLOAT(g)
34 aa=SNGL(b) ! was: Change of value in conversion from 'REAL(8)' to 'REAL(4)'
35 aa=AINT(a)
36 bb=AINT(b)
37 aa=AINT(b, kind=4)
38 bb=DINT(b)
39 aa=ANINT(a)
40 bb=ANINT(b)
41 aa=ANINT(b, kind=4)
42 bb=DNINT(b)
43 aa=AMAX0(f, f)
44 aa=AMIN0(f, f)
45 aa=AMAX0(g, g)
46 aa=AMIN0(g, g)
48 ee=INT(a)
49 ee=INT(a, kind=2) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(2)'
50 ee=INT(b, kind=2) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(2)'
51 ee=INT(f, kind=2)
52 ee=INT(g, kind=2)
53 ff=INT(b)
54 ff=INT(a, kind=4) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(4)'
55 ff=INT(b, kind=4) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(4)'
56 ff=INT(f, kind=4)
57 ff=INT(g, kind=4)
58 gg=INT(a)
59 gg=INT(a, kind=8) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(8)'
60 gg=INT(b, kind=8) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(8)'
61 gg=INT(f, kind=8)
62 gg=INT(g, kind=8)
64 ee=IFIX(a)
65 ff=IFIX(a)
66 gg=IFIX(a)
67 ee=IDINT(b)
68 ff=IDINT(b)
69 gg=IDINT(b)
70 ee=INT2(a) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(2)'
71 ee=INT2(b) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(2)'
72 ee=INT2(f)
73 ee=INT2(g)
74 gg=INT8(a) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(8)'
75 gg=INT8(b) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(8)'
76 gg=INT8(f)
77 gg=INT8(g)
79 ff=FLOOR(b)
80 ee=FLOOR(b, kind=2)
81 ff=FLOOR(b, kind=4)
82 gg=FLOOR(b, kind=8)
83 ff=CEILING(b)
84 ee=CEILING(b, kind=2)
85 ff=CEILING(b, kind=4)
86 gg=CEILING(b, kind=8)
87 ff=MAX1(a, a) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(4)'
88 ff=MIN1(a, a) ! was: Change of value in conversion from 'REAL(4)' to 'INTEGER(4)'
89 gg=MAX1(b, b) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(4)'
90 gg=MIN1(b, b) ! was: Change of value in conversion from 'REAL(8)' to 'INTEGER(4)'
92 ee=NINT(a, kind=2)
93 ee=NINT(b, kind=2)
94 ff=NINT(a)
95 ff=NINT(b)
96 ff=NINT(a, kind=4)
97 ff=NINT(b, kind=4)
98 gg=NINT(a, kind=8)
99 gg=NINT(b, kind=8)
100 ee=IDNINT(b)
101 ff=IDNINT(b)
102 gg=IDNINT(b)
104 ww=COMPLEX(a, a)
105 ww=COMPLEX(e, e)
106 ww=COMPLEX(g, g)
107 ww=COMPLEX(a, g)
108 xx=COMPLEX(b, g)
109 ww=CMPLX(a, a)
110 ww=CMPLX(b, b, kind=4)
111 xx=CMPLX(a, a, kind=8)
113 aa=REAL(ww)
114 bb=REAL(xx)
115 aa=REALPART(ww)
116 bb=REALPART(xx)
117 aa=AIMAG(ww)
118 bb=AIMAG(xx)
119 aa=IMAG(ww)
120 bb=IMAG(xx)
121 bb=DIMAG(xx)
122 aa=IMAGPART(ww)
123 bb=IMAGPART(xx)