dev: Fix register bank unit test in .debug
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Sun, 7 Feb 2021 03:14:58 +0000 (00:14 -0300)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Sun, 7 Feb 2021 13:07:14 +0000 (13:07 +0000)
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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40836
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/reg_bank.test.cc

index 6e655e2714b3419eec0a53a78445806c55920abf..f72642dcfcef203359a8523121d8582e47186abc 100644 (file)
@@ -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)
 {