]> pd.if.org Git - lice/blob - tests/types.c
autocommit for files dated 2014-11-17 20:15:26
[lice] / tests / types.c
1 // types
2
3 int main(void) {
4     char a;
5     short b;
6     int c;
7     long d;
8     long long e;
9     short int f;
10     long int g;
11     long long int f;
12     long int long g;
13     float h;
14     double i;
15     long double j;
16
17     signed char k;
18     signed short l;
19     signed int m;
20     signed long n;
21     signed long long o;
22     signed short int p;
23     signed long int q;
24     signed long long int r;
25
26     unsigned char s;
27     unsigned short t;
28     unsigned int u;
29     unsigned long v;
30     unsigned long long w;
31     unsigned short int x;
32     unsigned long int y;
33     unsigned long long int z;
34
35     static A;
36     auto B;
37     register C;
38     static int D;
39     auto int E;
40     register int F;
41
42     int *G;
43     int *H[5];
44     int (*I)[5];
45     expecti(sizeof(G), 8);
46     expecti(sizeof(H), 40);
47     expecti(sizeof(I), 8);
48
49     int unsigned auto* const* const* J;
50
51     typedef int K;
52     K L = 5;
53     expecti(L, 5);
54
55     typedef K M[3];
56     M N = { 1, 2, 3 };
57     expecti(N[0], 1);
58     expecti(N[1], 2);
59     expecti(N[2], 3);
60
61     typedef struct { int a; } O;
62     O P;
63     P.a = 64;
64     expecti(P.a, 64);
65
66     typedef int __take_precedence_1;
67     typedef int __take_precedence_2;
68     __take_precedence_1 __take_precedence_2 = 100;
69     expecti(__take_precedence_2, 100);
70
71     return 0;
72 }