aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asm-hard-reg-error-4.c
blob: 465f24b1f716c81033ada7f16082f57b9d539398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */

/* Verify output operands.  */

int
test (void)
{
  int x;
  register int y __asm__ ("0");

  /* Preserve status quo and don't error out.  */
  __asm__ ("" : "=r" (x), "=r" (x));

  /* Be more strict for hard register constraints and error out.  */
  __asm__ ("" : "={0}" (x), "={1}" (x)); /* { dg-error "multiple outputs to lvalue 'x'" } */

  /* Still error out in case of a mixture.  */
  __asm__ ("" : "=r" (x), "={1}" (x)); /* { dg-error "multiple outputs to lvalue 'x'" } */

  return x + y;
}