blob: 3b47260c32f2e69d8a179210868f9de4c98a9ec9 [file] [log] [blame]
Chris Lattner388577b2007-08-25 05:26:51 +00001// RUN: clang -parse-noop %s
Reid Spencer5f016e22007-07-11 17:01:13 +00002
3void test1() {
4 if (sizeof (int){ 1}); // sizeof compound literal
5 if (sizeof (int)); // sizeof type
6
7 (int)4; // cast.
Chris Lattnere45fa6a2007-08-25 05:31:19 +00008 (int){4}; // compound literal.
Reid Spencer5f016e22007-07-11 17:01:13 +00009
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
15int test2(int a, int b) {
16 return a ? a,b : a;
17}
18
19int test3(int a, int b, int c) {
20 return a = b = c;
21}
22
23int test4() {
24 test4();
25}
26
27int test_offsetof() {
28 // FIXME: change into something that is semantically correct.
29 __builtin_offsetof(int, a.b.c[4][5]);
30}
Chris Lattner4c1a2a92007-11-13 20:50:37 +000031
32void test_sizeof(){
33 int arr[10];
34 sizeof arr[0];
35 sizeof(arr[0]);
36 sizeof(arr)[0];
37}
38
39