1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/test/LTO/X86/diagnostic-handler-noexit.ll
Yunzhong Gao c13f4daa7c Add a libLTO diagnostic handler that supports lto_get_error_message API
This is a follow-up from the previous discussion on the thread:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307763.html

The LibLTO lto_get_error_message() API reads error messages from a std::string
sLastErrorString. Instead of passing this string around as an argument, this
patch creates a diagnostic handler and then sends this handler to the
constructor of LTOCodeGenerator.

Differential Revision: http://reviews.llvm.org/D14313

llvm-svn: 252791
2015-11-11 19:59:08 +00:00

14 lines
580 B
LLVM

; LTO default diagnostic handler should be non-exiting.
; This test verifies that after addModule() encounters an error, the diagnostic
; handler does not call exit(1) and instead returns to the caller of addModule.
; RUN: llvm-as <%s >%t1
; RUN: llvm-as <%s >%t2
; RUN: not llvm-lto -use-diagnostic-handler -o /dev/null %t1 %t2 2>&1 | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
; CHECK: llvm-lto: error: Linking globals named 'goodboy': symbol multiply defined!
; CHECK: llvm-lto{{.*}}: error adding file
@goodboy = global i32 3203383023, align 4 ; 0xbeefbeef