[tests] Fix subobject-linkage error when building with GCC

Placing these tests in anonymous namespaces, is the suggested fix
according to the GCC documentation.

The GCC documentation states: "If a type A depends on a type B with no or
 internal linkage, defining it in multiple translation units would be an
ODR violation because the meaning of B is different in each translation unit.
If A only appears in a single translation unit, the best way to silence the
warning is to give it internal linkage by putting it in an anonymous namespace as well."

Change-Id: I69a1e9b5f1789e9a7a62c762cd499809a72e0ea5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1836255
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64128}
This commit is contained in:
Joey Gouly 2019-10-03 12:05:51 +01:00 committed by Commit Bot
parent d1799e3b28
commit 8ca191b6cb
4 changed files with 4 additions and 8 deletions

View File

@ -372,8 +372,6 @@ const MachInst2 kCanElideChangeUint32ToUint64[] = {
MachineType::Uint32()},
};
} // namespace
// -----------------------------------------------------------------------------
// Logical instructions.
@ -4955,6 +4953,7 @@ TEST_F(InstructionSelectorTest, PokePairPrepareArgumentsSimd128) {
expected_poke_pair, expected_poke);
}
} // namespace
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -62,8 +62,6 @@ class CommonSharedOperatorTest
: public TestWithZone,
public ::testing::WithParamInterface<SharedOperator> {};
} // namespace
TEST_P(CommonSharedOperatorTest, InstancesAreGloballyShared) {
const SharedOperator& sop = GetParam();
@ -387,6 +385,7 @@ TEST_F(CommonOperatorTest, Projection) {
}
}
} // namespace
} // namespace common_operator_unittest
} // namespace compiler
} // namespace internal

View File

@ -54,9 +54,6 @@ std::ostream& operator<<(std::ostream& os, const SharedOperator& sop) {
return os << IrOpcode::Mnemonic(sop.opcode);
}
} // namespace
class JSSharedOperatorTest
: public TestWithZone,
public ::testing::WithParamInterface<SharedOperator> {};
@ -111,6 +108,7 @@ TEST_P(JSSharedOperatorTest, Properties) {
INSTANTIATE_TEST_SUITE_P(JSOperatorTest, JSSharedOperatorTest,
::testing::ValuesIn(kSharedOperators));
} // namespace
} // namespace js_operator_unittest
} // namespace compiler
} // namespace internal

View File

@ -73,7 +73,6 @@ bool IsParallelMovePresent(int instr_index, Instruction::GapPosition gap_pos,
return found_match;
}
} // namespace
class RegisterAllocatorTest : public InstructionSequenceTest {
public:
@ -824,6 +823,7 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Combine(::testing::ValuesIn(kParameterTypes),
::testing::Range(0, SlotConstraintTest::kMaxVariant)));
} // namespace
} // namespace compiler
} // namespace internal
} // namespace v8