]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Sema/expr-comma-c99.c
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / Sema / expr-comma-c99.c
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -std=c99 -Wno-sizeof-array-decay
2 // expected-no-diagnostics
3 // rdar://6095180
4
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