annotate gcc/testsuite/gcc.dg/c90-array-lval-3.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for non-lvalue arrays decaying to pointers: in C99 only.
kono
parents:
diff changeset
2 Test various ways of producing non-lvalue arrays. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct s { char c[1]; };
kono
parents:
diff changeset
8 struct s a, b, c;
kono
parents:
diff changeset
9 int d;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 void
kono
parents:
diff changeset
12 bar (void)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 char *t;
kono
parents:
diff changeset
15 (d ? b : c).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
16 (d, b).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
17 (a = b).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
18 t = (d ? b : c).c; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
19 t = (d, b).c; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
20 t = (a = b).c; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
21 (d ? b : c).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
22 (d, b).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
23 (a = b).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25 /* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 15 }
kono
parents:
diff changeset
26 { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 16 }
kono
parents:
diff changeset
27 { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 17 }
kono
parents:
diff changeset
28 { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 18 }
kono
parents:
diff changeset
29 { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 19 }
kono
parents:
diff changeset
30 { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 20 }
kono
parents:
diff changeset
31 { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 21 }
kono
parents:
diff changeset
32 { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 22 }
kono
parents:
diff changeset
33 { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 23 }
kono
parents:
diff changeset
34 */