X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libmudflap%2Ftestsuite%2Flibmudflap.cth%2Fpass59-frag.c;fp=libmudflap%2Ftestsuite%2Flibmudflap.cth%2Fpass59-frag.c;h=49013067705af3162f004b6f8cf1e8038d2d07f5;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libmudflap/testsuite/libmudflap.cth/pass59-frag.c b/libmudflap/testsuite/libmudflap.cth/pass59-frag.c new file mode 100644 index 00000000..49013067 --- /dev/null +++ b/libmudflap/testsuite/libmudflap.cth/pass59-frag.c @@ -0,0 +1,39 @@ +#include +#include + +/* PR 28578 */ + +void* test_thread(void* arg) +{ + printf("Hello from thread!\n"); + pthread_exit(NULL); + return 0; +} + +int main() +{ + pthread_t thread; + void *arg = NULL; + pthread_create(&thread, NULL, test_thread, arg); + pthread_join(thread, NULL); + pthread_exit(NULL); + return 0; +} + +/* { dg-output "Hello from thread!\n" } */ + +#if 0 + +/* Even this test case replicates the problem. However, when built in + static mode, it blows up during __mf_init (?!?!?!) with a + pthread_mutex_lock deadlock error. */ + +#include +#include + +int main () +{ + pthread_exit(NULL); + return 0; +} +#endif