28#include <gtest/gtest.h>
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
116template <
typename Arg>
118 typename
std::enable_if_t<std::is_floating_point_v<Arg>>>
137template <
typename Ret>
139 typename
std::enable_if_t<std::is_floating_point_v<Ret>>>
167template <
typename Ret>
191template <
typename Arg>
193 typename
std::enable_if_t<std::is_floating_point_v<Arg>>>
212template <
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]);
396 EXPECT_EQ(
dump,
"test(0, 11, 2, 13, ...)");
ThreadContext is the external interface to all thread state for anything outside of the CPU.
static const double DefaultFloatResult
static const int DefaultIntResult
static const double floats[]
const float FloatRetValue
void testTcInit(ThreadContext *tc, int a)
void test2DVoid(ThreadContext *tc, int a, float b, int c, double d, guest_abi::VarArgs< int, float, double > varargs)
void testIntVoid(ThreadContext *tc, int a, float b, int c, double d, guest_abi::VarArgs< int, float, double > varargs)
void testPrepareVoid(ThreadContext *tc, int a, int b)
int testPrepareInt(ThreadContext *tc, int a, int b)
const double DoubleRetValue
TEST(GuestABITest, ABI_1D_args)
double testDoubleRet(ThreadContext *tc)
int testIntRet(ThreadContext *tc)
float testFloatRet(ThreadContext *tc)
constexpr bool IsVarArgsV
void dump()
Dump all statistics data to the registered outputs.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::string dumpSimcall(std::string name, ThreadContext *tc, std::function< Ret(ThreadContext *, Args...)> target=std::function< Ret(ThreadContext *, Args...)>())
Ret invokeSimcall(ThreadContext *tc, std::function< Ret(ThreadContext *, Args...)> target)
Overload hash function for BasicBlockRange type.
State(const ThreadContext *tc)
static Arg get(ThreadContext *tc, TestABI_1D::State &state)
static int get(ThreadContext *tc, TestABI_1D::State &state)
static Arg get(ThreadContext *tc, TestABI_2D::State &state)
static int get(ThreadContext *tc, TestABI_2D::State &state)
static int get(ThreadContext *tc, TestABI_Prepare::State &state)
static void prepare(ThreadContext *tc, TestABI_Prepare::State &state)
static int get(ThreadContext *tc, TestABI_TcInit::State &state)
static void store(ThreadContext *tc, const Ret &ret)
static void store(ThreadContext *tc, const int &ret)
static void store(ThreadContext *tc, const Ret &ret)
static void store(ThreadContext *tc, const int &ret)
static void store(ThreadContext *tc, const Ret &ret)
static void prepare(ThreadContext *tc, TestABI_Prepare::State &state)