summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/cmpimm_branch_1.c
blob: 7ad736b5e1dbb91a0bf17c6ae2717b72147bb84d (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 compile } */
/* { dg-options "-save-temps -O2" } */

/* Test that we emit a sub+subs sequence rather than mov+movk+cmp.  */

void g (void);
void
foo (int x)
{
  if (x != 0x123456)
    g ();
}

void
fool (long long x)
{
  if (x != 0x123456)
    g ();
}

/* { dg-final { scan-assembler-not "cmp\tw\[0-9\]*.*" } } */
/* { dg-final { scan-assembler-not "cmp\tx\[0-9\]*.*" } } */
/* { dg-final { scan-assembler-times "sub\tw\[0-9\]+.*" 1 } } */
/* { dg-final { scan-assembler-times "sub\tx\[0-9\]+.*" 1 } } */
/* { dg-final { scan-assembler-times "subs\tw\[0-9\]+.*" 1 } } */
/* { dg-final { scan-assembler-times "subs\tx\[0-9\]+.*" 1 } } */