blob: d0883ba202f9b4309cdf8f177ee392bd2d0db6f7 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c99
Chris Lattner67d33d82008-07-25 21:33:13 +00002// rdar://6095180
3
Chris Lattner67d33d82008-07-25 21:33:13 +00004struct s { char c[17]; };
5extern struct s foo(void);
6
7struct s a, b, c;
8
9int A[sizeof((foo().c)) == 17 ? 1 : -1];
10int B[sizeof((a.c)) == 17 ? 1 : -1];
11
12
13// comma does array/function promotion in c99.
14int X[sizeof(0, (foo().c)) == sizeof(char*) ? 1 : -1];
15int Y[sizeof(0, (a,b).c) == sizeof(char*) ? 1 : -1];
16int Z[sizeof(0, (a=b).c) == sizeof(char*) ? 1 : -1];
17