Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only %s |
| 2 | |
| 3 | void test1() { |
| 4 | if (sizeof (int){ 1}); // sizeof compound literal |
| 5 | if (sizeof (int)); // sizeof type |
| 6 | |
| 7 | (int)4; // cast. |
| 8 | (int){4}; // compound literal. |
| 9 | |
| 10 | // FIXME: change this to the struct version when we can. |
| 11 | //int A = (struct{ int a;}){ 1}.a; |
| 12 | int A = (int){ 1}.a; |
| 13 | } |
| 14 | |
| 15 | int test2(int a, int b) { |
| 16 | return a ? a,b : a; |
| 17 | } |
| 18 | |
| 19 | int test3(int a, int b, int c) { |
| 20 | return a = b = c; |
| 21 | } |
| 22 | |
| 23 | int test4() { |
| 24 | test4(); |
| 25 | } |
| 26 | |
| 27 | int test_offsetof() { |
| 28 | // FIXME: change into something that is semantically correct. |
| 29 | __builtin_offsetof(int, a.b.c[4][5]); |
| 30 | } |