aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/pr48552-2.c
blob: a7969837bf5f43021b49e42defe8abd46d2b931f (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* PR c/48552 */
/* { dg-do compile } */
/* { dg-options "" } */

struct S;

void
f1 (void *x)
{
  __asm ("" : : "r" (*x));	/* { dg-warning "dereferencing" "deref" } */
}				/* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */

void
f2 (void *x)
{
  __asm ("" : "=r" (*x));	/* { dg-warning "dereferencing" "deref" } */
}				/* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
				/* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
void
f3 (void *x)
{
  __asm ("" : : "m" (*x));	/* { dg-warning "dereferencing" } */
}

void
f4 (void *x)
{
  __asm ("" : "=m" (*x));	/* { dg-warning "dereferencing" } */
}

void
f5 (void *x)
{
  __asm ("" : : "g" (*x));	/* { dg-warning "dereferencing" "deref" } */
}				/* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */

void
f6 (void *x)
{
  __asm ("" : "=g" (*x));	/* { dg-warning "dereferencing" "deref" } */
}				/* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
				/* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
void
f7 (struct S *x)
{
  __asm ("" : : "r" (*x));	/* { dg-error "dereferencing pointer to incomplete type" } */
}

void
f8 (struct S *x)
{
  __asm ("" : "=r" (*x));	/* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
}				/* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */