1107590Sobrien! { dg-do run }
2169689Skan! { dg-options "-fno-sign-zero" }
3132718Skan!
4107590Sobrien! PR fortran/40675
5107590Sobrien!
6107590Sobrien! Fortran 77 just had: "The value of a signed zero is the same as
7132718Skan! the value of an unsigned zero." and g77 returned for SIGN(1.0, -0.0) = 1.0
8107590Sobrien!
9132718Skan! Fortran 95+ has for SIGN: "Case  (iv):  If B is of type real and is zero,
10132718Skan! then ... (c) If B is negative real zero, the value of the result is -|A|".
11132718Skan! On architectures, where signed zeros are supported, gfortran's SIGN thus
12132718Skan! returns for B=-0.0 the -|A|.
13107590Sobrien!
14132718Skanprogram s
15132718Skan   x = sign(1.,0.)
16132718Skan   y = sign(1.,-0.)
17132718Skan   if (x /= 1.) call abort()
18132718Skan   if (y /= 1.) call abort()
19107590Sobrien   x = 1.
20132718Skan   y = 0.
21169689Skan   x = sign(x, y)
22169689Skan   y = sign(x, -y)
23107590Sobrien   if (x /= 1.) call abort()
24107590Sobrien   if (y /= 1.) call abort()
25169689Skanend program s
26107590Sobrien