blob: 3abb6d397dc6de20df96b22761a16af0e37f1ab2 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001// RUN: clang -fsyntax-only %s
Chris Lattnera7fa3812007-07-12 16:52:08 +00002// XFAIL: *
3// FIXME: This is xfailed because we're not analyzing brace initializers yet.
Reid Spencer5f016e22007-07-11 17:01:13 +00004
5void test1() {
6 if (sizeof (int){ 1}); // sizeof compound literal
7 if (sizeof (int)); // sizeof type
8
9 (int)4; // cast.
10 (int){4}; // compound literal.
11
12 // FIXME: change this to the struct version when we can.
13 //int A = (struct{ int a;}){ 1}.a;
14 int A = (int){ 1}.a;
15}
16
17int test2(int a, int b) {
18 return a ? a,b : a;
19}
20
21int test3(int a, int b, int c) {
22 return a = b = c;
23}
24
25int test4() {
26 test4();
27}
28
29int test_offsetof() {
30 // FIXME: change into something that is semantically correct.
31 __builtin_offsetof(int, a.b.c[4][5]);
32}