You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.3 KiB

25 years ago
  1. #include <cl_io.h>
  2. // Elementary operations.
  3. extern int test_I_abs (int iterations);
  4. extern int test_I_compare (int iterations);
  5. extern int test_I_plus (int iterations);
  6. extern int test_I_minus (int iterations);
  7. extern int test_I_plus1 (int iterations);
  8. extern int test_I_minus1 (int iterations);
  9. extern int test_I_mul (int iterations);
  10. extern int test_I_div (int iterations);
  11. // Euclidean ring operations.
  12. extern int test_I_gcd (int iterations);
  13. extern int test_I_xgcd (int iterations);
  14. // Bit vector operations.
  15. extern int test_I_ash (int iterations);
  16. extern int test_I_evenp (int iterations);
  17. extern int test_I_oddp (int iterations);
  18. extern int test_I_lognot (int iterations);
  19. extern int test_I_logand (int iterations);
  20. extern int test_I_logandc1 (int iterations);
  21. extern int test_I_logandc2 (int iterations);
  22. extern int test_I_logior (int iterations);
  23. extern int test_I_logorc1 (int iterations);
  24. extern int test_I_logorc2 (int iterations);
  25. extern int test_I_logxor (int iterations);
  26. extern int test_I_lognand (int iterations);
  27. extern int test_I_lognor (int iterations);
  28. extern int test_I_logeqv (int iterations);
  29. extern int test_I_boole (int iterations);
  30. extern int test_I_logbitp (int iterations);
  31. extern int test_I_logtest (int iterations);
  32. extern int test_I_ldb (int iterations);
  33. extern int test_I_ldb_test (int iterations);
  34. extern int test_I_mask_field (int iterations);
  35. extern int test_I_dpb (int iterations);
  36. extern int test_I_deposit_field (int iterations);
  37. extern int test_I_logcount (int iterations);
  38. extern int test_I_integer_length (int iterations);
  39. extern int test_I_ord2 (int iterations);
  40. extern int test_I_power2p (int iterations);
  41. // More complex operations.
  42. extern int test_I_isqrt (int iterations);
  43. extern int test_I_sqrtp (int iterations);
  44. // Miscellaneous.
  45. extern int test_I_GV (int iterations);
  46. #define RUN(tester,iterations) \
  47. fprint(cl_stdout,"Testing "#tester"...\n"); \
  48. error |= tester (iterations);
  49. int test_I (int iterations)
  50. {
  51. int error = 0;
  52. // Elementary operations.
  53. RUN(test_I_abs,iterations);
  54. RUN(test_I_compare,iterations);
  55. RUN(test_I_plus,iterations);
  56. RUN(test_I_minus,iterations);
  57. RUN(test_I_plus1,iterations);
  58. RUN(test_I_minus1,iterations);
  59. RUN(test_I_mul,iterations);
  60. RUN(test_I_div,iterations);
  61. // Euclidean ring operations.
  62. RUN(test_I_gcd,iterations);
  63. RUN(test_I_xgcd,iterations);
  64. // Bit vector operations.
  65. RUN(test_I_ash,iterations);
  66. RUN(test_I_evenp,iterations);
  67. RUN(test_I_oddp,iterations);
  68. RUN(test_I_lognot,iterations);
  69. RUN(test_I_logand,iterations);
  70. RUN(test_I_logandc1,iterations);
  71. RUN(test_I_logandc2,iterations);
  72. RUN(test_I_logior,iterations);
  73. RUN(test_I_logorc1,iterations);
  74. RUN(test_I_logorc2,iterations);
  75. RUN(test_I_logxor,iterations);
  76. RUN(test_I_lognand,iterations);
  77. RUN(test_I_lognor,iterations);
  78. RUN(test_I_logeqv,iterations);
  79. RUN(test_I_boole,iterations);
  80. RUN(test_I_logbitp,iterations);
  81. RUN(test_I_logtest,iterations);
  82. RUN(test_I_ldb,iterations);
  83. RUN(test_I_ldb_test,iterations);
  84. RUN(test_I_mask_field,iterations);
  85. RUN(test_I_dpb,iterations);
  86. RUN(test_I_deposit_field,iterations);
  87. RUN(test_I_logcount,iterations);
  88. RUN(test_I_integer_length,iterations);
  89. RUN(test_I_ord2,iterations);
  90. RUN(test_I_power2p,iterations);
  91. // More complex operations.
  92. RUN(test_I_isqrt,iterations);
  93. RUN(test_I_sqrtp,iterations);
  94. // Miscellaneous.
  95. RUN(test_I_GV,iterations);
  96. return error;
  97. }