diff options
author | Rui Ueyama <ruiu@google.com> | 2018-12-14 21:58:49 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-12-14 21:58:49 +0000 |
commit | 36c0f28ca05e9f8f7c76f5812548eef14acc78a7 (patch) | |
tree | d5083a1d78a22506cd77d6e5bf6d1ca36474f999 /lld/test | |
parent | d9d4702b5936a5865be351c122344ab0ebfb3487 (diff) |
Add --plugin-opt=emit-llvm option.
`--plugin-opt=emit-llvm` is an option for LTO. It makes the linker to
combine all bitcode files and write the result to an output file without
doing codegen. Gold LTO plugin has this option.
This option is being used for some post-link code analysis tools that
have to see a whole program but don't need to see them in the native
machine code.
Differential Revision: https://reviews.llvm.org/D55717
Diffstat (limited to 'lld/test')
-rw-r--r-- | lld/test/ELF/lto/emit-llvm.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lld/test/ELF/lto/emit-llvm.ll b/lld/test/ELF/lto/emit-llvm.ll new file mode 100644 index 00000000000..bf38c982f02 --- /dev/null +++ b/lld/test/ELF/lto/emit-llvm.ll @@ -0,0 +1,14 @@ +; REQUIRES: x86 + +; RUN: opt -module-hash -module-summary %s -o %t.o +; RUN: ld.lld --plugin-opt=emit-llvm -o %t.out.o %t.o +; RUN: llvm-dis < %t.out.o -o - | FileCheck %s + +; CHECK: define internal void @main() + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @main() { + ret void +} |