From 36c0f28ca05e9f8f7c76f5812548eef14acc78a7 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 14 Dec 2018 21:58:49 +0000 Subject: 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 --- lld/test/ELF/lto/emit-llvm.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lld/test/ELF/lto/emit-llvm.ll (limited to 'lld/test') 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 +} -- cgit v1.2.3