1 // Sanitizer should not crash if pthread_create fails.
2 // RUN: %clangxx -pthread %s -o %t && %run %t
4 // pthread_create with lsan i386 does not fail here.
5 // UNSUPPORTED: i386-linux && lsan
11 void *null_func(void *args
) {
18 pthread_attr_init(&attrs
);
19 // Set size huge enough to fail pthread_create.
21 // Align the size just in case.
24 int res
= pthread_attr_setstacksize(&attrs
, sz
);
26 for (size_t i
= 0; i
< 10; ++i
) {
27 res
= pthread_create(&thread
, &attrs
, null_func
, NULL
);