[lld] r191183 - [lld][LinkingContext][ELF] Allow different output file types.

Shankar Easwaran shankare at codeaurora.org
Sun Sep 22 21:24:15 PDT 2013


Author: shankare
Date: Sun Sep 22 23:24:15 2013
New Revision: 191183

URL: http://llvm.org/viewvc/llvm-project?rev=191183&view=rev
Log:
[lld][LinkingContext][ELF] Allow different output file types.

This adds an option --output-filetype that can be set to either
YAML/Native(case insensitive). The linker would create the outputs
associated with the type specified by the user.

Changes all the tests to use the new option.

Modified:
    lld/trunk/include/lld/Core/LinkingContext.h
    lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
    lld/trunk/lib/Core/LinkingContext.cpp
    lld/trunk/lib/Driver/GnuLdDriver.cpp
    lld/trunk/lib/Driver/GnuLdOptions.td
    lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
    lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
    lld/trunk/lib/ReaderWriter/ELF/Writer.cpp
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
    lld/trunk/test/Driver/libsearch-inputGraph.test
    lld/trunk/test/Driver/trivial-driver.test
    lld/trunk/test/Driver/undef-basic.objtxt
    lld/trunk/test/elf/Hexagon/dynlib-gotoff.test
    lld/trunk/test/elf/Hexagon/hexagon-plt-setup.test
    lld/trunk/test/elf/Hexagon/initfini-option.test
    lld/trunk/test/elf/X86_64/debug.test
    lld/trunk/test/elf/X86_64/dontignorezerosize-sections.test
    lld/trunk/test/elf/X86_64/extern-tls.test
    lld/trunk/test/elf/X86_64/initfini-option.test
    lld/trunk/test/elf/X86_64/initfini.test
    lld/trunk/test/elf/X86_64/largebss.test
    lld/trunk/test/elf/X86_64/multi-weak-layout.test
    lld/trunk/test/elf/X86_64/multi-weak-override.test
    lld/trunk/test/elf/X86_64/multi-weak-syms-order.test
    lld/trunk/test/elf/X86_64/orderatoms-by-override.test
    lld/trunk/test/elf/X86_64/sectionchoice.test
    lld/trunk/test/elf/X86_64/weak-override.test
    lld/trunk/test/elf/X86_64/weak-zero-sized.test
    lld/trunk/test/elf/X86_64/yamlinput.test
    lld/trunk/test/elf/abs.test
    lld/trunk/test/elf/archive-elf-forceload.test
    lld/trunk/test/elf/archive-elf.test
    lld/trunk/test/elf/branch.test
    lld/trunk/test/elf/check.test
    lld/trunk/test/elf/dynamic.test
    lld/trunk/test/elf/gotpcrel.test
    lld/trunk/test/elf/ifunc.test
    lld/trunk/test/elf/mergeconstants.test
    lld/trunk/test/elf/mergeglobalatoms.test
    lld/trunk/test/elf/quickdata.test
    lld/trunk/test/elf/reloc.test
    lld/trunk/test/elf/tls.test
    lld/trunk/test/elf/x86-64-dynamic-relocs.test
    lld/trunk/test/elf/x86-64-dynamic.test
    lld/trunk/test/elf/x86.test
    lld/trunk/test/elf/x86_64-kinds.test
    lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp

