PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

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