2020-08-13 07:07:32 +08:00
|
|
|
#include <cstddef>
|
|
|
|
|
2020-12-30 10:50:16 +08:00
|
|
|
using f_ptr = unsigned int();
|
2020-12-18 12:25:48 +08:00
|
|
|
|
2020-12-30 10:50:16 +08:00
|
|
|
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();
|
|
|
|
|
|
|
|
static f_ptr* const regression_tests_regressions[]
|
|
|
|
= { ®ression_1008, ®ression_1000, ®ression_1067, ®ression_1072, ®ression_1087, ®ression_1095, ®ression_1096 };
|
|
|
|
static const int regression_tests_sizeof_regressions = sizeof(regression_tests_regressions) / sizeof(regression_tests_regressions[0]);
|
2020-12-18 12:25:48 +08:00
|
|
|
|
|
|
|
int trampoline(f_ptr* f) {
|
|
|
|
try {
|
|
|
|
return f();
|
|
|
|
}
|
|
|
|
catch (...) {
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2020-08-13 07:07:32 +08:00
|
|
|
|
|
|
|
int main(int, char*[]) {
|
|
|
|
int r = 0;
|
2020-12-30 10:50:16 +08:00
|
|
|
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);
|
2020-08-13 07:07:32 +08:00
|
|
|
}
|
|
|
|
return r;
|
2020-12-30 10:50:16 +08:00
|
|
|
}
|