Modified: lld/trunk/include/lld/Core/LinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/LinkingContext.h?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/LinkingContext.h (original)
+++ lld/trunk/include/lld/Core/LinkingContext.h Sun Sep 22 23:24:15 2013
@@ -46,6 +46,14 @@ class InputGraph;
 /// to the ELF Reader and Writer.
 class LinkingContext : public Reader {
 public:
+  /// \brief The types of output file that the linker
+  /// creates.
+  enum class OutputFileType : uint8_t {
+    Default, // The default output type for this target
+    YAML,    // The output type is set to YAML
+    Native   // The output file format is Native (Atoms)
+  };
+
   virtual ~LinkingContext();
 
   /// \name Methods needed by core linking
@@ -254,6 +262,22 @@ public:
   /// the linker to write to an in-memory buffer.
   StringRef outputPath() const { return _outputPath; }
 
+  /// Set the various output file types that the linker would
+  /// create
+  bool setOutputFileType(StringRef outputFileType) {
+    StringRef lowerOutputFileType = outputFileType.lower();
+    if (lowerOutputFileType == "yaml")
+      _outputFileType = OutputFileType::YAML;
+    else if (lowerOutputFileType == "native")
+      _outputFileType = OutputFileType::YAML;
+    else
+      return false;
+    return true;
+  }
+
+  /// Returns the output file that that the linker needs to create
+  OutputFileType outputFileType() const { return _outputFileType; }
+
   /// Abstract method to parse a supplied input file buffer into one or
   /// more lld::File objects. Subclasses of LinkingContext must implement this
   /// method.
@@ -325,6 +349,7 @@ protected:
   bool _allowRemainingUndefines;
   bool _logInputFiles;
   bool _allowShlibUndefines;
+  OutputFileType _outputFileType;
   std::vector<StringRef> _deadStripRoots;
   std::vector<const char *> _llvmOptions;
   std::unique_ptr<Reader> _yamlReader;

Modified: lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h Sun Sep 22 23:24:15 2013
@@ -39,6 +39,9 @@ public:
 
 class ELFLinkingContext : public LinkingContext {
 public:
+
+  /// \brief The type of ELF executable that the linker
+  /// creates.
   enum class OutputMagic : uint8_t {
     DEFAULT, // The default mode, no specific magic set
     NMAGIC,  // Disallow shared libraries and dont align sections
@@ -46,14 +49,14 @@ public:
     OMAGIC   // Disallow shared libraries and dont align sections,
              // Mark Text Segment/Data segment RW
   };
+
   llvm::Triple getTriple() const { return _triple; }
   virtual bool is64Bits() const;
   virtual bool isLittleEndian() const;
   virtual uint64_t getPageSize() const { return 0x1000; }
   OutputMagic getOutputMagic() const { return _outputMagic; }
-  uint16_t getOutputType() const { return _outputFileType; }
+  uint16_t getOutputELFType() const { return _outputELFType; }
   uint16_t getOutputMachine() const;
-  bool outputYAML() const { return _outputYAML; }
   bool mergeCommonStrings() const { return _mergeCommonStrings; }
   virtual uint64_t getBaseAddress() const { return _baseAddress; }
 
@@ -130,13 +133,13 @@ public:
   virtual void addPasses(PassManager &pm) const;
 
   void setTriple(llvm::Triple trip) { _triple = trip; }
-  void setOutputFileType(uint32_t type) { _outputFileType = type; }
-  void setOutputYAML(bool v) { _outputYAML = v; }
   void setNoInhibitExec(bool v) { _noInhibitExec = v; }
   void setIsStaticExecutable(bool v) { _isStaticExecutable = v; }
   void setMergeCommonStrings(bool v) { _mergeCommonStrings = v; }
   void setUseShlibUndefines(bool use) { _useShlibUndefines = use; }
 
+  void setOutputELFType(uint32_t type) { _outputELFType = type; }
+
   /// \brief Set the dynamic linker path
   void setInterpreter(StringRef dynamicLinker) {
     _dynamicLinkerArg = true;
@@ -214,12 +217,11 @@ protected:
   /// Method to create a internal file for an undefined symbol
   virtual std::unique_ptr<File> createUndefinedSymbolFile();
 
-  uint16_t _outputFileType; // e.g ET_EXEC
+  uint16_t _outputELFType; // e.g ET_EXEC
   llvm::Triple _triple;
   std::unique_ptr<TargetHandlerBase> _targetHandler;
   uint64_t _baseAddress;
   bool _isStaticExecutable;
-  bool _outputYAML;
   bool _noInhibitExec;
   bool _mergeCommonStrings;
   bool _runLayoutPass;

Modified: lld/trunk/lib/Core/LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/LinkingContext.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/Core/LinkingContext.cpp (original)
+++ lld/trunk/lib/Core/LinkingContext.cpp Sun Sep 22 23:24:15 2013
@@ -24,7 +24,7 @@ LinkingContext::LinkingContext()
       _warnIfCoalesableAtomsHaveDifferentLoadName(false),
       _printRemainingUndefines(true),
       _allowRemainingUndefines(false), _logInputFiles(false),
-      _allowShlibUndefines(false) {}
+      _allowShlibUndefines(false), _outputFileType(OutputFileType::Default) {}
 
 LinkingContext::~LinkingContext() {}
 

Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Sun Sep 22 23:24:15 2013
@@ -154,14 +154,11 @@ bool GnuLdDriver::parse(int argc, const
   bool _outputOptionSet = false;
 
   // Create a dynamic executable by default
-  ctx->setOutputFileType(llvm::ELF::ET_EXEC);
+  ctx->setOutputELFType(llvm::ELF::ET_EXEC);
   ctx->setIsStaticExecutable(false);
   ctx->setAllowShlibUndefines(false);
   ctx->setUseShlibUndefines(true);
 
-  // Set the output file to be a.out
-  ctx->setOutputPath("a.out");
-
   // Process all the arguments and create Input Elements
   for (auto inputArg : *parsedArgs) {
     switch (inputArg->getOption().getID()) {
@@ -169,16 +166,16 @@ bool GnuLdDriver::parse(int argc, const
       ctx->appendLLVMOption(inputArg->getValue());
       break;
     case OPT_relocatable:
-      ctx->setOutputFileType(llvm::ELF::ET_REL);
+      ctx->setOutputELFType(llvm::ELF::ET_REL);
       ctx->setPrintRemainingUndefines(false);
       ctx->setAllowRemainingUndefines(true);
       break;
     case OPT_static:
-      ctx->setOutputFileType(llvm::ELF::ET_EXEC);
+      ctx->setOutputELFType(llvm::ELF::ET_EXEC);
       ctx->setIsStaticExecutable(true);
       break;
     case OPT_shared:
-      ctx->setOutputFileType(llvm::ELF::ET_DYN);
+      ctx->setOutputELFType(llvm::ELF::ET_DYN);
       ctx->setAllowShlibUndefines(true);
       ctx->setUseShlibUndefines(false);
       break;
@@ -246,10 +243,8 @@ bool GnuLdDriver::parse(int argc, const
       ctx->addFiniFunction(inputArg->getValue());
       break;
 
-    case OPT_emit_yaml:
-      if (!_outputOptionSet)
-        ctx->setOutputPath("-");
-      ctx->setOutputYAML(true);
+    case OPT_output_filetype:
+      ctx->setOutputFileType(inputArg->getValue());
       break;
 
     case OPT_no_whole_archive:
@@ -333,7 +328,23 @@ bool GnuLdDriver::parse(int argc, const
 
   inputGraph->addInternalFile(ctx->createInternalFiles());
 
-  if (ctx->outputYAML())
+  // Set default output file name if the output file was not
+  // specified.
+  if (!_outputOptionSet) {
+    switch (ctx->outputFileType()) {
+    case LinkingContext::OutputFileType::YAML:
+      ctx->setOutputPath("-");
+      break;
+    case LinkingContext::OutputFileType::Native:
+      ctx->setOutputPath("a.native");
+      break;
+    default:
+      ctx->setOutputPath("a.out");
+      break;
+    }
+  }
+
+  if (ctx->outputFileType() == LinkingContext::OutputFileType::YAML)
     inputGraph->dump(diagnostics);
 
   // Validate the combination of options used.

Modified: lld/trunk/lib/Driver/GnuLdOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdOptions.td?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdOptions.td (original)
+++ lld/trunk/lib/Driver/GnuLdOptions.td Sun Sep 22 23:24:15 2013
@@ -25,7 +25,6 @@ multiclass dashEq<string opt1, string op
       Alias<!cast<Option>(opt1)>;
 }
 
-
 //===----------------------------------------------------------------------===//
 /// Output Kinds
 //===----------------------------------------------------------------------===//
@@ -223,9 +222,11 @@ def t : Flag<["-"], "t">,
 //===----------------------------------------------------------------------===//
 def grp_extns : OptionGroup<"opts">,
      HelpText<"Extensions">;
-def emit_yaml : Flag<["-"], "emit-yaml">,
-     HelpText<"Write YAML instead of ELF">,
-     Group<grp_extns>;
+def output_filetype: Separate<["--"], "output-filetype">,
+      HelpText<"Specify what type of output file that lld creates, YAML/Native">,
+      Group<grp_extns>;
+def alias_output_filetype: Joined<["--"], "output-filetype=">,
+      Alias<output_filetype>;
 
 //===----------------------------------------------------------------------===//
 /// Help

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp Sun Sep 22 23:24:15 2013
@@ -36,9 +36,9 @@ public:
 
 ELFLinkingContext::ELFLinkingContext(
     llvm::Triple triple, std::unique_ptr<TargetHandlerBase> targetHandler)
-    : _outputFileType(elf::ET_EXEC), _triple(triple),
+    : _outputELFType(elf::ET_EXEC), _triple(triple),
       _targetHandler(std::move(targetHandler)), _baseAddress(0),
-      _isStaticExecutable(false), _outputYAML(false), _noInhibitExec(false),
+      _isStaticExecutable(false), _noInhibitExec(false),
       _mergeCommonStrings(false), _runLayoutPass(true),
       _useShlibUndefines(false), _dynamicLinkerArg(false),
       _noAllowDynamicLibraries(false), _outputMagic(OutputMagic::DEFAULT),
@@ -72,7 +72,7 @@ uint16_t ELFLinkingContext::getOutputMac
 }
 
 StringRef ELFLinkingContext::entrySymbolName() const {
-  if (_outputFileType == elf::ET_EXEC && _entrySymbolName.empty())
+  if (_outputELFType == elf::ET_EXEC && _entrySymbolName.empty())
     return "_start";
   return _entrySymbolName;
 }
@@ -80,12 +80,22 @@ StringRef ELFLinkingContext::entrySymbol
 bool ELFLinkingContext::validateImpl(raw_ostream &diagnostics) {
   _elfReader = createReaderELF(*this);
   _linkerScriptReader.reset(new ReaderLinkerScript(*this));
-  _writer = _outputYAML ? createWriterYAML(*this) : createWriterELF(*this);
+  switch (outputFileType()) {
+  case LinkingContext::OutputFileType::YAML:
+    _writer = createWriterYAML(*this);
+    break;
+  case LinkingContext::OutputFileType::Native:
+    llvm_unreachable("Unimplemented");
+    break;
+  default:
+    _writer = createWriterELF(*this);
+    break;
+  }
   return false;
 }
 
 bool ELFLinkingContext::isDynamic() const {
-  switch (_outputFileType) {
+  switch (_outputELFType) {
   case llvm::ELF::ET_EXEC:
     return !_isStaticExecutable;
   case llvm::ELF::ET_DYN:

Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Sun Sep 22 23:24:15 2013
@@ -170,7 +170,7 @@ void OutputELFWriter<ELFT>::buildDynamic
     _dynamicTable->addEntry(dyn);
   }
   StringRef soname = _context.sharedObjectName();
-  if (!soname.empty() && _context.getOutputType() == llvm::ELF::ET_DYN) {
+  if (!soname.empty() && _context.getOutputELFType() == llvm::ELF::ET_DYN) {
     Elf_Dyn dyn;
     dyn.d_tag = DT_SONAME;
     dyn.d_un.d_val = _dynamicStringTable->addString(soname);
@@ -368,7 +368,7 @@ error_code OutputELFWriter<ELFT>::writeF
   _elfHeader->e_ident(ELF::EI_DATA, _context.isLittleEndian()
                                         ? ELF::ELFDATA2LSB
                                         : ELF::ELFDATA2MSB);
-  _elfHeader->e_type(_context.getOutputType());
+  _elfHeader->e_type(_context.getOutputELFType());
   _elfHeader->e_machine(_context.getOutputMachine());
 
   if (!_targetHandler.doesOverrideELFHeader()) {

Modified: lld/trunk/lib/ReaderWriter/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Writer.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Writer.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Writer.cpp Sun Sep 22 23:24:15 2013
@@ -23,7 +23,7 @@ std::unique_ptr<Writer> createWriterELF(
   // We would set the layout to a dynamic executable layout
   // if we came across any shared libraries in the process
 
-  switch(info.getOutputType()) {
+  switch (info.getOutputELFType()) {
   case llvm::ELF::ET_EXEC:
     if (info.is64Bits()) {
       if (info.isLittleEndian())

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Sun Sep 22 23:24:15 2013
@@ -461,7 +461,7 @@ private:
 
 
 void elf::X86_64LinkingContext::addPasses(PassManager &pm) const {
-  switch (_outputFileType) {
+  switch (_outputELFType) {
   case llvm::ELF::ET_EXEC:
     if (_isStaticExecutable)
       pm.add(std::unique_ptr<Pass>(new StaticGOTPLTPass(*this)));

Modified: lld/trunk/test/Driver/libsearch-inputGraph.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Driver/libsearch-inputGraph.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/Driver/libsearch-inputGraph.test (original)
+++ lld/trunk/test/Driver/libsearch-inputGraph.test Sun Sep 22 23:24:15 2013
@@ -1,10 +1,10 @@
-RUN: lld -flavor gnu -L%p/../elf/Inputs -lfnarchive -emit-yaml --noinhibit-exec 2> %t.err
+RUN: lld -flavor gnu -L%p/../elf/Inputs -lfnarchive --output-filetype=yaml --noinhibit-exec 2> %t.err
 RUN: FileCheck %s < %t.err
-RUN: lld -flavor gnu -L%p/../elf/Inputs --whole-archive -lfnarchive -emit-yaml --noinhibit-exec 2> %t1.err
+RUN: lld -flavor gnu -L%p/../elf/Inputs --whole-archive -lfnarchive --output-filetype=yaml --noinhibit-exec 2> %t1.err
 RUN: FileCheck %s -check-prefix="WHOLEARCHIVE" < %t1.err
-RUN: lld -flavor gnu -L%p/../elf/Inputs --whole-archive --as-needed -lfnarchive -emit-yaml --noinhibit-exec 2> %t2.err
+RUN: lld -flavor gnu -L%p/../elf/Inputs --whole-archive --as-needed -lfnarchive --output-filetype=yaml --noinhibit-exec 2> %t2.err
 RUN: FileCheck %s -check-prefix="ASNEEDED" < %t2.err
-RUN: lld -flavor gnu --sysroot=%p/../elf -L=/Inputs -lfnarchive -emit-yaml --noinhibit-exec 2> %t3.err
+RUN: lld -flavor gnu --sysroot=%p/../elf -L=/Inputs -lfnarchive --output-filetype=yaml --noinhibit-exec 2> %t3.err
 RUN: FileCheck -check-prefix="SYSROOT" %s < %t3.err
 
 CHECK: Name    : {{[^ ]+}}elf/Inputs{{[\\/]}}libfnarchive.a

Modified: lld/trunk/test/Driver/trivial-driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Driver/trivial-driver.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/Driver/trivial-driver.test (original)
+++ lld/trunk/test/Driver/trivial-driver.test Sun Sep 22 23:24:15 2013
@@ -2,4 +2,4 @@
 RUN: lld -flavor gnu --help | FileCheck %s
 
 CHECK: --noinhibit-exec
-CHECK: -emit-yaml
+CHECK: --output-filetype

Modified: lld/trunk/test/Driver/undef-basic.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Driver/undef-basic.objtxt?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/Driver/undef-basic.objtxt (original)
+++ lld/trunk/test/Driver/undef-basic.objtxt Sun Sep 22 23:24:15 2013
@@ -1,5 +1,5 @@
-# RUN: lld -flavor gnu -u undefinedsymbol -e entrysymbol %s -emit-yaml \
-# RUN: --noinhibit-exec | FileCheck %s
+# RUN: lld -flavor gnu -u undefinedsymbol -e entrysymbol %s \
+# RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s
 
 #
 # Test that we are able to add undefined atoms from the command line

Modified: lld/trunk/test/elf/Hexagon/dynlib-gotoff.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/dynlib-gotoff.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/Hexagon/dynlib-gotoff.test (original)
+++ lld/trunk/test/elf/Hexagon/dynlib-gotoff.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # This tests GOT's and PLT's for dynamic libraries for Hexagon
 RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj.o \
-RUN:   -o %t -emit-yaml -shared --noinhibit-exec
+RUN:   -o %t --output-filetype=yaml -shared --noinhibit-exec
 RUN: FileCheck -check-prefix=CHECKGOTPLT %s < %t
 
               - name:            __got0

Modified: lld/trunk/test/elf/Hexagon/hexagon-plt-setup.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/hexagon-plt-setup.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/Hexagon/hexagon-plt-setup.test (original)
+++ lld/trunk/test/elf/Hexagon/hexagon-plt-setup.test Sun Sep 22 23:24:15 2013
@@ -1,5 +1,5 @@
 RUN: lld -flavor gnu -target hexagon %p/Inputs/use-shared.hexagon \
-RUN: -emit-yaml --noinhibit-exec -o %t2 
+RUN: --output-filetype=yaml --noinhibit-exec -o %t2 
 RUN: FileCheck %s < %t2
 
 CHECK:  - name:            fn3

Modified: lld/trunk/test/elf/Hexagon/initfini-option.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/initfini-option.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/Hexagon/initfini-option.test (original)
+++ lld/trunk/test/elf/Hexagon/initfini-option.test Sun Sep 22 23:24:15 2013
@@ -4,7 +4,7 @@
 # in the output ELF. 
 
 RUN: lld -flavor gnu -target hexagon %p/Inputs/initfini-option.o  \
-RUN: -init init -fini fini --noinhibit-exec -emit-yaml -static -o %t
+RUN: -init init -fini fini --noinhibit-exec --output-filetype=yaml -static -o %t
 RUN: FileCheck %s < %t
 
 CHECK:    content:         [ 00, 00, 00, 00 ]

Modified: lld/trunk/test/elf/X86_64/debug.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/debug.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/debug.test (original)
+++ lld/trunk/test/elf/X86_64/debug.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # Test that debug info is assigned typeNoAlloc and that the output sections have
 # a virtual address of 0.
-RUN: lld -flavor gnu -target x86_64 -e main -emit-yaml \
+RUN: lld -flavor gnu -target x86_64 -e main --output-filetype=yaml \
 RUN:   %p/Inputs/debug0.x86-64 %p/Inputs/debug1.x86-64 -o %t
 RUN: FileCheck %s -check-prefix YAML < %t
 

Modified: lld/trunk/test/elf/X86_64/dontignorezerosize-sections.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/dontignorezerosize-sections.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/dontignorezerosize-sections.test (original)
+++ lld/trunk/test/elf/X86_64/dontignorezerosize-sections.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # This tests that lld is not ignoring zero sized sections
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/zerosizedsection.o  \
-RUN: --noinhibit-exec -emit-yaml -o %t
+RUN: --noinhibit-exec --output-filetype=yaml -o %t
 RUN: FileCheck %s < %t
 
 CHECK:    section-name:    .data

Modified: lld/trunk/test/elf/X86_64/extern-tls.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/extern-tls.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/extern-tls.test (original)
+++ lld/trunk/test/elf/X86_64/extern-tls.test Sun Sep 22 23:24:15 2013
@@ -1,7 +1,7 @@
 # This tests verifies that TLS variables have correct offsets
 # when variables the TLS variables are not defined in the program
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/externtls.x86-64 -static  \
-RUN: -emit-yaml --noinhibit-exec | FileCheck %s -check-prefix=CHECKGOT
+RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s -check-prefix=CHECKGOT
 
            - name:            __got_tls_extern_tls
 CHECKGOT:    type:            got

Modified: lld/trunk/test/elf/X86_64/initfini-option.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/initfini-option.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/initfini-option.test (original)
+++ lld/trunk/test/elf/X86_64/initfini-option.test Sun Sep 22 23:24:15 2013
@@ -4,7 +4,7 @@
 # in the output ELF. 
 
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/initfini-option.o  \
-RUN: -init init -fini fini --noinhibit-exec -emit-yaml -o %t
+RUN: -init init -fini fini --noinhibit-exec --output-filetype=yaml -o %t
 RUN: FileCheck %s < %t
 
 CHECK:    content:         [ 00, 00, 00, 00, 00, 00, 00, 00 ]

Modified: lld/trunk/test/elf/X86_64/initfini.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/initfini.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/initfini.test (original)
+++ lld/trunk/test/elf/X86_64/initfini.test Sun Sep 22 23:24:15 2013
@@ -4,7 +4,7 @@
 # in the output ELF. 
 
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/initfini.o  \
-RUN: --noinhibit-exec -emit-yaml -o %t
+RUN: --noinhibit-exec --output-filetype=yaml -o %t
 RUN: FileCheck %s < %t
 
 CHECK:  - type:            data

Modified: lld/trunk/test/elf/X86_64/largebss.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/largebss.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/largebss.test (original)
+++ lld/trunk/test/elf/X86_64/largebss.test Sun Sep 22 23:24:15 2013
@@ -3,7 +3,7 @@
 # Any typeZeroFill content wouldnot have space reserved in the file to store
 # its content
 
-RUN: lld -flavor gnu -target x86_64 %p/Inputs/largebss.o -emit-yaml --noinhibit-exec | FileCheck %s
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/largebss.o --output-filetype=yaml --noinhibit-exec | FileCheck %s
 
 
 CHECK:  - name:            largecommon

Modified: lld/trunk/test/elf/X86_64/multi-weak-layout.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/multi-weak-layout.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/multi-weak-layout.test (original)
+++ lld/trunk/test/elf/X86_64/multi-weak-layout.test Sun Sep 22 23:24:15 2013
@@ -2,7 +2,7 @@
 # properly
 
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/multiweaksyms.o  \
-RUN: --noinhibit-exec -static -emit-yaml -o %t
+RUN: --noinhibit-exec -static --output-filetype=yaml -o %t
 RUN: FileCheck %s -check-prefix=WEAKSYMS < %t
 
 WEAKSYMS:  - ref-name:        [[SYMA:[-a-zA-Z0-9_]+]]

Modified: lld/trunk/test/elf/X86_64/multi-weak-override.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/multi-weak-override.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/multi-weak-override.test (original)
+++ lld/trunk/test/elf/X86_64/multi-weak-override.test Sun Sep 22 23:24:15 2013
@@ -3,7 +3,7 @@ RUN: lld -flavor gnu -target x86_64 %p/I
 RUN:     %p/Inputs/multi-ovrd.o -o %t -e main --noinhibit-exec
 RUN: llvm-nm -n %t | FileCheck -check-prefix=WEAKORDER %s
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o \
-RUN:    %p/Inputs/multi-ovrd.o -emit-yaml -o %t2 --noinhibit-exec
+RUN:    %p/Inputs/multi-ovrd.o --output-filetype=yaml -o %t2 --noinhibit-exec
 RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2
 
 WEAKORDER: {{[0-9a-f]+}} T f

Modified: lld/trunk/test/elf/X86_64/multi-weak-syms-order.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/multi-weak-syms-order.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/multi-weak-syms-order.test (original)
+++ lld/trunk/test/elf/X86_64/multi-weak-syms-order.test Sun Sep 22 23:24:15 2013
@@ -1,7 +1,7 @@
 # Test for weak symbol getting overridden
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o -o %t --noinhibit-exec
 RUN: llvm-nm -n %t | FileCheck -check-prefix=WEAKORDER %s
-RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o -o %t2 -emit-yaml --noinhibit-exec
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o -o %t2 --output-filetype=yaml --noinhibit-exec
 RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2
 
 WEAKORDER: {{[0-9a-f]+}} T fn

Modified: lld/trunk/test/elf/X86_64/orderatoms-by-override.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/orderatoms-by-override.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/orderatoms-by-override.test (original)
+++ lld/trunk/test/elf/X86_64/orderatoms-by-override.test Sun Sep 22 23:24:15 2013
@@ -1,7 +1,7 @@
 # This testcase tests the behaviour of the layoutpass so that the atoms that
 # appear by their override take preference before proceeding to default behaviour
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/rwint.o \
-RUN:     %p/Inputs/constint.o -emit-yaml -o %t --noinhibit-exec
+RUN:     %p/Inputs/constint.o --output-filetype=yaml -o %t --noinhibit-exec
 RUN: FileCheck %s -check-prefix=CHECKORDER < %t
 
 CHECKORDER:  - name:            b

Modified: lld/trunk/test/elf/X86_64/sectionchoice.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/sectionchoice.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/sectionchoice.test (original)
+++ lld/trunk/test/elf/X86_64/sectionchoice.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # This tests that we are able to properly set the sectionChoice for DefinedAtoms
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/zerosizedsection.o  \
-RUN: --noinhibit-exec -o %t -emit-yaml
+RUN: --noinhibit-exec -o %t --output-filetype=yaml
 RUN: FileCheck %s < %t
 
 CHECK-NOT: section-choice: sectionCustomRequired

Modified: lld/trunk/test/elf/X86_64/weak-override.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/weak-override.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/weak-override.test (original)
+++ lld/trunk/test/elf/X86_64/weak-override.test Sun Sep 22 23:24:15 2013
@@ -3,7 +3,7 @@ RUN: lld -flavor gnu -target x86_64 %p/I
 RUN:    -o %t --noinhibit-exec
 RUN: llvm-nm %t | FileCheck -check-prefix=WEAKORDER %s
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak.o \
-RUN:   %p/Inputs/ovrd.o -o %t2 -emit-yaml --noinhibit-exec
+RUN:   %p/Inputs/ovrd.o -o %t2 --output-filetype=yaml --noinhibit-exec
 RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2
 
 WEAKORDER: {{[0-9a-c]+}} T f

Modified: lld/trunk/test/elf/X86_64/weak-zero-sized.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/weak-zero-sized.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/weak-zero-sized.test (original)
+++ lld/trunk/test/elf/X86_64/weak-zero-sized.test Sun Sep 22 23:24:15 2013
@@ -3,7 +3,7 @@ RUN: lld -flavor gnu -target x86_64 %p/I
 RUN:   --noinhibit-exec
 RUN: llvm-nm %t | FileCheck -check-prefix=WEAKORDER %s
 RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak-zero-sized.o \
-RUN:    -emit-yaml -o %t2 --noinhibit-exec
+RUN:    --output-filetype=yaml -o %t2 --noinhibit-exec
 RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2
 
 WEAKORDER: 004001a4 T _start

Modified: lld/trunk/test/elf/X86_64/yamlinput.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/yamlinput.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/yamlinput.test (original)
+++ lld/trunk/test/elf/X86_64/yamlinput.test Sun Sep 22 23:24:15 2013
@@ -2,7 +2,7 @@
 # an input YAML from a previous link
 
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/initfini.o \
-RUN: --noinhibit-exec -emit-yaml -o %t.objtxt
+RUN: --noinhibit-exec --output-filetype=yaml -o %t.objtxt
 RUN: lld -flavor gnu -target x86_64-linux %t.objtxt \
 RUN: --noinhibit-exec -o %t1
 RUN: llvm-readobj -sections %t1 | FileCheck %s -check-prefix=SECTIONS

Modified: lld/trunk/test/elf/abs.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/abs.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/abs.test (original)
+++ lld/trunk/test/elf/abs.test Sun Sep 22 23:24:15 2013
@@ -9,7 +9,7 @@
 
 # built using: "gcc -m32"
 #
-RUN: lld -flavor gnu -emit-yaml -r %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s
+RUN: lld -flavor gnu --output-filetype=yaml -r %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s
 
 YAML:  absolute-atoms: 
 YAML:    - name:              absLocalSymbol

Modified: lld/trunk/test/elf/archive-elf-forceload.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/archive-elf-forceload.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/archive-elf-forceload.test (original)
+++ lld/trunk/test/elf/archive-elf-forceload.test Sun Sep 22 23:24:15 2013
@@ -24,7 +24,7 @@
 # gcc -c main.c fn.c fn1.c
 
 RUN: lld -flavor gnu -target x86_64-linux -e main %p/Inputs/mainobj.x86_64 \
-RUN:  --whole-archive %p/Inputs/libfnarchive.a --no-whole-archive -emit-yaml \
+RUN:  --whole-archive %p/Inputs/libfnarchive.a --no-whole-archive --output-filetype=yaml \
 RUN:  | FileCheck -check-prefix FORCELOAD %s
 
 FORCELOAD:  defined-atoms:   

Modified: lld/trunk/test/elf/archive-elf.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/archive-elf.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/archive-elf.test (original)
+++ lld/trunk/test/elf/archive-elf.test Sun Sep 22 23:24:15 2013
@@ -23,7 +23,7 @@
 # }
 # gcc -c main.c fn.c fn1.c
 
-RUN: lld -flavor gnu -emit-yaml -r %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a | FileCheck -check-prefix NOFORCELOAD %s
+RUN: lld -flavor gnu --output-filetype=yaml -r %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a | FileCheck -check-prefix NOFORCELOAD %s
 
 NOFORCELOAD:  defined-atoms:
 NOFORCELOAD:    - name:              fn

Modified: lld/trunk/test/elf/branch.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/branch.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/branch.test (original)
+++ lld/trunk/test/elf/branch.test Sun Sep 22 23:24:15 2013
@@ -1,4 +1,4 @@
-RUN: lld -flavor gnu -target hexagon -static -emit-yaml \
+RUN: lld -flavor gnu -target hexagon -static --output-filetype=yaml \
 RUN: %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon --noinhibit-exec | FileCheck %s -check-prefix hexagon-yaml
 RUN: lld -flavor gnu -target hexagon -e target -o %t1 \
 RUN: %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon --noinhibit-exec

Modified: lld/trunk/test/elf/check.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/check.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/check.test (original)
+++ lld/trunk/test/elf/check.test Sun Sep 22 23:24:15 2013
@@ -1,9 +1,9 @@
 # This tests the basic functionality of ordering data and functions as they 
 # appear in the inputs
-RUN: lld -flavor gnu -target i386 -e global_func --noinhibit-exec -emit-yaml \
+RUN: lld -flavor gnu -target i386 -e global_func --noinhibit-exec --output-filetype=yaml \
 RUN:    %p/Inputs/object-test.elf-i386  -o %t 
 RUN: FileCheck %s -check-prefix ELF-i386 < %t
-RUN: lld -flavor gnu -target hexagon -e global_func --noinhibit-exec -emit-yaml \
+RUN: lld -flavor gnu -target hexagon -e global_func --noinhibit-exec --output-filetype=yaml \
 RUN:    %p/Inputs/object-test.elf-hexagon -o %t1 
 RUN: FileCheck %s -check-prefix ELF-hexagon < %t1
 

Modified: lld/trunk/test/elf/dynamic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/dynamic.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/dynamic.test (original)
+++ lld/trunk/test/elf/dynamic.test Sun Sep 22 23:24:15 2013
@@ -3,7 +3,7 @@ RUN: lld -flavor gnu -target x86_64-linu
 RUN:   %p/Inputs/shared.so-x86-64 -o %t -e main --allow-shlib-undefined \
 RUN:   -rpath /l1:/l2 -rpath /l3
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/use-shared.x86-64 \
-RUN:   %p/Inputs/shared.so-x86-64 -emit-yaml -o %t2 --allow-shlib-undefined \
+RUN:   %p/Inputs/shared.so-x86-64 --output-filetype=yaml -o %t2 --allow-shlib-undefined \
 RUN: --noinhibit-exec
 RUN: llvm-objdump -p %t >> %t2
 RUN: llvm-readobj -s -dyn-symbols -dynamic-table %t >> %t2

Modified: lld/trunk/test/elf/gotpcrel.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/gotpcrel.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/gotpcrel.test (original)
+++ lld/trunk/test/elf/gotpcrel.test Sun Sep 22 23:24:15 2013
@@ -1,5 +1,5 @@
 # This test checks that GOTPCREL entries are being handled properly
-RUN: lld -flavor gnu -target x86_64-linux -static -e main -emit-yaml  \
+RUN: lld -flavor gnu -target x86_64-linux -static -e main --output-filetype=yaml  \
 RUN:   --noinhibit-exec %p/Inputs/gotpcrel.x86-64  \
 RUN:   | FileCheck %s -check-prefix=YAML
 

Modified: lld/trunk/test/elf/ifunc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/ifunc.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/ifunc.test (original)
+++ lld/trunk/test/elf/ifunc.test Sun Sep 22 23:24:15 2013
@@ -1,9 +1,9 @@
 # This test checks that IRELATIVE relocations are created for symbols that 
 # need relocation even for static links. 
-RUN: lld -flavor gnu -target x86_64-linux -emit-yaml -r \
+RUN: lld -flavor gnu -target x86_64-linux --output-filetype=yaml -r \
 RUN:   %p/Inputs/ifunc.x86-64  | FileCheck %s
 
-RUN: lld -flavor gnu -target x86_64-linux -emit-yaml --noinhibit-exec \
+RUN: lld -flavor gnu -target x86_64-linux --output-filetype=yaml --noinhibit-exec \
 RUN:   %p/Inputs/ifunc.x86-64 %p/Inputs/ifunc.cpp.x86-64 \
 RUN: | FileCheck %s --check-prefix=PLT
 

Modified: lld/trunk/test/elf/mergeconstants.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/mergeconstants.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/mergeconstants.test (original)
+++ lld/trunk/test/elf/mergeconstants.test Sun Sep 22 23:24:15 2013
@@ -1,5 +1,5 @@
 # The test checks for mergeable strings that appear in the object file
-RUN: lld -flavor gnu --merge-strings -emit-yaml %p/Inputs/constants-merge.x86-64 --noinhibit-exec | FileCheck -check-prefix=mergeAtoms %s
+RUN: lld -flavor gnu --merge-strings --output-filetype=yaml %p/Inputs/constants-merge.x86-64 --noinhibit-exec | FileCheck -check-prefix=mergeAtoms %s
 
 mergeAtoms:  - ref-name:        [[CONSTANT:[-a-zA-Z0-9_]+]]
 mergeAtoms:    type:            constant

Modified: lld/trunk/test/elf/mergeglobalatoms.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/mergeglobalatoms.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/mergeglobalatoms.test (original)
+++ lld/trunk/test/elf/mergeglobalatoms.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # ELF files can have mergeable strings which are global!, treat them as global
 # defined atoms
-RUN: lld -flavor gnu -emit-yaml %p/Inputs/globalconst.o.x86-64 \
+RUN: lld -flavor gnu --output-filetype=yaml %p/Inputs/globalconst.o.x86-64 \
 RUN: --noinhibit-exec | FileCheck -check-prefix=globalatoms %s
 
 globalatoms:  - name:            mystr

Modified: lld/trunk/test/elf/quickdata.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/quickdata.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/quickdata.test (original)
+++ lld/trunk/test/elf/quickdata.test Sun Sep 22 23:24:15 2013
@@ -1,4 +1,4 @@
-RUN: lld -flavor gnu -target hexagon -emit-yaml %p/Inputs/quickdata-test.elf-hexagon \
+RUN: lld -flavor gnu -target hexagon --output-filetype=yaml %p/Inputs/quickdata-test.elf-hexagon \
 RUN: --noinhibit-exec | FileCheck %s -check-prefix hexagon
 
 hexagon:  - name:            init

Modified: lld/trunk/test/elf/reloc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/reloc.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/reloc.test (original)
+++ lld/trunk/test/elf/reloc.test Sun Sep 22 23:24:15 2013
@@ -1,4 +1,4 @@
-RUN: lld -flavor gnu --merge-strings -r -emit-yaml %p/Inputs/reloc-test.elf-i386 | FileCheck %s -check-prefix ELF-i386
+RUN: lld -flavor gnu --merge-strings -r --output-filetype=yaml %p/Inputs/reloc-test.elf-i386 | FileCheck %s -check-prefix ELF-i386
 
 ELF-i386: defined-atoms:   
 ELF-i386:   - ref-name:        [[STRNAMEA:[-a-zA-Z0-9_]+]]

Modified: lld/trunk/test/elf/tls.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/tls.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/tls.test (original)
+++ lld/trunk/test/elf/tls.test Sun Sep 22 23:24:15 2013
@@ -1,6 +1,6 @@
 # This tests verifies that TLS variables have correct offsets
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -static  \
-RUN: -emit-yaml --noinhibit-exec | FileCheck %s -check-prefix=YAML
+RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s -check-prefix=YAML
 
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -o %t \
 RUN:   --noinhibit-exec -e main -static && llvm-objdump -d %t | FileCheck %s

Modified: lld/trunk/test/elf/x86-64-dynamic-relocs.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/x86-64-dynamic-relocs.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/x86-64-dynamic-relocs.test (original)
+++ lld/trunk/test/elf/x86-64-dynamic-relocs.test Sun Sep 22 23:24:15 2013
@@ -1,5 +1,5 @@
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/relocs-dynamic.x86-64 \
-RUN:  -emit-yaml --noinhibit-exec | FileCheck %s
+RUN:  --output-filetype=yaml --noinhibit-exec | FileCheck %s
 
 path:            <linker-internal>
 defined-atoms:

Modified: lld/trunk/test/elf/x86-64-dynamic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/x86-64-dynamic.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/x86-64-dynamic.test (original)
+++ lld/trunk/test/elf/x86-64-dynamic.test Sun Sep 22 23:24:15 2013
@@ -1,7 +1,7 @@
 # Checks that linking an object file with a shared object creates the necessary
 # PLT/GOT Entries
 RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/use-shared.x86-64 \
-RUN:   %p/Inputs/shared.so-x86-64 -emit-yaml -o %t1 --noinhibit-exec
+RUN:   %p/Inputs/shared.so-x86-64 --output-filetype=yaml -o %t1 --noinhibit-exec
 RUN: FileCheck %s < %t1
 
 // Don't check the GOT and PLT names as they are only present in assert builds.

Modified: lld/trunk/test/elf/x86.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/x86.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/x86.test (original)
+++ lld/trunk/test/elf/x86.test Sun Sep 22 23:24:15 2013
@@ -18,7 +18,7 @@
 #
 # Assembled with: "as --32"
 
-RUN: lld -flavor gnu -target i386 -e back -emit-yaml %p/Inputs/reloc-xb.x86 %p/Inputs/reloc-xt.x86 | FileCheck %s     -check-prefix x86-yaml
+RUN: lld -flavor gnu -target i386 -e back --output-filetype=yaml %p/Inputs/reloc-xb.x86 %p/Inputs/reloc-xt.x86 | FileCheck %s     -check-prefix x86-yaml
 
 x86-yaml:    - name:              back
 x86-yaml:      scope:             global

Modified: lld/trunk/test/elf/x86_64-kinds.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/x86_64-kinds.test?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/test/elf/x86_64-kinds.test (original)
+++ lld/trunk/test/elf/x86_64-kinds.test Sun Sep 22 23:24:15 2013
@@ -2,7 +2,7 @@ RUN: lld -flavor gnu -target x86_64-linu
 RUN:   -e _start -static
 RUN: llvm-objdump -d %t1 | FileCheck %s -check-prefix=RELOCS
 
-RUN: lld -flavor gnu -target x86_64-linux -emit-yaml -e _start -static \
+RUN: lld -flavor gnu -target x86_64-linux --output-filetype=yaml -e _start -static \
 RUN:    %p/Inputs/relocs.x86-64 | FileCheck %s -check-prefix=X86_64
 
 RELOCS: ELF64-x86-64

Modified: lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp?rev=191183&r1=191182&r2=191183&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp Sun Sep 22 23:24:15 2013
@@ -39,16 +39,18 @@ TEST_F(GnuLdParserTest, Basic) {
   EXPECT_EQ("a.out", linkingContext()->outputPath());
   EXPECT_EQ(1, inputFileCount());
   EXPECT_EQ("infile.o", inputFile(0));
-  EXPECT_FALSE(_context->outputYAML());
+  EXPECT_FALSE(_context->outputFileType() ==
+               LinkingContext::OutputFileType::YAML);
 }
 
 TEST_F(GnuLdParserTest, ManyOptions) {
   EXPECT_FALSE(parse("ld", "-entry", "_start", "-o", "outfile",
-        "-emit-yaml", "infile.o", nullptr));
+                     "--output-filetype=yaml", "infile.o", nullptr));
   EXPECT_NE(linkingContext(), nullptr);
   EXPECT_EQ("outfile", linkingContext()->outputPath());
   EXPECT_EQ("_start", linkingContext()->entrySymbolName());
-  EXPECT_TRUE(_context->outputYAML());
+  EXPECT_TRUE(_context->outputFileType() ==
+              LinkingContext::OutputFileType::YAML);
 }
 
 }  // end anonymous namespace





More information about the llvm-commits mailing list