2 ! { dg-add-options ieee }
3 ! { dg-skip-if "NaN not supported" { spu-*-* } }
4 real :: a(3), nan
, minf
, pinf
5 real, allocatable
:: c(:)
18 if (maxloc (a
, dim
= 1).ne
.1) call abort
19 if (.not
.isnan(maxval (a
, dim
= 1))) call abort
21 if (maxloc (a
, dim
= 1).ne
.1) call abort
22 if (maxval (a
, dim
= 1).ne
.minf
) call abort
24 if (maxloc (a
, dim
= 1).ne
.3) call abort
25 if (maxval (a
, dim
= 1).ne
.minf
) call abort
27 if (maxloc (a
, dim
= 1).ne
.2) call abort
28 if (maxval (a
, dim
= 1).ne
.1) call abort
30 if (maxloc (a
, dim
= 1).ne
.2) call abort
31 if (maxval (a
, dim
= 1).ne
.pinf
) call abort
33 if (maxloc (c
, dim
= 1).ne
.1) call abort
34 if (.not
.isnan(maxval (c
, dim
= 1))) call abort
36 if (maxloc (c
, dim
= 1).ne
.1) call abort
37 if (maxval (c
, dim
= 1).ne
.minf
) call abort
39 if (maxloc (c
, dim
= 1).ne
.3) call abort
40 if (maxval (c
, dim
= 1).ne
.minf
) call abort
42 if (maxloc (c
, dim
= 1).ne
.2) call abort
43 if (maxval (c
, dim
= 1).ne
.1) call abort
45 if (maxloc (c
, dim
= 1).ne
.2) call abort
46 if (maxval (c
, dim
= 1).ne
.pinf
) call abort
50 if (maxloc (a
, dim
= 1, mask
= l
).ne
.0) call abort
51 if (maxval (a
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
52 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.0) call abort
53 if (maxval (a
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
55 if (maxloc (a
, dim
= 1, mask
= l
).ne
.0) call abort
56 if (maxval (a
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
57 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.0) call abort
58 if (maxval (a
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
60 if (maxloc (a
, dim
= 1, mask
= l
).ne
.0) call abort
61 if (maxval (a
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
62 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.0) call abort
63 if (maxval (a
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
65 if (maxloc (a
, dim
= 1, mask
= l
).ne
.0) call abort
66 if (maxval (a
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
67 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.0) call abort
68 if (maxval (a
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
70 if (maxloc (a
, dim
= 1, mask
= l
).ne
.0) call abort
71 if (maxval (a
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
72 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.0) call abort
73 if (maxval (a
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
75 if (maxloc (c
, dim
= 1, mask
= l
).ne
.0) call abort
76 if (maxval (c
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
77 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.0) call abort
78 if (maxval (c
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
80 if (maxloc (c
, dim
= 1, mask
= l
).ne
.0) call abort
81 if (maxval (c
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
82 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.0) call abort
83 if (maxval (c
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
85 if (maxloc (c
, dim
= 1, mask
= l
).ne
.0) call abort
86 if (maxval (c
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
87 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.0) call abort
88 if (maxval (c
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
90 if (maxloc (c
, dim
= 1, mask
= l
).ne
.0) call abort
91 if (maxval (c
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
92 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.0) call abort
93 if (maxval (c
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
95 if (maxloc (c
, dim
= 1, mask
= l
).ne
.0) call abort
96 if (maxval (c
, dim
= 1, mask
= l
).ne
.-huge(minf
)) call abort
97 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.0) call abort
98 if (maxval (c
, dim
= 1, mask
= l2
).ne
.-huge(minf
)) call abort
102 if (maxloc (a
, dim
= 1, mask
= l
).ne
.1) call abort
103 if (.not
.isnan(maxval (a
, dim
= 1, mask
= l
))) call abort
104 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.1) call abort
105 if (.not
.isnan(maxval (a
, dim
= 1, mask
= l2
))) call abort
107 if (maxloc (a
, dim
= 1, mask
= l
).ne
.1) call abort
108 if (maxval (a
, dim
= 1, mask
= l
).ne
.minf
) call abort
109 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.1) call abort
110 if (maxval (a
, dim
= 1, mask
= l2
).ne
.minf
) call abort
112 if (maxloc (a
, dim
= 1, mask
= l
).ne
.3) call abort
113 if (maxval (a
, dim
= 1, mask
= l
).ne
.minf
) call abort
114 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.3) call abort
115 if (maxval (a
, dim
= 1, mask
= l2
).ne
.minf
) call abort
117 if (maxloc (a
, dim
= 1, mask
= l
).ne
.2) call abort
118 if (maxval (a
, dim
= 1, mask
= l
).ne
.1) call abort
119 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.2) call abort
120 if (maxval (a
, dim
= 1, mask
= l2
).ne
.1) call abort
122 if (maxloc (a
, dim
= 1, mask
= l
).ne
.2) call abort
123 if (maxval (a
, dim
= 1, mask
= l
).ne
.pinf
) call abort
124 if (maxloc (a
, dim
= 1, mask
= l2
).ne
.2) call abort
125 if (maxval (a
, dim
= 1, mask
= l2
).ne
.pinf
) call abort
127 if (maxloc (c
, dim
= 1, mask
= l
).ne
.1) call abort
128 if (.not
.isnan(maxval (c
, dim
= 1, mask
= l
))) call abort
129 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.1) call abort
130 if (.not
.isnan(maxval (c
, dim
= 1, mask
= l2
))) call abort
132 if (maxloc (c
, dim
= 1, mask
= l
).ne
.1) call abort
133 if (maxval (c
, dim
= 1, mask
= l
).ne
.minf
) call abort
134 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.1) call abort
135 if (maxval (c
, dim
= 1, mask
= l2
).ne
.minf
) call abort
137 if (maxloc (c
, dim
= 1, mask
= l
).ne
.3) call abort
138 if (maxval (c
, dim
= 1, mask
= l
).ne
.minf
) call abort
139 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.3) call abort
140 if (maxval (c
, dim
= 1, mask
= l2
).ne
.minf
) call abort
142 if (maxloc (c
, dim
= 1, mask
= l
).ne
.2) call abort
143 if (maxval (c
, dim
= 1, mask
= l
).ne
.1) call abort
144 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.2) call abort
145 if (maxval (c
, dim
= 1, mask
= l2
).ne
.1) call abort
147 if (maxloc (c
, dim
= 1, mask
= l
).ne
.2) call abort
148 if (maxval (c
, dim
= 1, mask
= l
).ne
.pinf
) call abort
149 if (maxloc (c
, dim
= 1, mask
= l2
).ne
.2) call abort
150 if (maxval (c
, dim
= 1, mask
= l2
).ne
.pinf
) call abort
153 if (maxloc (c
, dim
= 1).ne
.0) call abort
154 if (maxval (c
, dim
= 1).ne
.-huge(minf
)) call abort