OSDN Git Service

* config/i386/i386.md (UNSPEC_VSIBADDR): New.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / maxlocval_3.f90
1 ! { dg-do run }
2   integer :: a(3), h
3   integer, allocatable :: c(:)
4   logical :: l
5   logical :: l2(3)
6
7   h = -huge(h)
8   h = h - 1
9   allocate (c(3))
10   a(:) = 5
11   if (maxloc (a, dim = 1).ne.1) call abort
12   if (maxval (a, dim = 1).ne.5) call abort
13   a(2) = huge(h)
14   if (maxloc (a, dim = 1).ne.2) call abort
15   if (maxval (a, dim = 1).ne.huge(h)) call abort
16   a(:) = h
17   if (maxloc (a, dim = 1).ne.1) call abort
18   if (maxval (a, dim = 1).ne.h) call abort
19   a(3) = -huge(h)
20   if (maxloc (a, dim = 1).ne.3) call abort
21   if (maxval (a, dim = 1).ne.-huge(h)) call abort
22   c(:) = 5
23   if (maxloc (c, dim = 1).ne.1) call abort
24   if (maxval (c, dim = 1).ne.5) call abort
25   c(2) = huge(h)
26   if (maxloc (c, dim = 1).ne.2) call abort
27   if (maxval (c, dim = 1).ne.huge(h)) call abort
28   c(:) = h
29   if (maxloc (c, dim = 1).ne.1) call abort
30   if (maxval (c, dim = 1).ne.h) call abort
31   c(3) = -huge(h)
32   if (maxloc (c, dim = 1).ne.3) call abort
33   if (maxval (c, dim = 1).ne.-huge(h)) call abort
34   l = .false.
35   l2(:) = .false.
36   a(:) = 5
37   if (maxloc (a, dim = 1, mask = l).ne.0) call abort
38   if (maxval (a, dim = 1, mask = l).ne.h) call abort
39   if (maxloc (a, dim = 1, mask = l2).ne.0) call abort
40   if (maxval (a, dim = 1, mask = l2).ne.h) call abort
41   a(2) = huge(h)
42   if (maxloc (a, dim = 1, mask = l).ne.0) call abort
43   if (maxval (a, dim = 1, mask = l).ne.h) call abort
44   if (maxloc (a, dim = 1, mask = l2).ne.0) call abort
45   if (maxval (a, dim = 1, mask = l2).ne.h) call abort
46   a(:) = h
47   if (maxloc (a, dim = 1, mask = l).ne.0) call abort
48   if (maxval (a, dim = 1, mask = l).ne.h) call abort
49   if (maxloc (a, dim = 1, mask = l2).ne.0) call abort
50   if (maxval (a, dim = 1, mask = l2).ne.h) call abort
51   a(3) = -huge(h)
52   if (maxloc (a, dim = 1, mask = l).ne.0) call abort
53   if (maxval (a, dim = 1, mask = l).ne.h) call abort
54   if (maxloc (a, dim = 1, mask = l2).ne.0) call abort
55   if (maxval (a, dim = 1, mask = l2).ne.h) call abort
56   c(:) = 5
57   if (maxloc (c, dim = 1, mask = l).ne.0) call abort
58   if (maxval (c, dim = 1, mask = l).ne.h) call abort
59   if (maxloc (c, dim = 1, mask = l2).ne.0) call abort
60   if (maxval (c, dim = 1, mask = l2).ne.h) call abort
61   c(2) = huge(h)
62   if (maxloc (c, dim = 1, mask = l).ne.0) call abort
63   if (maxval (c, dim = 1, mask = l).ne.h) call abort
64   if (maxloc (c, dim = 1, mask = l2).ne.0) call abort
65   if (maxval (c, dim = 1, mask = l2).ne.h) call abort
66   c(:) = h
67   if (maxloc (c, dim = 1, mask = l).ne.0) call abort
68   if (maxval (c, dim = 1, mask = l).ne.h) call abort
69   if (maxloc (c, dim = 1, mask = l2).ne.0) call abort
70   if (maxval (c, dim = 1, mask = l2).ne.h) call abort
71   c(3) = -huge(h)
72   if (maxloc (c, dim = 1, mask = l).ne.0) call abort
73   if (maxval (c, dim = 1, mask = l).ne.h) call abort
74   if (maxloc (c, dim = 1, mask = l2).ne.0) call abort
75   if (maxval (c, dim = 1, mask = l2).ne.h) call abort
76   l = .true.
77   l2(:) = .true.
78   a(:) = 5
79   if (maxloc (a, dim = 1, mask = l).ne.1) call abort
80   if (maxval (a, dim = 1, mask = l).ne.5) call abort
81   if (maxloc (a, dim = 1, mask = l2).ne.1) call abort
82   if (maxval (a, dim = 1, mask = l2).ne.5) call abort
83   a(2) = huge(h)
84   if (maxloc (a, dim = 1, mask = l).ne.2) call abort
85   if (maxval (a, dim = 1, mask = l).ne.huge(h)) call abort
86   if (maxloc (a, dim = 1, mask = l2).ne.2) call abort
87   if (maxval (a, dim = 1, mask = l2).ne.huge(h)) call abort
88   a(:) = h
89   if (maxloc (a, dim = 1, mask = l).ne.1) call abort
90   if (maxval (a, dim = 1, mask = l).ne.h) call abort
91   if (maxloc (a, dim = 1, mask = l2).ne.1) call abort
92   if (maxval (a, dim = 1, mask = l2).ne.h) call abort
93   a(3) = -huge(h)
94   if (maxloc (a, dim = 1, mask = l).ne.3) call abort
95   if (maxval (a, dim = 1, mask = l).ne.-huge(h)) call abort
96   if (maxloc (a, dim = 1, mask = l2).ne.3) call abort
97   if (maxval (a, dim = 1, mask = l2).ne.-huge(h)) call abort
98   c(:) = 5
99   if (maxloc (c, dim = 1, mask = l).ne.1) call abort
100   if (maxval (c, dim = 1, mask = l).ne.5) call abort
101   if (maxloc (c, dim = 1, mask = l2).ne.1) call abort
102   if (maxval (c, dim = 1, mask = l2).ne.5) call abort
103   c(2) = huge(h)
104   if (maxloc (c, dim = 1, mask = l).ne.2) call abort
105   if (maxval (c, dim = 1, mask = l).ne.huge(h)) call abort
106   if (maxloc (c, dim = 1, mask = l2).ne.2) call abort
107   if (maxval (c, dim = 1, mask = l2).ne.huge(h)) call abort
108   c(:) = h
109   if (maxloc (c, dim = 1, mask = l).ne.1) call abort
110   if (maxval (c, dim = 1, mask = l).ne.h) call abort
111   if (maxloc (c, dim = 1, mask = l2).ne.1) call abort
112   if (maxval (c, dim = 1, mask = l2).ne.h) call abort
113   c(3) = -huge(h)
114   if (maxloc (c, dim = 1, mask = l).ne.3) call abort
115   if (maxval (c, dim = 1, mask = l).ne.-huge(h)) call abort
116   if (maxloc (c, dim = 1, mask = l2).ne.3) call abort
117   if (maxval (c, dim = 1, mask = l2).ne.-huge(h)) call abort
118   deallocate (c)
119   allocate (c(-2:-3))
120   if (maxloc (c, dim = 1).ne.0) call abort
121   if (maxval (c, dim = 1).ne.h) call abort
122 end