51 lines · plain
1; REQUIRES: x862; RUN: rm -rf %t && split-file %s %t3; RUN: llvm-as %t/a.ll -o %t/a.bc4; RUN: llvm-mc --triple=x86_64-unknown-linux-gnu -filetype=obj %t/b.s -o %t/b.o5; RUN: llvm-as %t/c.ll -o %t/c.bc6; RUN: not ld.lld %t/a.bc %t/a.bc -o /dev/null -shared 2>&1 | FileCheck %s7 8;; --thinlto-index-only skips some passes. Test the error is present.9; RUN: not ld.lld %t/a.bc %t/a.bc --thinlto-index-only -o /dev/null 2>&1 | FileCheck %s10; RUN: not ld.lld %t/b.o %t/a.bc --lto-emit-asm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK211; RUN: not ld.lld %t/a.bc %t/b.o --thinlto-index-only -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK212 13;; --undefined-glob g extracts %t/c.bc which causes a duplicate symbol error.14; RUN: not ld.lld %t/a.bc --start-lib %t/c.bc --undefined-glob g --thinlto-index-only -o /dev/null 2>&1 | FileCheck %s15 16; CHECK: duplicate symbol: f17; CHECK-NEXT: >>> defined in {{.*}}.bc18; CHECK-NEXT: >>> defined in {{.*}}.bc19 20; CHECK2: duplicate symbol: f21; CHECK2-NEXT: >>> defined in {{.*}}22; CHECK2-NEXT: >>> defined in {{.*}}23 24;--- a.ll25target triple = "x86_64-unknown-linux-gnu"26target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"27 28define void @_start() {29 ret void30}31 32define void @f() {33 ret void34}35 36;--- b.s37.globl f38f:39 40;--- c.ll41target triple = "x86_64-unknown-linux-gnu"42target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"43 44define void @f() {45 ret void46}47 48define void @g() {49 ret void50}51