1 /* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
2 /* { dg-require-effective-target cet } */
3 /* { dg-require-effective-target split_stack } */
4 /* { dg-require-effective-target pthread_h } */
5 /* { dg-options "-pthread -fsplit-stack -fcf-protection" } */
10 /* Use a noinline function to ensure that the buffer is not removed
12 static void use_buffer (char *buf
) __attribute__ ((noinline
));
14 use_buffer (char *buf
)
19 /* Each recursive call uses 10,000 bytes. We call it 1000 times,
20 using a total of 10,000,000 bytes. If -fsplit-stack is not
21 working, that will overflow our stack limit. */
36 thread_routine (void *arg
__attribute__ ((unused
)))
49 i
= pthread_create (&tid
, NULL
, thread_routine
, NULL
);
52 i
= pthread_join (tid
, &dummy
);