1 // RUN: %clang_safestack %s -pthread -o %t
4 // Test that pthreads receive their own unsafe stack.
11 static int ptr_test
= 42;
13 void *t1_start(void *ptr
)
19 int val
= ptr_test
* 5;
22 char buffer
[8096]; // two pages
23 memset(buffer
, val
, sizeof (buffer
));
24 break_optimization(buffer
);
29 int main(int argc
, char **argv
)
33 if (pthread_create(&t1
, NULL
, t1_start
, &ptr_test
))
35 if (pthread_join(t1
, &ptr
))