blob: 4949ee3a83fcb728f292952595c236040f6df43f [file] [log] [blame]
Chris Lattner53fcaa92008-07-25 20:54:07 +00001// RUN: clang %s -fsyntax-only -verify -std=c99
Chris Lattner080b3322008-07-25 20:02:29 +00002// rdar://6095180
3
4#include <assert.h>
5struct s { char c[17]; };
Chris Lattner53fcaa92008-07-25 20:54:07 +00006extern struct s foo(void);
Chris Lattner080b3322008-07-25 20:02:29 +00007
Chris Lattner53fcaa92008-07-25 20:54:07 +00008struct s a, b, c;
Chris Lattner080b3322008-07-25 20:02:29 +00009
Chris Lattner53fcaa92008-07-25 20:54:07 +000010int A[sizeof((foo().c)) == 17 ? 1 : -1];
11int B[sizeof((a.c)) == 17 ? 1 : -1];
12
13
14// comma does array/function promotion in c99.
15int X[sizeof(0, (foo().c)) == sizeof(char*) ? 1 : -1];
16int Y[sizeof(0, (a,b).c) == sizeof(char*) ? 1 : -1];
17int Z[sizeof(0, (a=b).c) == sizeof(char*) ? 1 : -1];
Chris Lattner080b3322008-07-25 20:02:29 +000018