Page MenuHomeFreeBSD

D55893.diff
No OneTemporary

D55893.diff

diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
--- a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
+++ b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
@@ -30,7 +30,10 @@
#include <cstdio>
#include <cstdlib>
+#define AGAIN_CALL_LIMIT 20
+
static FILE *output = NULL;
+static int again_counter = 0;
struct Foo {
Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); }
@@ -79,14 +82,16 @@
static void
again(void *arg)
{
-
- __cxa_thread_atexit(again, arg, &output);
+ if (again_counter < AGAIN_CALL_LIMIT) {
+ again_counter++;
+ __cxa_thread_atexit(again, arg, &output);
+ }
}
ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors);
ATF_TEST_CASE_BODY(cxx__thread_inf_dtors)
{
-
+ skip("Skip since we only have main thread");
again(NULL);
}
diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
--- a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
+++ b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
@@ -30,7 +30,10 @@
#include <cstdlib>
#include <thread>
+#define AGAIN_CALL_LIMIT 20
+
static FILE *output = NULL;
+static int again_counter = 0;
struct Foo {
Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); }
@@ -52,8 +55,10 @@
static void
again(void *arg)
{
-
- __cxa_thread_atexit(again, arg, &output);
+ if (again_counter < AGAIN_CALL_LIMIT) {
+ ++again_counter;
+ __cxa_thread_atexit(again, arg, &output);
+ }
}
struct Baz {
@@ -164,6 +169,7 @@
std::thread t([]() { e.use(); });
t.join();
+ ATF_REQUIRE_EQ(again_counter, AGAIN_CALL_LIMIT);
}
ATF_INIT_TEST_CASES(tcs)

File Metadata

Mime Type
text/plain
Expires
Thu, May 28, 11:41 AM (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33585103
Default Alt Text
D55893.diff (1 KB)

Event Timeline