gcc/libitm/testsuite/libitm.c/notx.c
Rainer Orth 8851b42977 libitm port to Tru64 UNIX
* config/alpha/sjlj.S (_ITM_beginTransaction) [!__ELF__]: Don't use
	.hidden.
	(.note.GNU-stack): Only use if __linux__.
	* alloc_cpp.cc [!__osf__] (_ZnaXRKSt9nothrow_t): Dummy function.
	* testsuite/libitm.c/notx.c: Use dg-options "-pthread".
	* testsuite/libitm.c/reentrant.c: Likewise.
	* testsuite/libitm.c/simple-2.c: Likewise.
	* testsuite/libitm.c/txrelease.c: Likewise.
	* testsuite/libitm.c++/static_ctor.C: Likewise.

From-SVN: r181262
2011-11-10 17:15:33 +00:00

37 lines
720 B
C

/* These tests all check whether initialization happens properly even if no
transaction has been used in the current thread yet. */
/* { dg-options "-pthread" } */
#include <stdlib.h>
#include <pthread.h>
#include <libitm.h>
static void *test1 (void *dummy __attribute__((unused)))
{
if (_ITM_inTransaction() != outsideTransaction)
abort();
return NULL;
}
static void *test2 (void *dummy __attribute__((unused)))
{
if (_ITM_getTransactionId() != _ITM_noTransactionId)
abort();
return NULL;
}
int main()
{
pthread_t thread;
pthread_create(&thread, NULL, test1, NULL);
pthread_join(thread, NULL);
pthread_create(&thread, NULL, test2, NULL);
pthread_join(thread, NULL);
return 0;
}