rt_gccstream/gcc/testsuite/gcc.dg/pr21419.c

16 lines
251 B
C

/* { dg-do compile } */
const int i = 0;
void f(void)
{
__asm__ __volatile__ ("" : "=m" (i)); /* { dg-error "read-only variable" } */
}
void g(const int set)
{
__asm__ __volatile__ ("" : "=r" (set)); /* { dg-error "read-only location" } */
}