aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr79390.c
blob: 6bbe165f3a340ddb3c938bc34c7f71951e80ba3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* PR tree-optimization/79390 */
/* { dg-do compile { target lp64 } } */
/* { dg-options "-O2 -march=haswell -mtune=haswell -mfpmath=sse" } */
/* Make sure we emit a conditional move in this loop.  */

extern double A[32];

int
foo (void)
{
  double t = A[0];
  int jp = 0;
  int i;

  for (i = 0; i < 32; i++)
    {
      double ab = A[i];
      if (ab > t)
	{
	  jp = i;
	  t = ab;
	}
    }
 
  return jp;
}

/* { dg-final { scan-assembler "\[ \\t\]cmov\[a-z.]+\[ \\t\]" } } */