summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/octeon-bbit-2.c
blob: 9bd8dce107ae00d93360d0e13c53903f0a8d8265 (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
/* { dg-do compile } */
/* { dg-options "-march=octeon -mbranch-likely -fno-unroll-loops" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { 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;
}