Chris Lattner | 67d33d8 | 2008-07-25 21:33:13 +0000 | [diff] [blame] | 1 | // RUN: clang %s -fsyntax-only -verify -std=c99 |
| 2 | // rdar://6095180 |
| 3 | |
| 4 | #include <assert.h> |
| 5 | struct s { char c[17]; }; |
| 6 | extern struct s foo(void); |
| 7 | |
| 8 | struct s a, b, c; |
| 9 | |
| 10 | int A[sizeof((foo().c)) == 17 ? 1 : -1]; |
| 11 | int B[sizeof((a.c)) == 17 ? 1 : -1]; |
| 12 | |
| 13 | |
| 14 | // comma does array/function promotion in c99. |
| 15 | int X[sizeof(0, (foo().c)) == sizeof(char*) ? 1 : -1]; |
| 16 | int Y[sizeof(0, (a,b).c) == sizeof(char*) ? 1 : -1]; |
| 17 | int Z[sizeof(0, (a=b).c) == sizeof(char*) ? 1 : -1]; |
| 18 | |