2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr48552-1.c
blob877c4c2a88199c17171d6b854ab96442c8dce280
1 /* PR c/48552 */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
5 struct S;
7 void
8 f1 (void *x)
10 __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
11 } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
13 void
14 f2 (void *x)
16 __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
17 } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
18 /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
19 void
20 f3 (void *x)
22 __asm volatile ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */
25 void
26 f4 (void *x)
28 __asm volatile ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */
31 void
32 f5 (void *x)
34 __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
35 } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
37 void
38 f6 (void *x)
40 __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
41 } /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
42 /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
43 void
44 f7 (struct S *x)
46 __asm volatile ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
49 void
50 f8 (struct S *x)
52 __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
53 } /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */