summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/minmaxloc_5.f90
blob: 92e2103dedff41d7dd0501926564dbea098e4655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! { dg-do run }
! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask
program GA4076
  REAL DDA(100)
  dda = (/(J1,J1=1,100)/)
  IDS = MAXLOC(DDA,1)
  if (ids.ne.100) call abort  !expect 100
  
  IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
  if (ids.ne.100) call abort  !expect 100

  IDS = minLOC(DDA,1)
  if (ids.ne.1) call abort  !expect 1

  IDS = MinLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
  if (ids.ne.51) call abort !expect 51

END