PR middle-end/77674
[official-gcc.git] / gcc / testsuite / gfortran.dg / scalar_mask_2.f90
blob967ac5c22c2100b2b546d66176ceff921553aa10
1 ! { dg-do run { xfail spu-*-* } }
2 ! FAILs on SPU because of rounding error reading kinds.h
3 program main
4 ! Test scalar masks for different intrinsics.
5 real, dimension(2,2) :: a
6 logical(kind=2) :: lo
7 lo = .false.
8 a(1,1) = 1.
9 a(1,2) = -1.
10 a(2,1) = 13.
11 a(2,2) = -31.
12 if (any (minloc (a, lo) /= 0)) call abort
13 if (any (minloc (a, .true.) /= (/ 2, 2 /))) call abort
14 if (any (minloc(a, 1, .true.) /= (/ 1, 2/))) call abort
15 if (any (minloc(a, 1, lo ) /= (/ 0, 0/))) call abort
17 if (any (maxloc (a, lo) /= 0)) call abort
18 if (any (maxloc (a, .true.) /= (/ 2,1 /))) call abort
19 if (any (maxloc(a, 1, .true.) /= (/ 2, 1/))) call abort
20 if (any (maxloc(a, 1, lo) /= (/ 0, 0/))) call abort
22 if (any (maxval(a, 1, lo) /= -HUGE(a))) call abort
23 if (any (maxval(a, 1, .true.) /= (/13., -1./))) call abort
24 if (any (minval(a, 1, lo) /= HUGE(a))) call abort
25 if (any (minval(a, 1, .true.) /= (/1., -31./))) call abort
27 if (any (product(a, 1, .true.) /= (/13., 31./))) call abort
28 if (any (product(a, 1, lo ) /= (/1., 1./))) call abort
30 if (any (sum(a, 1, .true.) /= (/14., -32./))) call abort
31 if (any (sum(a, 1, lo) /= (/0., 0./))) call abort
33 end program main