aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/ieee/ieee_12.f90
blob: 139a70142b8223c9aba33d6cda24a1d490c240b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { dg-do run }
! PR95647 operator(.eq.) and operator(==) treated differently
program test
  use, intrinsic :: ieee_arithmetic, only :                 &
&                ieee_class,                                       &
&                ieee_class_type,                                  &
&                ieee_negative_normal,                             &
&                ieee_positive_normal,                             &
&                operator(.eq.), operator(.ne.)
  integer :: good
  real(4) r4
  type(ieee_class_type) class1
  good = 0
  r4 = 1.0
  class1 = ieee_class(r4)
  if (class1 .eq. ieee_positive_normal) good = good + 1
  if (class1 .ne. ieee_negative_normal) good = good + 1
  r4 = -1.0
  class1 = ieee_class(r4)
  if (class1 .eq. ieee_negative_normal) good = good + 1
  if (class1 .ne. ieee_positive_normal) good = good + 1
  if (good /= 4) call abort
end program test