PageRenderTime 20ms CodeModel.GetById 2ms app.highlight 15ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/d/preproc_constants_c_runme.2.d

#
D | 64 lines | 58 code | 4 blank | 2 comment | 53 complexity | 67ae95861c65b3a0800f4740ac5b8cb8 MD5 | raw file
 1module preproc_constants_c_runme;
 2
 3import core.stdc.config;
 4import preproc_constants_c.preproc_constants_c;
 5
 6// Same as preproc_constants.i testcase, but bool types are int instead.
 7void main() {
 8  static assert(is(int == typeof(CONST_INT1())));
 9  static assert(is(int == typeof(CONST_INT2())));
10  static assert(is(uint == typeof(CONST_UINT1())));
11  static assert(is(uint == typeof(CONST_UINT2())));
12  static assert(is(uint == typeof(CONST_UINT3())));
13  static assert(is(uint == typeof(CONST_UINT4())));
14  static assert(is(c_long == typeof(CONST_LONG1())));
15  static assert(is(c_long == typeof(CONST_LONG2())));
16  static assert(is(c_long == typeof(CONST_LONG3())));
17  static assert(is(c_long == typeof(CONST_LONG4())));
18  static assert(is(long == typeof(CONST_LLONG1())));
19  static assert(is(long == typeof(CONST_LLONG2())));
20  static assert(is(long == typeof(CONST_LLONG3())));
21  static assert(is(long == typeof(CONST_LLONG4())));
22  static assert(is(ulong == typeof(CONST_ULLONG1())));
23  static assert(is(ulong == typeof(CONST_ULLONG2())));
24  static assert(is(ulong == typeof(CONST_ULLONG3())));
25  static assert(is(ulong == typeof(CONST_ULLONG4())));
26  static assert(is(double == typeof(CONST_DOUBLE1())));
27  static assert(is(double == typeof(CONST_DOUBLE2())));
28  static assert(is(double == typeof(CONST_DOUBLE3())));
29  static assert(is(double == typeof(CONST_DOUBLE4())));
30  static assert(is(double == typeof(CONST_DOUBLE5())));
31  static assert(is(double == typeof(CONST_DOUBLE6())));
32  static assert(is(int == typeof(CONST_BOOL1())));
33  static assert(is(int == typeof(CONST_BOOL2())));
34  static assert(is(char == typeof(CONST_CHAR())));
35  static assert(is(string == typeof(CONST_STRING1())));
36  static assert(is(string == typeof(CONST_STRING2())));
37
38  static assert(is(int == typeof(INT_AND_BOOL())));
39//    static assert(is(int == typeof(INT_AND_CHAR())));
40  static assert(is(int == typeof(INT_AND_INT())));
41  static assert(is(uint == typeof(INT_AND_UINT())));
42  static assert(is(c_long == typeof(INT_AND_LONG())));
43  static assert(is(c_ulong == typeof(INT_AND_ULONG())));
44  static assert(is(long == typeof(INT_AND_LLONG())));
45  static assert(is(ulong == typeof(INT_AND_ULLONG())));
46  static assert(is(int == typeof(BOOL_AND_BOOL())));
47
48  static assert(is(int == typeof(EXPR_MULTIPLY())));
49  static assert(is(int == typeof(EXPR_DIVIDE())));
50  static assert(is(int == typeof(EXPR_PLUS())));
51  static assert(is(int == typeof(EXPR_MINUS())));
52  static assert(is(int == typeof(EXPR_LSHIFT())));
53  static assert(is(int == typeof(EXPR_RSHIFT())));
54  static assert(is(int == typeof(EXPR_LTE())));
55  static assert(is(int == typeof(EXPR_GTE())));
56  static assert(is(int == typeof(EXPR_INEQUALITY())));
57  static assert(is(int == typeof(EXPR_EQUALITY())));
58  static assert(is(int == typeof(EXPR_AND())));
59  static assert(is(int == typeof(EXPR_XOR())));
60  static assert(is(int == typeof(EXPR_OR())));
61  static assert(is(int == typeof(EXPR_LAND())));
62  static assert(is(int == typeof(EXPR_LOR())));
63  static assert(is(double == typeof(EXPR_CONDITIONAL())));
64}