summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/octeon-bbit-2.c
blob: 55bf23eae4e74ecb849d201469bd53fb7519ed33 (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
/* { dg-do compile } */
/* { dg-options "-O2 -march=octeon -mbranch-likely" } */
/* { dg-final { scan-assembler "\tbbit\[01\]\t" } } */
/* { dg-final { scan-assembler-not "\tbbit\[01\]l\t" } } */
/* { dg-final { scan-assembler "\tbnel\t" } } */
/* { dg-final { scan-assembler-not "\tbne\t" } } */

NOMIPS16 int
f (int n, int i)
{
  int s = 0;
  for (; i & 1; i++)
    s += i;
  return s;
}

NOMIPS16 int
g (int n, int i)
{
  int s = 0;
  for (i = 0; i < n; i++)
    s += i;
  return s;
}