From: Rui Ueyama Date: Tue, 1 Mar 2016 23:44:05 +0000 (+0000) Subject: Remove CoreDriver. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1054ae7e1e661fb033afac4ec1a8a0304ea4d740;p=platform%2Fupstream%2Fllvm.git Remove CoreDriver. CoreDriver implements a driver for a hypothetical platform. It is intended to be used in unittests. However, it is actually redundant because the features are tested using the real driver for the real platforms. So we can remove this. http://reviews.llvm.org/D17698 llvm-svn: 262421 --- diff --git a/lld/include/lld/Driver/Driver.h b/lld/include/lld/Driver/Driver.h index b990613..86bb5b9 100644 --- a/lld/include/lld/Driver/Driver.h +++ b/lld/include/lld/Driver/Driver.h @@ -78,23 +78,6 @@ namespace elf { bool link(llvm::ArrayRef args, raw_ostream &diag = llvm::errs()); } -/// Driver for lld unit tests -class CoreDriver : public Driver { -public: - /// Parses command line arguments same as lld-core and performs link. - /// Returns true iff there was an error. - static bool link(llvm::ArrayRef args, - raw_ostream &diag = llvm::errs()); - - /// Uses lld-core command line options to fill in options struct. - /// Returns true iff there was an error. - static bool parse(llvm::ArrayRef args, CoreLinkingContext &info, - raw_ostream &diag = llvm::errs()); - -private: - CoreDriver() = delete; -}; - } // end namespace lld #endif diff --git a/lld/lib/Driver/CMakeLists.txt b/lld/lib/Driver/CMakeLists.txt index d577d80..4d9d284 100644 --- a/lld/lib/Driver/CMakeLists.txt +++ b/lld/lib/Driver/CMakeLists.txt @@ -1,11 +1,8 @@ -set(LLVM_TARGET_DEFINITIONS CoreOptions.td) -tablegen(LLVM CoreOptions.inc -gen-opt-parser-defs) set(LLVM_TARGET_DEFINITIONS DarwinLdOptions.td) tablegen(LLVM DarwinLdOptions.inc -gen-opt-parser-defs) add_public_tablegen_target(DriverOptionsTableGen) add_lld_library(lldDriver - CoreDriver.cpp DarwinLdDriver.cpp Driver.cpp diff --git a/lld/lib/Driver/CoreDriver.cpp b/lld/lib/Driver/CoreDriver.cpp deleted file mode 100644 index ce86485..0000000 --- a/lld/lib/Driver/CoreDriver.cpp +++ /dev/null @@ -1,173 +0,0 @@ -//===- lib/Driver/CoreDriver.cpp ------------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lld/Core/Reader.h" -#include "lld/Driver/Driver.h" -#include "lld/ReaderWriter/CoreLinkingContext.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Option/Arg.h" -#include "llvm/Option/Option.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Host.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/Path.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/Signals.h" -#include "llvm/Support/raw_ostream.h" - -using namespace lld; - -namespace { - -// Create enum with OPT_xxx values for each option in CoreOptions.td -enum { - OPT_INVALID = 0, -#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ - HELP, META) \ - OPT_##ID, -#include "CoreOptions.inc" -#undef OPTION -}; - -// Create prefix string literals used in CoreOptions.td -#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; -#include "CoreOptions.inc" -#undef PREFIX - -// Create table mapping all options defined in CoreOptions.td -static const llvm::opt::OptTable::Info infoTable[] = { -#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ - HELPTEXT, METAVAR) \ - { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, llvm::opt::Option::KIND##Class, \ - PARAM, FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS }, -#include "CoreOptions.inc" -#undef OPTION -}; - -// Create OptTable class for parsing actual command line arguments -class CoreOptTable : public llvm::opt::OptTable { -public: - CoreOptTable() : OptTable(infoTable) {} -}; - -} // namespace anonymous - - -namespace lld { - -static const Registry::KindStrings coreKindStrings[] = { - { CoreLinkingContext::TEST_RELOC_CALL32, "call32" }, - { CoreLinkingContext::TEST_RELOC_PCREL32, "pcrel32" }, - { CoreLinkingContext::TEST_RELOC_GOT_LOAD32, "gotLoad32" }, - { CoreLinkingContext::TEST_RELOC_GOT_USE32, "gotUse32" }, - { CoreLinkingContext::TEST_RELOC_LEA32_WAS_GOT, "lea32wasGot" }, - LLD_KIND_STRING_END -}; - -bool CoreDriver::link(llvm::ArrayRef args, - raw_ostream &diagnostics) { - CoreLinkingContext ctx; - - // Register possible input file parsers. - ctx.registry().addSupportYamlFiles(); - ctx.registry().addKindTable(Reference::KindNamespace::testing, - Reference::KindArch::all, coreKindStrings); - - if (!parse(args, ctx)) - return false; - return Driver::link(ctx); -} - -bool CoreDriver::parse(llvm::ArrayRef args, - CoreLinkingContext &ctx, raw_ostream &diagnostics) { - // Parse command line options using CoreOptions.td - CoreOptTable table; - unsigned missingIndex; - unsigned missingCount; - llvm::opt::InputArgList parsedArgs = - table.ParseArgs(args.slice(1), missingIndex, missingCount); - if (missingCount) { - diagnostics << "error: missing arg value for '" - << parsedArgs.getArgString(missingIndex) << "' expected " - << missingCount << " argument(s).\n"; - return false; - } - - // Set default options - ctx.setOutputPath("-"); - ctx.setDeadStripping(false); - ctx.setGlobalsAreDeadStripRoots(false); - ctx.setPrintRemainingUndefines(false); - ctx.setAllowRemainingUndefines(true); - ctx.setSearchArchivesToOverrideTentativeDefinitions(false); - - // Process all the arguments and create input files. - for (auto inputArg : parsedArgs) { - switch (inputArg->getOption().getID()) { - case OPT_mllvm: - ctx.appendLLVMOption(inputArg->getValue()); - break; - - case OPT_entry: - ctx.setEntrySymbolName(inputArg->getValue()); - break; - - case OPT_output: - ctx.setOutputPath(inputArg->getValue()); - break; - - case OPT_dead_strip: - ctx.setDeadStripping(true); - break; - - case OPT_keep_globals: - ctx.setGlobalsAreDeadStripRoots(true); - break; - - case OPT_undefines_are_errors: - ctx.setPrintRemainingUndefines(true); - ctx.setAllowRemainingUndefines(false); - break; - - case OPT_commons_search_archives: - ctx.setSearchArchivesToOverrideTentativeDefinitions(true); - break; - - case OPT_add_pass: - ctx.addPassNamed(inputArg->getValue()); - break; - - case OPT_INPUT: { - std::vector> files - = loadFile(ctx, inputArg->getValue(), false); - for (std::unique_ptr &file : files) - ctx.getNodes().push_back(llvm::make_unique(std::move(file))); - break; - } - - default: - break; - } - } - - parseLLVMOptions(ctx); - - if (ctx.getNodes().empty()) { - diagnostics << "No input files\n"; - return false; - } - - // Validate the combination of options used. - return ctx.validate(diagnostics); -} - -} // namespace lld diff --git a/lld/lib/Driver/CoreOptions.td b/lld/lib/Driver/CoreOptions.td deleted file mode 100644 index df7cb41..0000000 --- a/lld/lib/Driver/CoreOptions.td +++ /dev/null @@ -1,15 +0,0 @@ -include "llvm/Option/OptParser.td" - -def output : Separate<["-"], "o">; -def entry : Separate<["-"], "e">; - -def dead_strip : Flag<["--"], "dead-strip">; -def undefines_are_errors : Flag<["--"], "undefines-are-errors">; -def keep_globals : Flag<["--"], "keep-globals">; -def commons_search_archives : Flag<["--"], "commons-search-archives">; - -def add_pass : Separate<["--"], "add-pass">; - -def target : Separate<["-"], "target">, HelpText<"Target triple to link for">; -def mllvm : Separate<["-"], "mllvm">, HelpText<"Options to pass to LLVM">; - diff --git a/lld/test/core/Inputs/archive-basic.objtxt b/lld/test/core/Inputs/archive-basic.objtxt deleted file mode 100644 index ecfdacd..0000000 --- a/lld/test/core/Inputs/archive-basic.objtxt +++ /dev/null @@ -1,21 +0,0 @@ ---- !archive -members: - - name: bar.o - content: !native - defined-atoms: - - name: bar - scope: global - type: code - - - name: bar2 - type: code - - - name: baz.o - content: !native - defined-atoms: - - name: baz - scope: global - type: code - - - name: baz2 - type: code diff --git a/lld/test/core/Inputs/archive-chain.objtxt b/lld/test/core/Inputs/archive-chain.objtxt deleted file mode 100644 index d3cc171..0000000 --- a/lld/test/core/Inputs/archive-chain.objtxt +++ /dev/null @@ -1,24 +0,0 @@ ---- !archive -members: - - name: bar1.o - content: !native - defined-atoms: - - name: bar1 - scope: global - type: code - - - name: bar1b - type: code - - undefined-atoms: - - name: baz1 - - - name: bar2.o - content: !native - defined-atoms: - - name: bar2 - scope: global - type: code - - - name: bar2b - type: code diff --git a/lld/test/core/Inputs/archive-chain2.objtxt b/lld/test/core/Inputs/archive-chain2.objtxt deleted file mode 100644 index aed6b1b..0000000 --- a/lld/test/core/Inputs/archive-chain2.objtxt +++ /dev/null @@ -1,21 +0,0 @@ ---- !archive -members: - - name: baz1.o - content: !native - defined-atoms: - - name: baz1 - scope: global - type: code - - - name: baz1b - type: code - - - name: baz2.o - content: !native - defined-atoms: - - name: baz2 - scope: global - type: code - - - name: baz2b - type: code diff --git a/lld/test/core/Inputs/archive-tentdef-search.objtxt b/lld/test/core/Inputs/archive-tentdef-search.objtxt deleted file mode 100644 index 70219aac..0000000 --- a/lld/test/core/Inputs/archive-tentdef-search.objtxt +++ /dev/null @@ -1,11 +0,0 @@ ---- !archive -members: - - name: bar.o - content: !native - defined-atoms: - - name: bar - scope: global - type: data - - - name: bar2 - type: data diff --git a/lld/test/core/Inputs/associates.objtxt b/lld/test/core/Inputs/associates.objtxt deleted file mode 100644 index 29d028c..0000000 --- a/lld/test/core/Inputs/associates.objtxt +++ /dev/null @@ -1,8 +0,0 @@ -defined-atoms: - - name: f1 - merge: as-weak - scope: global - references: - - kind: associate - target: f2 - - name: f2 diff --git a/lld/test/core/Inputs/auto-hide-coalesce.objtxt b/lld/test/core/Inputs/auto-hide-coalesce.objtxt deleted file mode 100644 index d82d0f4..0000000 --- a/lld/test/core/Inputs/auto-hide-coalesce.objtxt +++ /dev/null @@ -1,20 +0,0 @@ -defined-atoms: - - name: _inlineFunc1 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc2 - scope: global - type: code - merge: as-addressed-weak - - - name: _inlineFunc3 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc4 - scope: global - type: code - merge: as-addressed-weak diff --git a/lld/test/core/Inputs/code-model-attributes.objtxt b/lld/test/core/Inputs/code-model-attributes.objtxt deleted file mode 100644 index 7c01a0d..0000000 --- a/lld/test/core/Inputs/code-model-attributes.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _none - code-model: none diff --git a/lld/test/core/Inputs/code-model-attributes2.objtxt b/lld/test/core/Inputs/code-model-attributes2.objtxt deleted file mode 100644 index 92df88c..0000000 --- a/lld/test/core/Inputs/code-model-attributes2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_pic - code-model: mips-pic diff --git a/lld/test/core/Inputs/code-model-attributes3.objtxt b/lld/test/core/Inputs/code-model-attributes3.objtxt deleted file mode 100644 index 8f2ced1..0000000 --- a/lld/test/core/Inputs/code-model-attributes3.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_micro - code-model: mips-micro diff --git a/lld/test/core/Inputs/code-model-attributes4.objtxt b/lld/test/core/Inputs/code-model-attributes4.objtxt deleted file mode 100644 index 160c9a0..0000000 --- a/lld/test/core/Inputs/code-model-attributes4.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_micro_pic - code-model: mips-micro-pic diff --git a/lld/test/core/Inputs/code-model-attributes5.objtxt b/lld/test/core/Inputs/code-model-attributes5.objtxt deleted file mode 100644 index 99bdb54..0000000 --- a/lld/test/core/Inputs/code-model-attributes5.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_16 - code-model: mips-16 diff --git a/lld/test/core/Inputs/constants-coalesce.objtxt b/lld/test/core/Inputs/constants-coalesce.objtxt deleted file mode 100644 index ea3436f..0000000 --- a/lld/test/core/Inputs/constants-coalesce.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - content: [ 01, 02 ] - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] diff --git a/lld/test/core/Inputs/constants-coalesce2.objtxt b/lld/test/core/Inputs/constants-coalesce2.objtxt deleted file mode 100644 index c8f10f4..0000000 --- a/lld/test/core/Inputs/constants-coalesce2.objtxt +++ /dev/null @@ -1,10 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 23, 45, 67, 89, AB, CD, EF ] - - ref-name: L3 - type: constant - merge: by-content - content: [ 01, 02, 03 ] diff --git a/lld/test/core/Inputs/cstring-coalesce.objtxt b/lld/test/core/Inputs/cstring-coalesce.objtxt deleted file mode 100644 index d2e6327..0000000 --- a/lld/test/core/Inputs/cstring-coalesce.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] diff --git a/lld/test/core/Inputs/cstring-coalesce2.objtxt b/lld/test/core/Inputs/cstring-coalesce2.objtxt deleted file mode 100644 index 76dedf7..0000000 --- a/lld/test/core/Inputs/cstring-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] diff --git a/lld/test/core/Inputs/custom-section-coalesce.objtxt b/lld/test/core/Inputs/custom-section-coalesce.objtxt deleted file mode 100644 index de3efe3..0000000 --- a/lld/test/core/Inputs/custom-section-coalesce.objtxt +++ /dev/null @@ -1,15 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection2 diff --git a/lld/test/core/Inputs/custom-section-coalesce2.objtxt b/lld/test/core/Inputs/custom-section-coalesce2.objtxt deleted file mode 100644 index 3e8356f..0000000 --- a/lld/test/core/Inputs/custom-section-coalesce2.objtxt +++ /dev/null @@ -1,13 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 05, 06, 07, 08 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] diff --git a/lld/test/core/Inputs/dead-strip-attributes.objtxt b/lld/test/core/Inputs/dead-strip-attributes.objtxt deleted file mode 100644 index 06a7148..0000000 --- a/lld/test/core/Inputs/dead-strip-attributes.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _foo2 - dead-strip: never diff --git a/lld/test/core/Inputs/dead-strip-attributes2.objtxt b/lld/test/core/Inputs/dead-strip-attributes2.objtxt deleted file mode 100644 index 3dd55c4..0000000 --- a/lld/test/core/Inputs/dead-strip-attributes2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _foo3 - dead-strip: always diff --git a/lld/test/core/Inputs/dead-strip-basic.objtxt b/lld/test/core/Inputs/dead-strip-basic.objtxt deleted file mode 100644 index 05cb81bb..0000000 --- a/lld/test/core/Inputs/dead-strip-basic.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - name: mydead2 - scope: global - type: data - - - name: bar - scope: global - type: data diff --git a/lld/test/core/Inputs/dead-strip-basic2.objtxt b/lld/test/core/Inputs/dead-strip-basic2.objtxt deleted file mode 100644 index 6b0b01a..0000000 --- a/lld/test/core/Inputs/dead-strip-basic2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: baz - scope: global - type: code - - - name: mydead3 - type: code diff --git a/lld/test/core/Inputs/dead-strip-globals.objtxt b/lld/test/core/Inputs/dead-strip-globals.objtxt deleted file mode 100644 index fbf2ba6..0000000 --- a/lld/test/core/Inputs/dead-strip-globals.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - name: myglobal2 - scope: global - type: data - - - name: bar - scope: hidden - type: data diff --git a/lld/test/core/Inputs/dead-strip-globals2.objtxt b/lld/test/core/Inputs/dead-strip-globals2.objtxt deleted file mode 100644 index a314bbe..0000000 --- a/lld/test/core/Inputs/dead-strip-globals2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: baz - scope: hidden - type: code - - - name: mydead - type: code diff --git a/lld/test/core/Inputs/error-duplicate-absolutes.objtxt b/lld/test/core/Inputs/error-duplicate-absolutes.objtxt deleted file mode 100644 index 2b99aa3..0000000 --- a/lld/test/core/Inputs/error-duplicate-absolutes.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -absolute-atoms: - - name: absatom - value: 0 - scope: global diff --git a/lld/test/core/Inputs/gnulinkonce-remaining-undef2.objtxt b/lld/test/core/Inputs/gnulinkonce-remaining-undef2.objtxt deleted file mode 100644 index 4991476..0000000 --- a/lld/test/core/Inputs/gnulinkonce-remaining-undef2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f3 - can-be-null: never diff --git a/lld/test/core/Inputs/gnulinkonce-simple.objtxt b/lld/test/core/Inputs/gnulinkonce-simple.objtxt deleted file mode 100644 index 807f0d3..0000000 --- a/lld/test/core/Inputs/gnulinkonce-simple.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f1 - can-be-null: never diff --git a/lld/test/core/Inputs/inline-coalesce.objtxt b/lld/test/core/Inputs/inline-coalesce.objtxt deleted file mode 100644 index 2eddee6..0000000 --- a/lld/test/core/Inputs/inline-coalesce.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak diff --git a/lld/test/core/Inputs/inline-coalesce2.objtxt b/lld/test/core/Inputs/inline-coalesce2.objtxt deleted file mode 100644 index 2eddee6..0000000 --- a/lld/test/core/Inputs/inline-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak diff --git a/lld/test/core/Inputs/multiple-def-error.objtxt b/lld/test/core/Inputs/multiple-def-error.objtxt deleted file mode 100644 index 8a1dcdb..0000000 --- a/lld/test/core/Inputs/multiple-def-error.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data diff --git a/lld/test/core/Inputs/sectiongroup-deadstrip.objtxt b/lld/test/core/Inputs/sectiongroup-deadstrip.objtxt deleted file mode 100644 index 392f7ee..0000000 --- a/lld/test/core/Inputs/sectiongroup-deadstrip.objtxt +++ /dev/null @@ -1,3 +0,0 @@ -undefined-atoms: - - name: f1 - can-be-null: never diff --git a/lld/test/core/Inputs/sectiongroup-remaining-undef2.objtxt b/lld/test/core/Inputs/sectiongroup-remaining-undef2.objtxt deleted file mode 100644 index 4991476..0000000 --- a/lld/test/core/Inputs/sectiongroup-remaining-undef2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f3 - can-be-null: never diff --git a/lld/test/core/Inputs/sectiongroup-simple.objtxt b/lld/test/core/Inputs/sectiongroup-simple.objtxt deleted file mode 100644 index 807f0d3..0000000 --- a/lld/test/core/Inputs/sectiongroup-simple.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f1 - can-be-null: never diff --git a/lld/test/core/Inputs/shared-library-coalesce.objtxt b/lld/test/core/Inputs/shared-library-coalesce.objtxt deleted file mode 100644 index 57cdfe6..0000000 --- a/lld/test/core/Inputs/shared-library-coalesce.objtxt +++ /dev/null @@ -1,28 +0,0 @@ ---- -shared-library-atoms: - - name: foo2 - load-name: libc.so - - - name: foo3 - load-name: libc.so - - - name: bar2 - load-name: libc.so - can-be-null: at-runtime - - - name: bar3 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull1 - load-name: libc.so - - - name: mismatchNull2 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchload1 - load-name: libb.so - - - name: mismatchload2 - load-name: liba.so diff --git a/lld/test/core/Inputs/tent-merge.objtxt b/lld/test/core/Inputs/tent-merge.objtxt deleted file mode 100644 index 90db8fd..0000000 --- a/lld/test/core/Inputs/tent-merge.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data - content: [ 00, 00, 00, 00 ] diff --git a/lld/test/core/Inputs/undef-coalesce-error.objtxt b/lld/test/core/Inputs/undef-coalesce-error.objtxt deleted file mode 100644 index f493f00..0000000 --- a/lld/test/core/Inputs/undef-coalesce-error.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: bar - type: code - -undefined-atoms: - - name: malloc - - name: myfunc diff --git a/lld/test/core/Inputs/undef-coalesce-error2.objtxt b/lld/test/core/Inputs/undef-coalesce-error2.objtxt deleted file mode 100644 index 88d736f..0000000 --- a/lld/test/core/Inputs/undef-coalesce-error2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: myfunc - scope: global - type: code - -undefined-atoms: - - name: free diff --git a/lld/test/core/Inputs/undef-coalesce.objtxt b/lld/test/core/Inputs/undef-coalesce.objtxt deleted file mode 100644 index f493f00..0000000 --- a/lld/test/core/Inputs/undef-coalesce.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: bar - type: code - -undefined-atoms: - - name: malloc - - name: myfunc diff --git a/lld/test/core/Inputs/undef-coalesce2.objtxt b/lld/test/core/Inputs/undef-coalesce2.objtxt deleted file mode 100644 index 88d736f..0000000 --- a/lld/test/core/Inputs/undef-coalesce2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: myfunc - scope: global - type: code - -undefined-atoms: - - name: free diff --git a/lld/test/core/Inputs/undef-fallback.objtxt b/lld/test/core/Inputs/undef-fallback.objtxt deleted file mode 100644 index c392731..0000000 --- a/lld/test/core/Inputs/undef-fallback.objtxt +++ /dev/null @@ -1,7 +0,0 @@ -defined-atoms: - - name: fallback1 - -undefined-atoms: - - name: def1 - fallback: - name: fallback3 diff --git a/lld/test/core/Inputs/undef-weak-coalesce.objtxt b/lld/test/core/Inputs/undef-weak-coalesce.objtxt deleted file mode 100644 index 7a5e20f..0000000 --- a/lld/test/core/Inputs/undef-weak-coalesce.objtxt +++ /dev/null @@ -1,20 +0,0 @@ ---- -undefined-atoms: - - name: bar1 - can-be-null: never - - name: bar2 - can-be-null: at-runtime - - name: bar3 - can-be-null: at-buildtime - - name: bar4 - can-be-null: at-runtime - - name: bar5 - can-be-null: at-buildtime - - name: bar6 - can-be-null: never - - name: bar7 - can-be-null: at-buildtime - - name: bar8 - can-be-null: never - - name: bar9 - can-be-null: at-runtime diff --git a/lld/test/core/Inputs/weak-coalesce.objtxt b/lld/test/core/Inputs/weak-coalesce.objtxt deleted file mode 100644 index 8a1dcdb..0000000 --- a/lld/test/core/Inputs/weak-coalesce.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data diff --git a/lld/test/core/Inputs/weak-coalesce2.objtxt b/lld/test/core/Inputs/weak-coalesce2.objtxt deleted file mode 100644 index 1039b30..0000000 --- a/lld/test/core/Inputs/weak-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _foo - merge: as-weak - scope: global - type: data diff --git a/lld/test/core/absolute-basic.objtxt b/lld/test/core/absolute-basic.objtxt deleted file mode 100644 index edfbe862..0000000 --- a/lld/test/core/absolute-basic.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core --dead-strip %s | FileCheck %s - -# -# Test that absolute symbols are parsed and preserved -# - ---- -absolute-atoms: - - name: putchar - value: 0xFFFF0040 - - - name: reset - value: 0xFFFF0080 - -... - - -# CHECK: absolute-atoms: -# CHECK: name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: name: reset -# CHECK: value: 0x00000000FFFF0080 -# CHECK: ... diff --git a/lld/test/core/absolute-local.objtxt b/lld/test/core/absolute-local.objtxt deleted file mode 100644 index 1ba4c7f..0000000 --- a/lld/test/core/absolute-local.objtxt +++ /dev/null @@ -1,25 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that absolute symbols with local scope do not cause name conflict -# ---- -absolute-atoms: - - name: putchar - ref-name: pc1 - value: 0xFFFF0040 - scope: static - - - name: putchar - ref-name: pc2 - value: 0xFFFF0040 - scope: static -... - -# CHECK: --- -# CHECK: absolute-atoms: -# CHECK: - name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: - name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: ... diff --git a/lld/test/core/archive-basic.objtxt b/lld/test/core/archive-basic.objtxt deleted file mode 100644 index 205e0a5..0000000 --- a/lld/test/core/archive-basic.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-basic.objtxt | FileCheck %s - -# -# Tests archives in YAML. Tests that an undefined in a regular file will load -# all atoms in select archive members. -# - ---- !native -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: bar - -... - -# CHECK: name: foo -# CHECK-NOT: undefined-atoms: -# CHECK: name: bar -# CHECK: name: bar2 -# CHECK-NOT: name: baz -# CHECK: ... diff --git a/lld/test/core/archive-chain.objtxt b/lld/test/core/archive-chain.objtxt deleted file mode 100644 index 35417f0..0000000 --- a/lld/test/core/archive-chain.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-chain.objtxt %p/Inputs/archive-chain2.objtxt | FileCheck %s - -# -# Tests that an undefine in one archive can force a load from another archive. -# - ---- !native -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: bar1 -... - -# CHECK: name: foo -# CHECK: name: bar1 -# CHECK: name: bar1b -# CHECK-NOT: name: bar2 -# CHECK: name: baz1 -# CHECK: name: baz1b -# CHECK-NOT: name: baz2 -# CHECK: ... diff --git a/lld/test/core/archive-tentdef-search.objtxt b/lld/test/core/archive-tentdef-search.objtxt deleted file mode 100644 index 230ab0b..0000000 --- a/lld/test/core/archive-tentdef-search.objtxt +++ /dev/null @@ -1,30 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-tentdef-search.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core --commons-search-archives %s %p/Inputs/archive-tentdef-search.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Tests that -commons-search-archives cause core linker to look for overrides -# of tentative definition in archives, and that not using that option -# does not search. -# - ---- !native -defined-atoms: - - name: foo - type: code - - - name: bar - scope: global - type: zero-fill - merge: as-tentative -... - -# CHK1: name: foo -# CHK1: name: bar -# CHK1: merge: as-tentative -# CHK1: ... - -# CHK2: name: foo -# CHK2: name: bar -# CHK2-NOT: merge: as-tentative -# CHK2: name: bar2 -# CHK2: ... diff --git a/lld/test/core/associates.objtxt b/lld/test/core/associates.objtxt deleted file mode 100644 index 5c711c9..0000000 --- a/lld/test/core/associates.objtxt +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: lld -core %s %p/Inputs/associates.objtxt | FileCheck %s - ---- -defined-atoms: - - name: f1 - merge: as-weak - scope: global - references: - - kind: associate - target: f2 - - name: f2 -... - -# CHECK: defined-atoms: -# CHECK: - name: f1 -# CHECK: scope: global -# CHECK: references: -# CHECK: - kind: associate -# CHECK: target: f2 -# CHECK: - name: f2 -# CHECK-NOT: - name: f2 diff --git a/lld/test/core/auto-hide-coalesce.objtxt b/lld/test/core/auto-hide-coalesce.objtxt deleted file mode 100644 index 63c5495..0000000 --- a/lld/test/core/auto-hide-coalesce.objtxt +++ /dev/null @@ -1,39 +0,0 @@ -# RUN: lld -core %s %p/Inputs/auto-hide-coalesce.objtxt | FileCheck %s - -# -# Tests auto-hide bit during coalescing -# - ---- -defined-atoms: - - name: _inlineFunc1 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc2 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc3 - scope: global - type: code - merge: as-addressed-weak - - - name: _inlineFunc4 - scope: global - type: code - merge: as-addressed-weak -... - - -# CHECK: name: _inlineFunc1 -# CHECK: merge: as-weak -# CHECK: name: _inlineFunc3 -# CHECK: merge: as-addressed-weak -# CHECK: name: _inlineFunc4 -# CHECK: merge: as-addressed-weak -# CHECK: name: _inlineFunc2 -# CHECK: merge: as-addressed-weak -# CHECK: ... diff --git a/lld/test/core/code-model-attributes.objtxt b/lld/test/core/code-model-attributes.objtxt deleted file mode 100644 index 9bb4a01..0000000 --- a/lld/test/core/code-model-attributes.objtxt +++ /dev/null @@ -1,33 +0,0 @@ -# RUN: lld -core %s %p/Inputs/code-model-attributes.objtxt \ -# RUN: %p/Inputs/code-model-attributes2.objtxt \ -# RUN: %p/Inputs/code-model-attributes3.objtxt \ -# RUN: %p/Inputs/code-model-attributes4.objtxt \ -# RUN: %p/Inputs/code-model-attributes5.objtxt | FileCheck %s -# -# Test that code model attributes are preserved -# - ---- -defined-atoms: - - name: _def -... - -# CHECK: name: _def -# CHECK-NOT: code-model: mips-pic -# CHECK-NOT: code-model: mips-micro -# CHECK-NOT: code-model: mips-micro-pic -# CHECK-NOT: code-model: mips-16 -# CHECK: name: _none -# CHECK-NOT: code-model: mips-pic -# CHECK-NOT: code-model: mips-micro -# CHECK-NOT: code-model: mips-micro-pic -# CHECK-NOT: code-model: mips-16 -# CHECK: name: _mips_pic -# CHECK: code-model: mips-pic -# CHECK: name: _mips_micro -# CHECK: code-model: mips-micro -# CHECK: name: _mips_micro_pic -# CHECK: code-model: mips-micro-pic -# CHECK: name: _mips_16 -# CHECK: code-model: mips-16 -# CHECK: ... diff --git a/lld/test/core/constants-coalesce.objtxt b/lld/test/core/constants-coalesce.objtxt deleted file mode 100644 index 1a9f101..0000000 --- a/lld/test/core/constants-coalesce.objtxt +++ /dev/null @@ -1,42 +0,0 @@ -# RUN: lld -core %s %p/Inputs/constants-coalesce.objtxt \ -# RUN: %p/Inputs/constants-coalesce2.objtxt | FileCheck %s - -# -# Test that duplicate merge-by-content anonymous constants are coalesced -# and non-mergable duplicate constants are not coalesced. -# - ---- -defined-atoms: - - ref-name: L4-byte - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - - - ref-name: L8-byte - type: constant - merge: by-content - content: [ 01, 23, 45, 67, 89, AB, CD, EF ] - - - ref-name: L1 - type: constant - content: [ 01, 02 ] -... - -# CHECK-NOT: name: -# CHECK: type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: type: constant -# CHECK: content: [ 01, 23, 45, 67, 89, AB, CD, EF ] -# CHECK: merge: by-content -# CHECK: type: constant -# CHECK: content: [ 01, 02 ] -# CHECK: type: constant -# CHECK: content: [ 01, 02 ] -# CHECK: type: constant -# CHECK: content: [ 01, 02, 03 ] -# CHECK: merge: by-content -# CHECK: ... - - diff --git a/lld/test/core/cstring-coalesce.objtxt b/lld/test/core/cstring-coalesce.objtxt deleted file mode 100644 index 4d32c00..0000000 --- a/lld/test/core/cstring-coalesce.objtxt +++ /dev/null @@ -1,29 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that duplicate c-strings are coalesced -# - ---- -defined-atoms: - - ref-name: L0 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] - - - ref-name: L1 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] -... - -# CHECK-NOT: name: -# CHECK: type: c-string -# CHECK: content: [ 68, 65, 6C, 6C, 6F, 00 ] -# CHECK: merge: by-content -# CHECK: type: c-string -# CHECK: content: [ 74, 68, 65, 72, 65, 00 ] -# CHECK: merge: by-content -# CHECK: ... - - diff --git a/lld/test/core/custom-section-coalesce.objtxt b/lld/test/core/custom-section-coalesce.objtxt deleted file mode 100644 index fcf0484..0000000 --- a/lld/test/core/custom-section-coalesce.objtxt +++ /dev/null @@ -1,50 +0,0 @@ -# RUN: lld -core %s %p/Inputs/custom-section-coalesce.objtxt \ -# RUN: %p/Inputs/custom-section-coalesce2.objtxt | FileCheck %s - -# -# Test that custom sections are preserved when duplicate merge-by-content -# constants are coalesced. -# - ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 05, 06, 07, 08 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L3 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] -... - - -# CHECK:defined-atoms: -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection -# CHECK: - type: constant -# CHECK: content: [ 05, 06, 07, 08 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection2 diff --git a/lld/test/core/custom-section.objtxt b/lld/test/core/custom-section.objtxt deleted file mode 100644 index ce305e9..0000000 --- a/lld/test/core/custom-section.objtxt +++ /dev/null @@ -1,34 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that custom sections are preserved -# - ---- -defined-atoms: - - name: _foo1 - scope: global - section-choice: content - - - name: _foo2 - scope: global - section-choice: custom - section-name: __foozle - - - name: _foo3 - scope: global - section-choice: custom-required - section-name: __boozle - -... - - -# CHECK: name: _foo1 -# CHECK-NOT: section-name: -# CHECK: name: _foo2 -# CHECK: section-choice: custom -# CHECK: section-name: __foozle -# CHECK: name: _foo3 -# CHECK: section-choice: custom-required -# CHECK: section-name: __boozle -# CHECK: ... diff --git a/lld/test/core/dead-strip-attributes.objtxt b/lld/test/core/dead-strip-attributes.objtxt deleted file mode 100644 index 2a1c976..0000000 --- a/lld/test/core/dead-strip-attributes.objtxt +++ /dev/null @@ -1,22 +0,0 @@ -# RUN: lld -core %s %p/Inputs/dead-strip-attributes.objtxt \ -# RUN: %p/Inputs/dead-strip-attributes2.objtxt | FileCheck %s - -# -# Test that dead strip attributes are preserved -# - ---- -defined-atoms: - - name: _foo1 - dead-strip: normal -... - - -# CHECK: name: _foo1 -# CHECK-NOT: dead-strip: never -# CHECK-NOT: dead-strip: always -# CHECK: name: _foo2 -# CHECK: dead-strip: never -# CHECK: name: _foo3 -# CHECK: dead-strip: always -# CHECK: ... diff --git a/lld/test/core/dead-strip-basic.objtxt b/lld/test/core/dead-strip-basic.objtxt deleted file mode 100644 index 1607ea9..0000000 --- a/lld/test/core/dead-strip-basic.objtxt +++ /dev/null @@ -1,45 +0,0 @@ -# RUN: lld -core --dead-strip %s %p/Inputs/dead-strip-basic.objtxt %p/Inputs/dead-strip-basic2.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core %s %p/Inputs/dead-strip-basic.objtxt %p/Inputs/dead-strip-basic2.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Test that -dead-strip removes unreachable code and data -# and that not using that option leaves them. -# - ---- -defined-atoms: - - name: entry - dead-strip: never - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: mydead1 - scope: global - -undefined-atoms: - - name: bar - - - name: baz -... - - -# CHK1: name: entry -# CHK1-NOT: name: mydead1 -# CHK1: name: bar -# CHK1-NOT: name: mydead2 -# CHK1: name: baz -# CHK1-NOT: name: mydead3 -# CHK1: ... - -# CHK2: name: entry -# CHK2: name: mydead1 -# CHK2: name: mydead2 -# CHK2: name: bar -# CHK2: name: baz -# CHK2: name: mydead3 -# CHK2: ... diff --git a/lld/test/core/dead-strip-globals.objtxt b/lld/test/core/dead-strip-globals.objtxt deleted file mode 100644 index e4b11b1..0000000 --- a/lld/test/core/dead-strip-globals.objtxt +++ /dev/null @@ -1,43 +0,0 @@ -# RUN: lld -core --dead-strip --keep-globals %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core --dead-strip %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Test that -keep-globals prevents -dead-strip from removing globals. -# - ---- -defined-atoms: - - name: entry - dead-strip: never - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: myglobal1 - scope: global - -undefined-atoms: - - name: bar - - name: baz -... - - -# CHK1: name: entry -# CHK1: name: myglobal1 -# CHK1: name: myglobal2 -# CHK1: name: bar -# CHK1: name: baz -# CHK1-NOT: name: mydead -# CHK1: ... - -# CHK2: name: entry -# CHK2-NOT: name: myglobal1 -# CHK2-NOT: name: myglobal2 -# CHK2: name: bar -# CHK2: name: baz -# CHK2-NOT: name: mydead -# CHK2: ... diff --git a/lld/test/core/dead-strip-reverse.objtxt b/lld/test/core/dead-strip-reverse.objtxt deleted file mode 100644 index f471beb..0000000 --- a/lld/test/core/dead-strip-reverse.objtxt +++ /dev/null @@ -1,25 +0,0 @@ -# RUN: lld -core --dead-strip %s | FileCheck -check-prefix=CHECK1 %s -# RUN: lld -core %s | FileCheck -check-prefix=CHECK2 %s - ---- -defined-atoms: - - name: entry - dead-strip: never - scope: global - references: - - kind: layout-after - offset: 0 - target: def - - name: def - scope: global - - name: dead - scope: global -... - -# CHECK1: name: entry -# CHECK1: name: def -# CHECK1-NOT: name: dead - -# CHECK2: name: entry -# CHECK2: name: def -# CHECK2: name: dead diff --git a/lld/test/core/error-atom-attribute.objtxt b/lld/test/core/error-atom-attribute.objtxt deleted file mode 100644 index 6643aba..0000000 --- a/lld/test/core/error-atom-attribute.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown atom attribute produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - foobar: true - dead-strip: never - -... - - -# CHECK: error: unknown key 'foobar' -# CHECK: foobar diff --git a/lld/test/core/error-atom-content-byte-value.objtxt b/lld/test/core/error-atom-content-byte-value.objtxt deleted file mode 100644 index 6e67557..0000000 --- a/lld/test/core/error-atom-content-byte-value.objtxt +++ /dev/null @@ -1,18 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an invalid hex byte produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - content: [ A5, 00, 4G, 1F ] - -... - - -# CHECK: error: invalid two-digit-hex number -# CHECK: 4G diff --git a/lld/test/core/error-atom-content-bytes.objtxt b/lld/test/core/error-atom-content-bytes.objtxt deleted file mode 100644 index a8a82b2..0000000 --- a/lld/test/core/error-atom-content-bytes.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an out of range byte value produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - content: [ A5, 1234, 00, 4F ] - -... - - -# CHECK: error: out of range two-digit-hex number -# CHECK: 1234 - diff --git a/lld/test/core/error-atom-type.objtxt b/lld/test/core/error-atom-type.objtxt deleted file mode 100644 index b0943f8..0000000 --- a/lld/test/core/error-atom-type.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an unknown content type produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - type: superluminal - dead-strip: never - -... - - -# CHECK: error: unknown enumerated scalar -# CHECK: superluminal diff --git a/lld/test/core/error-atom-undefined-wrong-attribue.objtxt b/lld/test/core/error-atom-undefined-wrong-attribue.objtxt deleted file mode 100644 index 5cdd851..0000000 --- a/lld/test/core/error-atom-undefined-wrong-attribue.objtxt +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that a defined attribute on an undefined atom produces a readable error. -# - ---- -undefined-atoms: - - name: foo - type: code - -... - - -# CHECK: error: unknown key 'type' - diff --git a/lld/test/core/error-duplicate-absolutes.objtxt b/lld/test/core/error-duplicate-absolutes.objtxt deleted file mode 100644 index 513a2f4..0000000 --- a/lld/test/core/error-duplicate-absolutes.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s %p/Inputs/error-duplicate-absolutes.objtxt 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that duplicate absolute atoms produces a readable error. -# - ---- -absolute-atoms: - - name: absatom - value: 0 - scope: global -undefined-atoms: - - name: undefatom -... - - -# CHECK: SymbolTable: error while merging absatom -# CHECK: LLVM ERROR: duplicate symbol error diff --git a/lld/test/core/error-file-attribute.objtxt b/lld/test/core/error-file-attribute.objtxt deleted file mode 100644 index d8393dc..0000000 --- a/lld/test/core/error-file-attribute.objtxt +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown file attribute produces a readable error. -# - ---- -aardvark: true -defined-atoms: - - name: entry - scope: hidden - -... - - -# CHECK: error: unknown key 'aardvark' diff --git a/lld/test/core/error-fixup-attribute.objtxt b/lld/test/core/error-fixup-attribute.objtxt deleted file mode 100644 index 025783a..0000000 --- a/lld/test/core/error-fixup-attribute.objtxt +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown fixup attribute produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - references: - - offset: 3 - kind: pcrel32 - weasel: bar - addend: 100 - -... - - -# CHECK: error: unknown key 'weasel' diff --git a/lld/test/core/error-fixup-target.objtxt b/lld/test/core/error-fixup-target.objtxt deleted file mode 100644 index 0e20d16..0000000 --- a/lld/test/core/error-fixup-target.objtxt +++ /dev/null @@ -1,26 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unbindable target name produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - references: - - offset: 3 - kind: pcrel32 - target: bar - - offset: 5 - kind: pcrel32 - target: baz - -undefined-atoms: - - name: bar - -... - - -# CHECK: error: no such atom name: baz diff --git a/lld/test/core/fixups-addend.objtxt b/lld/test/core/fixups-addend.objtxt deleted file mode 100644 index d976150..0000000 --- a/lld/test/core/fixups-addend.objtxt +++ /dev/null @@ -1,50 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test addends in references -# - ---- -defined-atoms: - - name: foo - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: bar - addend: 100 - - offset: 10 - kind: pcrel32 - target: bar - addend: -50 - - - name: func - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: bar - addend: 8000000000 - - offset: 10 - kind: pcrel32 - target: bar - addend: -50 - -undefined-atoms: - - name: bar - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: addend: 100 -# CHECK: addend: -50 -# CHECK: name: func -# CHECK: references: -# CHECK: addend: 8000000000 -# CHECK: addend: -50 diff --git a/lld/test/core/fixups-dup-named.objtxt b/lld/test/core/fixups-dup-named.objtxt deleted file mode 100644 index 1c57cd7..0000000 --- a/lld/test/core/fixups-dup-named.objtxt +++ /dev/null @@ -1,31 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references referencing multiple atoms that have the same name -# - ---- -defined-atoms: - - name: foo - type: code - content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, 00 ] - references: - - offset: 1 - kind: pcrel32 - target: bar_1 - - offset: 6 - kind: pcrel32 - target: bar_2 - - - name: bar - ref-name: bar_1 - scope: static - - - name: bar - ref-name: bar_2 - scope: static - - -... - -# CHECK: ... diff --git a/lld/test/core/fixups-named.objtxt b/lld/test/core/fixups-named.objtxt deleted file mode 100644 index 1427a9b..0000000 --- a/lld/test/core/fixups-named.objtxt +++ /dev/null @@ -1,36 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references to simple named atoms -# - ---- -defined-atoms: - - name: foo - type: code - content: [ E8, 00, 00, 00, 00, - E8, 00, 00, 00, 00 ] - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: baz - scope: static - type: code - -undefined-atoms: - - name: bar - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: target: bar -# CHECK: target: baz -# CHECK: ... - diff --git a/lld/test/core/fixups-unnamed.objtxt b/lld/test/core/fixups-unnamed.objtxt deleted file mode 100644 index 88afb6a..0000000 --- a/lld/test/core/fixups-unnamed.objtxt +++ /dev/null @@ -1,40 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references to unnamed atoms -# - ---- -defined-atoms: - - name: foo - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: LC1 - - offset: 10 - kind: pcrel32 - target: LC2 - - - - ref-name: LC1 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] - - - ref-name: LC2 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: offset: 3 -# CHECK: offset: 10 -# CHECK: ref-name: -# CHECK: ref-name: diff --git a/lld/test/core/inline-coalesce.objtxt b/lld/test/core/inline-coalesce.objtxt deleted file mode 100644 index 5ddc9b2..0000000 --- a/lld/test/core/inline-coalesce.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: lld -core %s %p/Inputs/inline-coalesce.objtxt %p/Inputs/inline-coalesce2.objtxt | FileCheck %s - -# -# Test that non-inlined inlined functions are silently coalesced -# - ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak -... - - -# CHECK: name: _inlineFunc -# CHECK: merge: as-weak -# CHECK-NOT: name: _inlineFunc -# CHECK: ... diff --git a/lld/test/core/multiple-def-error.objtxt b/lld/test/core/multiple-def-error.objtxt deleted file mode 100644 index 5765814..0000000 --- a/lld/test/core/multiple-def-error.objtxt +++ /dev/null @@ -1,14 +0,0 @@ -# RUN: not lld -core %s %p/Inputs/multiple-def-error.objtxt 2>&1 | FileCheck %s - -# -# Test that multiple definitions cause an error -# - -# CHECK: duplicate symbol - ---- -defined-atoms: - - name: _foo - scope: global - type: data -... diff --git a/lld/test/core/permissions.objtxt b/lld/test/core/permissions.objtxt deleted file mode 100644 index af33ea6..0000000 --- a/lld/test/core/permissions.objtxt +++ /dev/null @@ -1,57 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test permissions for known content types are implicit, but can be overridden. -# ---- -defined-atoms: - - name: one - type: code - - - name: two - type: data - permissions: rw- - - - name: three - type: const-data - - - name: four - type: unknown - - - name: oddCode - type: code - permissions: rwx - - - name: oddData - type: data - permissions: rwx - - - name: oddConstData - type: const-data - permissions: rw- - - - name: oddUnknown - type: unknown - permissions: rw- - -... - -# CHECK: --- -# CHECK: defined-atoms: -# CHECK: - name: one -# CHECK-NOT: permissions: -# CHECK: - name: two -# CHECK-NOT: permissions: -# CHECK: - name: three -# CHECK-NOT: permissions: -# CHECK: - name: four -# CHECK-NOT: permissions: -# CHECK: - name: oddCode -# CHECK: permissions: rwx -# CHECK: - name: oddData -# CHECK: permissions: rwx -# CHECK: - name: oddConstData -# CHECK: permissions: rw- -# CHECK: - name: oddUnknown -# CHECK: permissions: rw- -# CHECK: ... diff --git a/lld/test/core/shared-library-basic.objtxt b/lld/test/core/shared-library-basic.objtxt deleted file mode 100644 index 61445e7..0000000 --- a/lld/test/core/shared-library-basic.objtxt +++ /dev/null @@ -1,40 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that shared-library symbols are parsed and preserved -# - ---- -shared-library-atoms: - - name: malloc - load-name: libc.so - type: code - size: 0 - - - name: free - load-name: libc.so - - - name: fast_malloc - load-name: libc.so - can-be-null: at-runtime - - - name: stdout - load-name: libc.so - type: data - size: 8 - -... - -# CHECK: shared-library-atoms: -# CHECK: name: malloc -# CHECK: load-name: libc.so -# CHECK: name: free -# CHECK: load-name: libc.so -# CHECK: name: fast_malloc -# CHECK: load-name: libc.so -# CHECK: can-be-null: at-runtime -# CHECK: name: stdout -# CHECK: load-name: libc.so -# CHECK: type: data -# CHECK: size: 8 -# CHECK: ... diff --git a/lld/test/core/shared-library-coalesce.objtxt b/lld/test/core/shared-library-coalesce.objtxt deleted file mode 100644 index 1cd25d1..0000000 --- a/lld/test/core/shared-library-coalesce.objtxt +++ /dev/null @@ -1,55 +0,0 @@ -# RUN: lld -core %s %p/Inputs/shared-library-coalesce.objtxt | FileCheck %s - -# -# Test that shared library symbols preserve their attributes and merge properly -# - ---- -shared-library-atoms: - - name: foo1 - load-name: libc.so - - - name: foo2 - load-name: libc.so - - - name: bar1 - load-name: libc.so - can-be-null: at-runtime - - - name: bar2 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull1 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull2 - load-name: libc.so - - - name: mismatchload1 - load-name: liba.so - - - name: mismatchload2 - load-name: libb.so - -... - -# CHECK: name: foo1 -# CHECK: name: foo2 -# CHECK: name: bar1 -# CHECK: can-be-null: at-runtime -# CHECK: name: bar2 -# CHECK: can-be-null: at-runtime -# CHECK: name: mismatchNull1 -# CHECK: can-be-null: at-runtime -# CHECK: name: mismatchNull2 -# CHECK-NOT: can-be-null: at-runtime -# CHECK: name: mismatchload1 -# CHECK: load-name: liba.so -# CHECK: name: mismatchload2 -# CHECK: load-name: libb.so -# CHECK: name: foo3 -# CHECK: name: bar3 -# CHECK: can-be-null: at-runtime -# CHECK: ... diff --git a/lld/test/core/tent-merge.objtxt b/lld/test/core/tent-merge.objtxt deleted file mode 100644 index 8997be28..0000000 --- a/lld/test/core/tent-merge.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: lld -core %s %p/Inputs/tent-merge.objtxt | FileCheck %s - -# -# Test that a tentative definition and a regular global are merged into -# one regular global -# - ---- -defined-atoms: - - name: _foo - merge: as-tentative - scope: global - type: zero-fill - size: 4 -... - - -# CHECK: name: _foo -# CHECK-NOT: merge: as-tentative diff --git a/lld/test/core/undef-coalesce-error.objtxt b/lld/test/core/undef-coalesce-error.objtxt deleted file mode 100644 index f0ad8d8..0000000 --- a/lld/test/core/undef-coalesce-error.objtxt +++ /dev/null @@ -1,31 +0,0 @@ -# RUN: not lld -core --undefines-are-errors %s %p/Inputs/undef-coalesce-error.objtxt %p/Inputs/undef-coalesce-error2.objtxt 2> %t.err -# RUN: FileCheck -check-prefix=CHECKERR %s < %t.err -# RUN: lld -core %s %p/Inputs/undef-coalesce-error.objtxt %p/Inputs/undef-coalesce-error2.objtxt | FileCheck %s - -# -# Test that -undefines-are-errors triggers and error -# and that not using that option results in undefined atoms. -# - ---- -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: malloc - - name: free -... - -# CHECKERR: free -# CHECKERR: malloc -# CHECKERR: symbol(s) not found - -# CHECK: defined-atoms: -# CHECK: name: foo -# CHECK: name: bar -# CHECK: name: myfunc -# CHECK: undefined-atoms: -# CHECK: name: malloc -# CHECK: name: free -# CHECK: ... diff --git a/lld/test/core/undef-coalesce.objtxt b/lld/test/core/undef-coalesce.objtxt deleted file mode 100644 index b0ea2b9..0000000 --- a/lld/test/core/undef-coalesce.objtxt +++ /dev/null @@ -1,26 +0,0 @@ -# RUN: lld -core %s %p/Inputs/undef-coalesce.objtxt %p/Inputs/undef-coalesce2.objtxt | FileCheck %s - -# -# Test that undefined symbols are coalesced with other undefined symbols -# and definitions override them. -# - ---- -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: malloc - - name: free -... - -# CHECK: defined-atoms: -# CHECK: name: foo -# CHECK: name: bar -# CHECK: name: myfunc -# CHECK: scope: global -# CHECK: undefined-atoms: -# CHECK: name: malloc -# CHECK: name: free -# CHECK: ... diff --git a/lld/test/core/undef-weak-coalesce.objtxt b/lld/test/core/undef-weak-coalesce.objtxt deleted file mode 100644 index d46a05c..0000000 --- a/lld/test/core/undef-weak-coalesce.objtxt +++ /dev/null @@ -1,52 +0,0 @@ -# RUN: lld -core %s %p/Inputs/undef-weak-coalesce.objtxt| FileCheck %s - -# -# Test that undefined symbols preserve their attributes and merge properly -# - ---- -undefined-atoms: - - name: regular_func - can-be-null: never - - name: weak_import_func - can-be-null: at-runtime - - name: weak_func - can-be-null: at-buildtime - - name: bar1 - can-be-null: never - - name: bar2 - can-be-null: at-runtime - - name: bar3 - can-be-null: at-buildtime - - name: bar4 - can-be-null: never - - name: bar5 - can-be-null: at-runtime - - name: bar6 - can-be-null: at-buildtime - - name: bar7 - can-be-null: never - - name: bar8 - can-be-null: at-runtime - - name: bar9 - can-be-null: at-buildtime -... - -# CHECK: - name: regular_func -# CHECK-NEXT: - name: weak_import_func -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: weak_func -# CHECK-NEXT: can-be-null: at-buildtime -# CHECK-NEXT: - name: bar1 -# CHECK-NEXT: - name: bar2 -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: bar3 -# CHECK-NEXT: can-be-null: at-buildtime -# CHECK-NEXT: - name: bar4 -# CHECK-NEXT: - name: bar5 -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: bar7 -# CHECK-NEXT: - name: bar6 -# CHECK-NEXT: - name: bar8 -# CHECK-NEXT: - name: bar9 -# CHECK-NEXT: can-be-null: at-runtime diff --git a/lld/test/core/weak-coalesce.objtxt b/lld/test/core/weak-coalesce.objtxt deleted file mode 100644 index e92aede..0000000 --- a/lld/test/core/weak-coalesce.objtxt +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: lld -core %s %p/Inputs/weak-coalesce.objtxt \ -# RUN: %p/Inputs/weak-coalesce2.objtxt | FileCheck %s - ---- -defined-atoms: - - name: _foo - merge: as-weak - scope: global - type: data -... - - -# CHECK: name: _foo -# CHECK-NOT: merge: as-weak -# CHECK-NOT: name: _foo -# CHECK: ... diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp index 01b0f32..efbde77 100644 --- a/lld/tools/lld/lld.cpp +++ b/lld/tools/lld/lld.cpp @@ -10,9 +10,9 @@ // This is the entry point to the lld driver. This is a thin wrapper which // dispatches to the given platform specific driver. // -// If there is -flavor option or -core option, it is dispatched according -// to the arguments. If the flavor parameter is not present, then it is -// dispatched according to argv[0]. +// If there is -flavor option, it is dispatched according to the arguments. +// If the flavor parameter is not present, then it is dispatched according +// to argv[0]. // //===----------------------------------------------------------------------===// @@ -36,7 +36,6 @@ enum Flavor { Gnu, // -flavor gnu WinLink, // -flavor link Darwin, // -flavor darwin - Core // -flavor core or -core }; LLVM_ATTRIBUTE_NORETURN static void die(const Twine &S) { @@ -51,7 +50,6 @@ static Flavor getFlavor(StringRef S) { .Case("gnu", Gnu) .Case("link", WinLink) .Case("darwin", Darwin) - .Case("core", Core) .Default(Invalid); } @@ -78,12 +76,6 @@ static Flavor parseProgname(StringRef Progname) { } static Flavor parseFlavor(std::vector &V) { - // If the first argument is -core, then core driver. - if (V.size() > 1 && V[1] == StringRef("-core")) { - V.erase(V.begin() + 1); - return Core; - } - // Parse -flavor option. if (V.size() > 1 && V[1] == StringRef("-flavor")) { if (V.size() <= 2) @@ -118,8 +110,6 @@ int main(int Argc, const char **Argv) { return !coff::link(Args); case Darwin: return !DarwinLdDriver::linkMachO(Args); - case Core: - return !CoreDriver::link(Args); default: die("-flavor option is missing. Available flavors are " "gnu, darwin or link.");