Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / lvalue-9.c
blob382b3ffa903320de4fc86bfa58767617dbcd16cd
1 /* Test handling of lvalues of incomplete types. Bugs 36941, 88647
2 (invalid), 88827. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c11 -pedantic-errors" } */
6 struct S;
8 extern struct S var;
9 extern struct S *vp;
10 extern int i;
12 void
13 f1 (void)
15 var; /* { dg-error "has an incomplete type" } */
16 var, (void) 0; /* { dg-error "has an incomplete type" } */
18 ? var /* { dg-error "has an incomplete type" } */
19 : var); /* { dg-error "has an incomplete type" } */
22 void
23 f2 (void)
25 (void) var; /* { dg-error "has an incomplete type" } */
26 (void) (var, (void) 0); /* { dg-error "has an incomplete type" } */
27 (void) (i
28 ? var /* { dg-error "has an incomplete type" } */
29 : var); /* { dg-error "has an incomplete type" } */
32 void
33 f3 (void)
35 (const void) var; /* { dg-error "has an incomplete type" } */
36 (const void) (var, (void) 0); /* { dg-error "has an incomplete type" } */
37 (const void) (i
38 ? var /* { dg-error "has an incomplete type" } */
39 : var); /* { dg-error "has an incomplete type" } */
42 void
43 f4 (void)
45 *vp; /* { dg-error "invalid use of undefined type" } */
46 *vp, (void) 0; /* { dg-error "invalid use of undefined type" } */
48 ? *vp /* { dg-error "invalid use of undefined type" } */
49 : *vp); /* { dg-error "invalid use of undefined type" } */
52 void
53 f5 (void)
55 (void) *vp; /* { dg-error "invalid use of undefined type" } */
56 (void) (*vp, (void) 0); /* { dg-error "invalid use of undefined type" } */
57 (void) (i
58 ? *vp /* { dg-error "invalid use of undefined type" } */
59 : *vp); /* { dg-error "invalid use of undefined type" } */
62 void
63 f6 (void)
65 (const void) *vp; /* { dg-error "invalid use of undefined type" } */
66 (const void) (*vp, (void) 0); /* { dg-error "invalid use of undefined type" } */
67 (const void) (i
68 ? *vp /* { dg-error "invalid use of undefined type" } */
69 : *vp); /* { dg-error "invalid use of undefined type" } */
72 void
73 f7 (void)
75 /* This is invalid because of the constraints on []. */
76 &vp[0]; /* { dg-error "invalid use of undefined type" } */