From: Daniel R. Carvalho Date: Sun, 7 Feb 2021 03:14:58 +0000 (-0300) Subject: dev: Fix register bank unit test in .debug X-Git-Tag: develop-gem5-snapshot~128 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a63e9ff0a9e8523d2b2a828f857f4d747029588;p=gem5.git dev: Fix register bank unit test in .debug The lack of definition of this static variable was throwing and undefined reference error when running scons build/X86/unittests.opt. For more info, check https://stackoverflow.com/questions/ 8016780/undefined-reference-to-static-constexpr-char Change-Id: Id736dc42a82aea871da6a53c06d89fd399d3559a Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40836 Reviewed-by: Jason Lowe-Power Reviewed-by: Gabe Black Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/dev/reg_bank.test.cc b/src/dev/reg_bank.test.cc index 6e655e271..f72642dcf 100644 --- a/src/dev/reg_bank.test.cc +++ b/src/dev/reg_bank.test.cc @@ -82,6 +82,8 @@ class RegisterRazTest : public testing::Test buf.fill(0xff); } }; +// Needed by C++14 and lower +constexpr size_t RegisterRazTest::RazSize; TEST_F(RegisterRazTest, Name) { @@ -166,6 +168,8 @@ class RegisterRaoTest : public testing::Test buf.fill(0x00); } }; +// Needed by C++14 and lower +constexpr size_t RegisterRaoTest::RaoSize; TEST_F(RegisterRaoTest, Name) { @@ -252,6 +256,8 @@ class RegisterBufTest : public testing::Test 0x70, 0x80, 0x90, 0xa0, 0xb0, 0xc0} {} }; +// Needed by C++14 and lower +constexpr size_t RegisterBufTest::RegSize; TEST_F(RegisterBufTest, Name) { @@ -456,6 +462,8 @@ class TypedRegisterTest : public testing::Test buf{0x1, 0x2, 0x3, 0x4, 0x5, 0x6} {} }; +// Needed by C++14 and lower +constexpr size_t TypedRegisterTest::RegSize; TEST_F(TypedRegisterTest, DefaultConstructor) {