summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/its.c
blob: f81a0df51cdb5fc26208c0a99e5c1cfb2ee4ed04 (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-require-effective-target arm_cortex_m } */
/* { dg-require-effective-target arm_thumb2 } */
/* { dg-options "-O2" }  */
int test (int a, int b)
{
  int r;
  if (a > 10)
    {
      r = a - b;
      r += 10;
    }
  else
    {
      r = b - a;
      r -= 7;
    }
  if (r > 0)
    r -= 3;
  return r;
}
/* Ensure there is no IT block with more than 2 instructions, ie. we only allow
   IT, ITT and ITE.  */
/* { dg-final { scan-assembler-not "\\sit\[te\]{2}" } } */