The TEST_F macros actually declare *subclasses* of the test fixtures.
Even if they didn't we don't want them to declare external functions.
The entire unit test, including both the fixture class and the fixture
test cases should be wrapped in the anonymous namespace.
This issue was caught by the new '-Winternal-linkage-in-inline' warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158798
91177308-0d34-0410-b5e6-
96231b3b80d8
using namespace llvm;
namespace {
+
class IRBuilderTest : public testing::Test {
protected:
virtual void SetUp() {
OwningPtr<Module> M;
BasicBlock *BB;
};
-}
TEST_F(IRBuilderTest, Lifetime) {
IRBuilder<> Builder(BB);
ASSERT_TRUE(II_End1 != NULL);
EXPECT_EQ(II_End1->getIntrinsicID(), Intrinsic::lifetime_end);
}
+
+}
using namespace llvm;
namespace {
+
class CloneInstruction : public ::testing::Test {
protected:
virtual void SetUp() {
LLVMContext context;
Value *V;
};
-}
TEST_F(CloneInstruction, OverflowBits) {
V = new Argument(Type::getInt32Ty(context));
SDiv->setIsExact(true);
EXPECT_TRUE(this->clone(SDiv)->isExact());
}
+
+}