aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/nios2/cdx-mov.c
blob: 000b38bb6264b4fb56c70a855d31f5da7ce09fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -march=r2 -mcdx" } */

/* Check generation of R2 CDX mov.n and movi.n instructions.  */

extern void f (int a, int b, int c, int d);

int g (int x, int y, int z)
{
  f (100, x, y, z);
  return -1;
}

/* We should always get mov.n and never mov when compiling with -mcdx.  */
/* { dg-final { scan-assembler "\tmov\\.n\t.*" } } */
/* { dg-final { scan-assembler-not "\tmov\t.*" } } */

/* Both of the constant loads are expressible with movi.n.  */
/* { dg-final { scan-assembler "\tmovi\\.n\t.*, 100" } } */
/* { dg-final { scan-assembler "\tmovi\\.n\t.*, -1" } } */