The test failed because atexit/on_exit code was not correct. Make it look more like the g_exit_context. Added a sleep to libtcc_test_mt to allow overlap of threads to detect this problem.
Showing the changes to tests (1 of 2 files). Show all
Unified · Split
| @@ -288,6 +288,9 @@ int main(int argc, char **argv) · 287 unmodified lines | ||
| 288 | 288 | |
| 289 | 289 | #else |
| 290 | 290 | #include <tcclib.h> |
| 291 | + | |
| 292 | +unsigned int sleep(unsigned int seconds); | |
| 293 | + | |
| 291 | 294 | int fib(n) |
| 292 | 295 | { |
| 293 | 296 | return (n <= 2) ? 1 : fib(n-1) + fib(n-2); |
| @@ -295,7 +298,8 @@ int fib(n) · 1 unmodified line | ||
| 295 | 298 | |
| 296 | 299 | int main(int argc, char **argv) |
| 297 | 300 | { |
| 298 | − printf(" %d", fib(atoi(argv[1]), 2)); | |
| 301 | + sleep(1); | |
| 302 | + printf(" %d", fib(atoi(argv[1]))); | |
| 299 | 303 | return 0; |
| 300 | 304 | } |
| 301 | 305 | #endif |