コード例 #1
0
int main(void)
{
	unsigned status;

	XBEGIN(abort);
	if (XTEST())
		XABORT(1);
	XEND();
	return 0;

	/* Abort comes here */
	XABORT_STATUS(abort, status);
	printf("aborted %x, %d", status, XABORT_CODE(status));
	return 0;
}
コード例 #2
0
ファイル: rtm-goto.c プロジェクト: magoroku15/tsx-tools
int
rtm_test(int sz)
{
	unsigned status = 0;
	int i,j;

	//memset(buf, 0, 1024*1024);

	XBEGIN(abort_handler);
	 for (i = 0; i < sz; i++) {
	 	buf[i] = i;
	 }
	XEND(); 
	printf("%d pass\n",sz);
	return 0;

	XFAIL_STATUS(abort_handler, status);
	printf("%d aborted %x, %d\n", sz, status, XABORT_CODE(status));
	//printf("%d fail %x %s\n",sz, status, xabort_code(status));
	return -1;
}