2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr48552-2.c
blob954c411c5c4450cc8d23e6e3e6053c30c5d347c7
1 /* PR c/48552 */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
5 struct S;
7 void
8 f1 (void *x)
10 __asm ("" : : "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 ("" : "=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 ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */
25 void
26 f4 (void *x)
28 __asm ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */
31 void
32 f5 (void *x)
34 __asm ("" : : "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 ("" : "=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 ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
49 void
50 f8 (struct S *x)
52 __asm ("" : "=r" (*x)); /* { dg-error "invalid lvalue in asm output 0" } */