2015-07-03 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / int_conv_1.f90
blob15f71f9336c22eccefe831e6f15d5826bbb015fd
1 ! { dg-do run }
2 ! { dg-options "-std=gnu" }
3 integer(kind=2) :: i2, j2, k2, l2, m2, n2, o2
4 integer(kind=4) :: i4, j4
5 integer(kind=8) :: i8, j8
6 real :: x
7 complex :: z
9 i2 = huge(i2) / 3
10 i8 = int8(i2)
11 i4 = long(i2)
12 j2 = short(i2)
13 k2 = int2(i2)
14 l2 = int2(i8)
15 m2 = short(i8)
16 n2 = int2(i4)
17 o2 = short(i4)
19 if (i8 /= i2 .or. i4 /= i2 .or. j2 /= i2 .or. k2 /= i2 &
20 .or. l2 /= i2 .or. m2 /= i2 .or. n2 /= i2 .or. o2 /= i2) call abort
22 x = i2
23 i8 = int8(x)
24 i4 = long(x)
25 j2 = short(x)
26 k2 = int2(x)
27 if (i8 /= i2 .or. i4 /= i2 .or. j2 /= i2 .or. k2 /= i2) call abort
29 z = i2 + (0.,-42.)
30 i8 = int8(z)
31 i4 = long(z)
32 j2 = short(z)
33 k2 = int2(z)
34 if (i8 /= i2 .or. i4 /= i2 .or. j2 /= i2 .or. k2 /= i2) call abort
36 end