tstX86-1.cpp revision 65c72795ab90d3daefa759b716fbb5c6352c7a56
/* $Id$ */
/** @file
* X86 instruction set exploration/testcase #1.
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
#else
# ifdef RT_OS_DARWIN
# define _XOPEN_SOURCE
# endif
# include <signal.h>
# include <ucontext.h>
# define USE_SIGNAL
#endif
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
typedef struct TRAPINFO
{
} TRAPINFO;
typedef TRAPINFO const *PCTRAPINFO;
/*******************************************************************************
* Global Variables *
*******************************************************************************/
extern TRAPINFO g_aTrapInfo[];
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
{
for (unsigned i = 0; g_aTrapInfo[i].uTrapPC; i++)
return &g_aTrapInfo[i];
return NULL;
}
#ifdef USE_SIGNAL
{
# if defined(RT_ARCH_AMD64) && defined(RT_OS_DARWIN)
# elif defined(RT_ARCH_AMD64)
# elif defined(RT_ARCH_X86)
# else
# endif
if (pTrapInfo)
{
/** @todo verify the kind of trap */
return;
}
/* die */
}
#else
#endif
int main()
{
/*
* Set up the test environment.
*/
if (rcExit != RTEXITCODE_SUCCESS)
return rcExit;
#ifdef USE_SIGNAL
for (unsigned i = 0; i < RT_ELEMENTS(s_aiSigs); i++)
{
}
#else
/** @todo implement me. */
#endif
if (!RTTestErrorCount(hTest))
{
/*
* Do the testing.
*/
if (rc != 0)
}
return RTTestSummaryAndDestroy(hTest);
}