summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asm-7.c
blob: 42f40e719f909e4d13fc0f376771d7d3a0b5f41c (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
27
28
/* Gcc 3.3.1 deprecates memory inputs of non-lvalues.  */
/* { dg-do compile } */

void test(void)
{
  register int r;
  register int r2;
  int i;
  static int m;
  int *p;

  __asm__ ("" : : "m"(r));	/* { dg-warning "address of register" } */
  __asm__ ("" : : "m"(i));
  __asm__ ("" : : "m"(m));
  __asm__ ("" : : "m"(0));	/* { dg-warning "input without lvalue" } */
  __asm__ ("" : : "m"(i+1));	/* { dg-warning "input without lvalue" } */
  __asm__ ("" : : "m"(*p++));

  __asm__ ("" : : "g"(r));
  __asm__ ("" : : "g"(i));
  __asm__ ("" : : "g"(m));
  __asm__ ("" : : "g"(0));
  __asm__ ("" : : "g"(i+1));

  __asm__ ("" : "=m"(r2));	/* { dg-warning "address of register" } */
  __asm__ ("" : "=m"(i));
  __asm__ ("" : "=m"(m));
}