aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/msp430/special-regs.c
blob: a7ae9d00611c9bfc9af6b6c9c50bd23d51e968f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */

int foo (void)
{
  register int pc __asm__("R0");
  register int sp __asm__("R1");
  register int cg1 __asm__("R2"); /* { dg-error "the register specified for 'cg1' is not general enough" } */
  register int cg2 __asm__("R3"); /* { dg-error "the register specified for 'cg2' is not general enough" } */

  __asm__("" : "=r"(pc));
  __asm__("" : "=r"(sp));
  __asm__("" : "=r"(cg1));
  __asm__("" : "=r"(cg2));

  return pc + sp + cg1 + cg2;
}