2021-05-09 18:07:01 +08:00
|
|
|
#include <cstddef>
|
|
|
|
|
|
|
|
using f_ptr = unsigned int();
|
|
|
|
|
|
|
|
extern unsigned int regression_1000();
|
|
|
|
extern unsigned int regression_1008();
|
|
|
|
extern unsigned int regression_1067();
|
|
|
|
extern unsigned int regression_1072();
|
|
|
|
extern unsigned int regression_1087();
|
|
|
|
extern unsigned int regression_1095();
|
|
|
|
extern unsigned int regression_1096();
|
|
|
|
extern unsigned int regression_1149();
|
2021-05-10 18:41:45 +08:00
|
|
|
extern unsigned int regression_1192();
|
2021-10-24 06:13:25 +08:00
|
|
|
extern unsigned int regression_1211();
|
2021-05-09 18:07:01 +08:00
|
|
|
|
2021-10-24 06:13:25 +08:00
|
|
|
static f_ptr* const regression_tests_regressions[] = { ®ression_1008,
|
|
|
|
®ression_1000,
|
|
|
|
®ression_1067,
|
|
|
|
®ression_1072,
|
|
|
|
®ression_1087,
|
|
|
|
®ression_1095,
|
|
|
|
®ression_1096,
|
|
|
|
®ression_1149,
|
|
|
|
®ression_1192,
|
|
|
|
®ression_1211 };
|
2021-05-09 18:07:01 +08:00
|
|
|
static const int regression_tests_sizeof_regressions = sizeof(regression_tests_regressions) / sizeof(regression_tests_regressions[0]);
|
|
|
|
|
|
|
|
int trampoline(f_ptr* f) {
|
|
|
|
try {
|
|
|
|
return f();
|
|
|
|
}
|
|
|
|
catch (...) {
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int, char*[]) {
|
|
|
|
int r = 0;
|
|
|
|
for (std::size_t i = 0; i < regression_tests_sizeof_regressions; ++i) {
|
|
|
|
f_ptr* f = regression_tests_regressions[i];
|
|
|
|
r += static_cast<int>(trampoline(f) != 0u);
|
|
|
|
}
|
|
|
|
return r;
|
|
|
|
}
|