Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only %s |
Chris Lattner | a7fa381 | 2007-07-12 16:52:08 +0000 | [diff] [blame] | 2 | // XFAIL: * |
| 3 | // FIXME: This is xfailed because we're not analyzing brace initializers yet. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 4 | |
| 5 | void 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 | |
| 17 | int test2(int a, int b) { |
| 18 | return a ? a,b : a; |
| 19 | } |
| 20 | |
| 21 | int test3(int a, int b, int c) { |
| 22 | return a = b = c; |
| 23 | } |
| 24 | |
| 25 | int test4() { |
| 26 | test4(); |
| 27 | } |
| 28 | |
| 29 | int test_offsetof() { |
| 30 | // FIXME: change into something that is semantically correct. |
| 31 | __builtin_offsetof(int, a.b.c[4][5]); |
| 32 | } |