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
113 return tc->
ints[state++];
117 template <
typename Arg>
119 typename
std::enable_if_t<std::is_floating_point<Arg>::value>>
124 return tc->
floats[state++];
138 template <
typename Ret>
140 typename
std::enable_if_t<std::is_floating_point<Ret>::value>>
158 return tc->
ints[--state];
168 template <
typename Ret>
188 return tc->
ints[state.first++];
192 template <
typename Arg>
194 typename
std::enable_if_t<std::is_floating_point<Arg>::value>>
199 return tc->
floats[state.second++];
213 template <
typename Ret>
215 typename
std::enable_if_t<std::is_floating_point<Ret>::value>>
244 EXPECT_EQ(
a, tc->
ints[0]);
246 EXPECT_EQ(
c, tc->
ints[2]);
249 EXPECT_EQ(varargs.
get<
int>(), tc->
ints[4]);
250 EXPECT_EQ(varargs.
get<
float>(), tc->
floats[5]);
251 EXPECT_EQ(varargs.
get<
double>(), tc->
floats[6]);
259 EXPECT_EQ(
a, tc->
ints[1]);
260 EXPECT_EQ(
b, tc->
ints[0]);
266 EXPECT_EQ(
a, tc->
ints[2]);
267 EXPECT_EQ(
b, tc->
ints[1]);
277 EXPECT_EQ(
a, tc->
ints[0]);
279 EXPECT_EQ(
c, tc->
ints[1]);
282 EXPECT_EQ(varargs.
get<
int>(), tc->
ints[2]);
283 EXPECT_EQ(varargs.
get<
float>(), tc->
floats[2]);
284 EXPECT_EQ(varargs.
get<
double>(), tc->
floats[3]);
291 EXPECT_EQ(
a, tc->
ints[2]);
305 TEST(GuestABITest, ABI_1D_args)
313 TEST(GuestABITest, ABI_Prepare)
320 TEST(GuestABITest, ABI_2D_args)
328 TEST(GuestABITest, ABI_TC_init)
332 invokeSimcall<TestABI_TcInit>(&tc,
testTcInit);
335 TEST(GuestABITest, ABI_returns)
340 int ret = invokeSimcall<TestABI_1D>(&tc,
testIntRet);
347 float ret = invokeSimcall<TestABI_1D>(&tc,
testFloatRet);
362 int ret = invokeSimcall<TestABI_1D, false>(&tc,
testIntRet);
372 int ret = invokeSimcall<TestABI_2D>(&tc,
testIntRet);
379 float ret = invokeSimcall<TestABI_2D>(&tc,
testFloatRet);
397 EXPECT_EQ(
dump,
"test(0, 11, 2, 13, ...)");
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 Arg get(ThreadContext *tc, TestABI_2D::State &state)
static int get(ThreadContext *tc, TestABI_Prepare::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)
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.
static void store(ThreadContext *tc, const int &ret)
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
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)
static Arg get(ThreadContext *tc, TestABI_1D::State &state)
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 int get(ThreadContext *tc, TestABI_TcInit::State &state)
static int get(ThreadContext *tc, TestABI_1D::State &state)
Generated on Tue Sep 21 2021 12:25:47 for gem5 by doxygen 1.8.17