2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / minloc_3.f90
blob465c77c9996deb22f93993269f2b443cbb9cce36
1 ! { dg-do run }
2 real :: a(30), m
3 real, allocatable :: c(:)
4 integer :: e(30), n, ia(1)
5 integer, allocatable :: g(:)
6 logical :: l(30)
7 allocate (c (30))
8 allocate (g (30))
9 a = 7.0
10 c = 7.0
11 e = 7
12 g = 7
13 m = huge(m)
14 n = huge(n)
15 a(7) = 6.0
16 c(7) = 6.0
17 e(7) = 6
18 g(7) = 6
19 ia = minloc (a)
20 if (ia(1).ne.7) call abort
21 ia = minloc (a(::2))
22 if (ia(1).ne.4) call abort
23 if (any (minloc (a).ne.(/ 7 /))) call abort
24 if (any (minloc (a(::2)).ne.(/ 4 /))) call abort
25 ia = minloc (c)
26 if (ia(1).ne.7) call abort
27 ia = minloc (c(::2))
28 if (ia(1).ne.4) call abort
29 if (any (minloc (c).ne.(/ 7 /))) call abort
30 if (any (minloc (c(::2)).ne.(/ 4 /))) call abort
31 ia = minloc (e)
32 if (ia(1).ne.7) call abort
33 ia = minloc (e(::2))
34 if (ia(1).ne.4) call abort
35 if (any (minloc (e).ne.(/ 7 /))) call abort
36 if (any (minloc (e(::2)).ne.(/ 4 /))) call abort
37 ia = minloc (g)
38 if (ia(1).ne.7) call abort
39 ia = minloc (g(::2))
40 if (ia(1).ne.4) call abort
41 if (any (minloc (g).ne.(/ 7 /))) call abort
42 if (any (minloc (g(::2)).ne.(/ 4 /))) call abort
43 l = .true.
44 ia = minloc (a, mask = l)
45 if (ia(1).ne.7) call abort
46 ia = minloc (a(::2), mask = l(::2))
47 if (ia(1).ne.4) call abort
48 if (any (minloc (a, mask = l).ne.(/ 7 /))) call abort
49 if (any (minloc (a(::2), mask = l(::2)).ne.(/ 4 /))) call abort
50 ia = minloc (c, mask = l)
51 if (ia(1).ne.7) call abort
52 ia = minloc (c(::2), mask = l(::2))
53 if (ia(1).ne.4) call abort
54 if (any (minloc (c, mask = l).ne.(/ 7 /))) call abort
55 if (any (minloc (c(::2), mask = l(::2)).ne.(/ 4 /))) call abort
56 ia = minloc (e, mask = l)
57 if (ia(1).ne.7) call abort
58 ia = minloc (e(::2), mask = l(::2))
59 if (ia(1).ne.4) call abort
60 if (any (minloc (e, mask = l).ne.(/ 7 /))) call abort
61 if (any (minloc (e(::2), mask = l(::2)).ne.(/ 4 /))) call abort
62 ia = minloc (g, mask = l)
63 if (ia(1).ne.7) call abort
64 ia = minloc (g(::2), mask = l(::2))
65 if (ia(1).ne.4) call abort
66 if (any (minloc (g, mask = l).ne.(/ 7 /))) call abort
67 if (any (minloc (g(::2), mask = l(::2)).ne.(/ 4 /))) call abort
68 l = .false.
69 ia = minloc (a, mask = l)
70 if (ia(1).ne.0) call abort
71 ia = minloc (a(::2), mask = l(::2))
72 if (ia(1).ne.0) call abort
73 if (any (minloc (a, mask = l).ne.(/ 0 /))) call abort
74 if (any (minloc (a(::2), mask = l(::2)).ne.(/ 0 /))) call abort
75 ia = minloc (c, mask = l)
76 if (ia(1).ne.0) call abort
77 ia = minloc (c(::2), mask = l(::2))
78 if (ia(1).ne.0) call abort
79 if (any (minloc (c, mask = l).ne.(/ 0 /))) call abort
80 if (any (minloc (c(::2), mask = l(::2)).ne.(/ 0 /))) call abort
81 ia = minloc (e, mask = l)
82 if (ia(1).ne.0) call abort
83 ia = minloc (e(::2), mask = l(::2))
84 if (ia(1).ne.0) call abort
85 if (any (minloc (e, mask = l).ne.(/ 0 /))) call abort
86 if (any (minloc (e(::2), mask = l(::2)).ne.(/ 0 /))) call abort
87 ia = minloc (g, mask = l)
88 if (ia(1).ne.0) call abort
89 ia = minloc (g(::2), mask = l(::2))
90 if (ia(1).ne.0) call abort
91 if (any (minloc (g, mask = l).ne.(/ 0 /))) call abort
92 if (any (minloc (g(::2), mask = l(::2)).ne.(/ 0 /))) call abort
93 a = 7.0
94 c = 7.0
95 end