2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / minmaxloc_5.f90
blob92e2103dedff41d7dd0501926564dbea098e4655
1 ! { dg-do run }
2 ! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask
3 program GA4076
4 REAL DDA(100)
5 dda = (/(J1,J1=1,100)/)
6 IDS = MAXLOC(DDA,1)
7 if (ids.ne.100) call abort !expect 100
9 IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
10 if (ids.ne.100) call abort !expect 100
12 IDS = minLOC(DDA,1)
13 if (ids.ne.1) call abort !expect 1
15 IDS = MinLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
16 if (ids.ne.51) call abort !expect 51
18 END