1/* { dg-shouldfail "tsan" } */ 2 3#include <pthread.h> 4#include <unistd.h> 5 6void *Thread(void *x) { 7 return 0; 8} 9 10int main() { 11 int i; 12 for (i = 0; i < 5; i++) { 13 pthread_t t; 14 pthread_create(&t, 0, Thread, 0); 15 } 16 sleep(1); 17 return 0; 18} 19 20/* { dg-output "WARNING: ThreadSanitizer: thread leak.*(\n|\r\n|\r)" } */ 21/* { dg-output " And 4 more similar thread leaks.*" } */ 22