This adds LinkerScript support by creating a type Script which is of type FileNode in the InputGraph. Once the LinkerScript Parser converts the LinkerScript into a sequence of command, the commands are handled by the equivalent LinkerScript node for the current Flavor/Target. For ELF, a ELFGNULdScript gets created which converts the commands to ELF nodes and ELF control nodes(ELFGroup for handling Group nodes). Since the Inputfile type has to be determined in the Driver, the Driver needs to determine the complete path of the file that needs to be processed by the Linker. Due to this, few tests have been removed since the Driver uses paths that doesnot exist. llvm-svn: 195583
37 lines
985 B
C++
37 lines
985 B
C++
//===- lld/unittest/GnuLdDriverTest.cpp -----------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
///
|
|
/// \file
|
|
/// \brief GNU ld driver tests.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "DriverTest.h"
|
|
|
|
#include "lld/ReaderWriter/ELFLinkingContext.h"
|
|
|
|
using namespace llvm;
|
|
using namespace lld;
|
|
|
|
namespace {
|
|
|
|
class GnuLdParserTest
|
|
: public ParserTest<GnuLdDriver, std::unique_ptr<ELFLinkingContext>> {
|
|
protected:
|
|
virtual const LinkingContext *linkingContext() { return _context.get(); }
|
|
};
|
|
|
|
TEST_F(GnuLdParserTest, Empty) {
|
|
EXPECT_FALSE(parse("ld", nullptr));
|
|
EXPECT_EQ(linkingContext(), nullptr);
|
|
EXPECT_EQ("No input files\n", errorMessage());
|
|
}
|
|
|
|
} // end anonymous namespace
|