Go to the documentation of this file.
28 #include <gtest/gtest.h>
30 #include <type_traits>
56 0, 1, 2, 3, 4, 5, 6, 7
59 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0
116 template <
typename Arg>
118 typename
std::enable_if_t<std::is_floating_point_v<Arg>>>
137 template <
typename Ret>
139 typename
std::enable_if_t<std::is_floating_point_v<Ret>>>
167 template <
typename Ret>
191 template <
typename Arg>
193 typename
std::enable_if_t<std::is_floating_point_v<Arg>>>
212 template <
typename Ret>
214 typename
std::enable_if_t<std::is_floating_point_v<Ret>>>
243 EXPECT_EQ(
a, tc->
ints[0]);
245 EXPECT_EQ(
c, tc->
ints[2]);
248 EXPECT_EQ(varargs.
get<
int>(), tc->
ints[4]);
249 EXPECT_EQ(varargs.
get<
float>(), tc->
floats[5]);
250 EXPECT_EQ(varargs.
get<
double>(), tc->
floats[6]);
258 EXPECT_EQ(
a, tc->
ints[1]);
259 EXPECT_EQ(
b, tc->
ints[0]);
265 EXPECT_EQ(
a, tc->
ints[2]);
266 EXPECT_EQ(
b, tc->
ints[1]);
276 EXPECT_EQ(
a, tc->
ints[0]);
278 EXPECT_EQ(
c, tc->
ints[1]);
281 EXPECT_EQ(varargs.
get<
int>(), tc->
ints[2]);
282 EXPECT_EQ(varargs.
get<
float>(), tc->
floats[2]);
283 EXPECT_EQ(varargs.
get<
double>(), tc->
floats[3]);
290 EXPECT_EQ(
a, tc->
ints[2]);
304 TEST(GuestABITest, ABI_1D_args)
312 TEST(GuestABITest, ABI_Prepare)
319 TEST(GuestABITest, ABI_2D_args)
327 TEST(GuestABITest, ABI_TC_init)
331 invokeSimcall<TestABI_TcInit>(&tc,
testTcInit);
334 TEST(GuestABITest, ABI_returns)
339 int ret = invokeSimcall<TestABI_1D>(&tc,
testIntRet);
346 float ret = invokeSimcall<TestABI_1D>(&tc,
testFloatRet);
361 int ret = invokeSimcall<TestABI_1D, false>(&tc,
testIntRet);
371 int ret = invokeSimcall<TestABI_2D>(&tc,
testIntRet);
378 float ret = invokeSimcall<TestABI_2D>(&tc,
testFloatRet);
396 EXPECT_EQ(
dump,
"test(0, 11, 2, 13, ...)");
402 EXPECT_FALSE(guest_abi::IsVarArgsV<int>);
403 EXPECT_FALSE(guest_abi::IsVarArgsV<double>);
405 EXPECT_FALSE(guest_abi::IsVarArgsV<FooStruct>);
407 EXPECT_FALSE(guest_abi::IsVarArgsV<FooUnion>);
void testIntVoid(ThreadContext *tc, int a, float b, int c, double d, guest_abi::VarArgs< int, float, double > varargs)
static void prepare(ThreadContext *tc, TestABI_Prepare::State &state)
static const int DefaultIntResult
static const double floats[]
float testFloatRet(ThreadContext *tc)
static int get(ThreadContext *tc, TestABI_Prepare::State &state)
static void store(ThreadContext *tc, const int &ret)
double testDoubleRet(ThreadContext *tc)
static const double DefaultFloatResult
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void testPrepareVoid(ThreadContext *tc, int a, int b)
void testTcInit(ThreadContext *tc, int a)
TEST(GuestABITest, ABI_1D_args)
int testIntRet(ThreadContext *tc)
std::string dumpSimcall(std::string name, ThreadContext *tc, std::function< Ret(ThreadContext *, Args...)> target=std::function< Ret(ThreadContext *, Args...)>())
void dump()
Dump all statistics data to the registered outputs.
constexpr bool IsVarArgsV
static Arg get(ThreadContext *tc, TestABI_2D::State &state)
static void store(ThreadContext *tc, const int &ret)
static void store(ThreadContext *tc, const Ret &ret)
const float FloatRetValue
static int get(ThreadContext *tc, TestABI_2D::State &state)
Overload hash function for BasicBlockRange type.
static void prepare(ThreadContext *tc, TestABI_Prepare::State &state)
State(const ThreadContext *tc)
static void store(ThreadContext *tc, const Ret &ret)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
int testPrepareInt(ThreadContext *tc, int a, int b)
void test2DVoid(ThreadContext *tc, int a, float b, int c, double d, guest_abi::VarArgs< int, float, double > varargs)
const double DoubleRetValue
static Arg get(ThreadContext *tc, TestABI_1D::State &state)
static int get(ThreadContext *tc, TestABI_TcInit::State &state)
static int get(ThreadContext *tc, TestABI_1D::State &state)
static void store(ThreadContext *tc, const Ret &ret)
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17