diff --git a/llvm/test/Linker/link-messages.ll b/llvm/test/Linker/link-messages.ll new file mode 100644 index 000000000000..dae724003042 --- /dev/null +++ b/llvm/test/Linker/link-messages.ll @@ -0,0 +1,11 @@ +; Test that linking two files with the same definition causes an error and +; that error is printed out. +; RUN: llvm-as %s -o %t.one.bc -f +; RUN: llvm-as %s -o %t.two.bc -f +; RUN: ignore llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \ +; RUN: -o %t.bc 2>%t.err +; RUN: grep "Function is already defined" %t.err + +define i32 @bar() { + ret i32 0 +}