* tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new block.
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-array-lval-4.c
blob259ce9214535cd0c0a475c7a452f4b1ee93716db
1 /* Test for non-lvalue arrays decaying to pointers: in C99 only.
2 Test various ways of producing non-lvalue arrays. */
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
7 struct s { char c[17]; };
9 struct s x;
11 struct s a, b, c;
12 int d;
14 #define ASSERT(v, a) char v[((a) ? 1 : -1)]
16 ASSERT (p, sizeof (x.c) == 17);
17 ASSERT (q, sizeof (0, x.c) == sizeof (char *));
18 ASSERT (r0, sizeof ((d ? b : c).c) == 17);
19 ASSERT (r1, sizeof ((d, b).c) == 17);
20 ASSERT (r2, sizeof ((a = b).c) == 17);
21 /* The non-lvalue array decays to a pointer in C99. */
22 ASSERT (s0, sizeof (0, (d ? b : c).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
23 ASSERT (s0, sizeof (0, (d, b).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
24 ASSERT (s0, sizeof (0, (a = b).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */