diff options
| author | Sean Silva <chisophugis@gmail.com> | 2016-03-10 04:58:52 +0000 |
|---|---|---|
| committer | Sean Silva <chisophugis@gmail.com> | 2016-03-10 04:58:52 +0000 |
| commit | 03e41ee6a78064ae55ac87b66b1ac763c1c9456c (patch) | |
| tree | 7349510fe41cd8505af5b4bc5e626cd68025cb40 | |
| parent | e5dc94ee31a03236ea55809d0b71a3a8f2848bc2 (diff) | |
| download | bcm5719-llvm-03e41ee6a78064ae55ac87b66b1ac763c1c9456c.tar.gz bcm5719-llvm-03e41ee6a78064ae55ac87b66b1ac763c1c9456c.zip | |
[lto] Initialize asmparsers.
Summary:
They are needed for inline asm during LTO.
In particular we hit the report_fatal_error on
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:138
LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target
Reviewers: ruiu, rafael
Subscribers: Bigcheese, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18027
llvm-svn: 263094
| -rw-r--r-- | lld/ELF/Driver.cpp | 1 | ||||
| -rw-r--r-- | lld/test/ELF/lto/inline-asm.ll | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 7b1ee794601..806846e77cd 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -321,6 +321,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { InitializeAllTargets(); InitializeAllTargetMCs(); InitializeAllAsmPrinters(); + InitializeAllAsmParsers(); SymbolTable<ELFT> Symtab; std::unique_ptr<TargetInfo> TI(createTarget()); diff --git a/lld/test/ELF/lto/inline-asm.ll b/lld/test/ELF/lto/inline-asm.ll new file mode 100644 index 00000000000..b6af6a5a5cb --- /dev/null +++ b/lld/test/ELF/lto/inline-asm.ll @@ -0,0 +1,11 @@ +; REQUIRES: x86 +; RUN: llvm-as %s -o %t.o +; RUN: ld.lld -m elf_x86_64 %t.o -o %t.so -shared + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @foo() { + call void asm "nop", ""() + ret void +} |

