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