71{
72 int i, j;
75
76
77 if (argc > 1)
78 {
79 if (0 == strcmp(argv[1], "sub"))
80 {
81 printf("test failed, result %x\n",
83 exit(1);
84 }
85 else if (0 == strcmp(argv[1], "add"))
86 {
87 printf("test failed, result %x\n",
89 exit(1);
90 }
91 else if (0 == strcmp(argv[1], "mult"))
92 {
93 printf("test failed, result %x\n",
95 exit(1);
96 }
97 else if (0 == strcmp(argv[1], "div"))
98 {
99 printf("test failed, result %x\n",
101 exit(1);
102 }
103 else if (0 == strcmp(argv[1], "minus"))
104 {
105 printf("test failed, result %x\n",
107 exit(1);
108 }
109 else if (0 == strcmp(argv[1], "throw"))
110 {
111 safe::ov(
"throw overflow exception");
112 printf("test failed\n");
113 exit(1);
114 }
115 else
116 {
117 printf("unknown test: %s\n", argv[1]);
118 exit(1);
119 }
120 }
121#define roll 100
123 for (i =
outer; i > 0; i--)
124 for (j = 0; j <
inner; j++)
125 {
126 {
137 }
138 {
149 }
150 {
161 }
162 {
173 }
174 {
185 }
186 {
197 }
198 {
209 }
210 {
221 }
222 {
233 }
234 {
245 }
246 }
247}
static int32_t mult(int32_t x, int32_t y, const char *msg)
static int32_t add(int32_t x, int32_t y, const char *msg)
static int32_t div(int32_t x, int32_t y, const char *msg)
static int32_t sub(int32_t x, int32_t y, const char *msg)
static int32_t minus(int32_t x, const char *msg)