[lld] r336143 - [LTO] Errors in LLVM backend should manifest as lld errors
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 2 14:01:43 PDT 2018
Author: sbc
Date: Mon Jul 2 14:01:43 2018
New Revision: 336143
URL: http://llvm.org/viewvc/llvm-project?rev=336143&view=rev
Log:
[LTO] Errors in LLVM backend should manifest as lld errors
Differential Revision: https://reviews.llvm.org/D48812
Added:
lld/trunk/test/ELF/lto/Inputs/sample-profile.prof
lld/trunk/test/wasm/lto/diagnostics.ll
Modified:
lld/trunk/Common/ErrorHandler.cpp
lld/trunk/test/ELF/lto/sample-profile.ll
Modified: lld/trunk/Common/ErrorHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/Common/ErrorHandler.cpp?rev=336143&r1=336142&r2=336143&view=diff
==============================================================================
--- lld/trunk/Common/ErrorHandler.cpp (original)
+++ lld/trunk/Common/ErrorHandler.cpp Mon Jul 2 14:01:43 2018
@@ -65,7 +65,18 @@ void lld::diagnosticHandler(const Diagno
raw_svector_ostream OS(S);
DiagnosticPrinterRawOStream DP(OS);
DI.print(DP);
- warn(S);
+ switch (DI.getSeverity()) {
+ case DS_Error:
+ error(S);
+ break;
+ case DS_Warning:
+ warn(S);
+ break;
+ case DS_Remark:
+ case DS_Note:
+ message(S);
+ break;
+ }
}
void lld::checkError(Error E) {
Added: lld/trunk/test/ELF/lto/Inputs/sample-profile.prof
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/Inputs/sample-profile.prof?rev=336143&view=auto
==============================================================================
--- lld/trunk/test/ELF/lto/Inputs/sample-profile.prof (added)
+++ lld/trunk/test/ELF/lto/Inputs/sample-profile.prof Mon Jul 2 14:01:43 2018
@@ -0,0 +1 @@
+f:0:0
Modified: lld/trunk/test/ELF/lto/sample-profile.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/sample-profile.ll?rev=336143&r1=336142&r2=336143&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/sample-profile.ll (original)
+++ lld/trunk/test/ELF/lto/sample-profile.ll Mon Jul 2 14:01:43 2018
@@ -3,11 +3,11 @@
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
; RUN: rm -f %t1.lto.o %t2.lto.o
-; RUN: ld.lld --lto-sample-profile=/dev/null %t1.o %t2.o -o %t3
+; RUN: ld.lld --lto-sample-profile=%p/Inputs/sample-profile.prof %t1.o %t2.o -o %t3
; RUN opt -S %t3.lto.o | FileCheck %s
; RUN: rm -f %t1.lto.o %t2.lto.o
-; RUN: ld.lld --plugin-opt=sample-profile=/dev/null %t1.o %t2.o -o %t3
+; RUN: ld.lld --plugin-opt=sample-profile=%p/Inputs/sample-profile.prof %t1.o %t2.o -o %t3
; RUN opt -S %t3.lto.o | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Added: lld/trunk/test/wasm/lto/diagnostics.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/wasm/lto/diagnostics.ll?rev=336143&view=auto
==============================================================================
--- lld/trunk/test/wasm/lto/diagnostics.ll (added)
+++ lld/trunk/test/wasm/lto/diagnostics.ll Mon Jul 2 14:01:43 2018
@@ -0,0 +1,22 @@
+; verify that errors in the LLVM backend during LTO manifest as lld
+; errors
+
+; RUN: llvm-as %s -o %t.o
+; RUN: not wasm-ld --lto-O0 %t.o -o %t2 2>&1 | FileCheck %s
+
+target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+define void @_start() {
+ call i8* @foo()
+ ret void
+}
+
+define i8* @foo() {
+ %1 = call i8* @llvm.returnaddress(i32 0)
+ ret i8* %1
+}
+
+declare i8* @llvm.returnaddress(i32)
+
+; CHECK: error: {{.*}} WebAssembly hasn't implemented __builtin_return_address
More information about the llvm-commits
mailing list