aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/cond_sub_restrict_it.c
blob: 8411643e95782876b71b3beccc699a2e85022e5c (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
/* { dg-do run } */
/* { dg-require-effective-target arm_thumb2_ok } */
/* { dg-options "-mthumb -O -mrestrict-it" }  */

int a;

__attribute__((noinline, noclone)) int
fn1 (int c, int d)
{
  a -= c == d;
  return a;
}

int
main (void)
{
  a = 10;
  if (fn1 (4, 4) != 9)
    __builtin_abort ();

  a = 5;
  if (fn1 (3, 4) != 5)
    __builtin_abort ();

  return 0;
}