68 lines · plain
1; REQUIRES: x862; RUN: rm -rf %t && split-file %s %t3; RUN: mkdir -p %t/old/subdir4 5; RUN: opt -module-summary %t/f.ll -o %t/old/subdir/1.o6; RUN: opt -module-summary %t/g.ll -o %t/old/subdir/2.o7; RUN: opt -module-summary %t/empty.ll -o %t/old/3.o8 9;; Ensure lld writes linked files to linked objects file.10; RUN: %lld --thinlto-index-only=%t/1.txt -dylib %t/old/subdir/1.o %t/old/subdir/2.o %t/old/3.o -o /dev/null11; RUN: ls %t/old/subdir/1.o.thinlto.bc12; RUN: ls %t/old/subdir/2.o.thinlto.bc13; RUN: ls %t/old/3.o.thinlto.bc14; RUN: FileCheck --check-prefix=CHECK-NO-REPLACE %s < %t/1.txt15; CHECK-NO-REPLACE: old/subdir/1.o16; CHECK-NO-REPLACE-NEXT: old/subdir/2.o17; CHECK-NO-REPLACE-NEXT: old/3.o18 19;; Check that this also works with thinlto-prefix-replace.20; RUN: %lld --thinlto-index-only=%t/2.txt --thinlto-prefix-replace="%t/old/;%t/new/" -dylib %t/old/subdir/1.o %t/old/subdir/2.o %t/old/3.o -o /dev/null21; RUN: ls %t/new/subdir/1.o.thinlto.bc22; RUN: ls %t/new/subdir/2.o.thinlto.bc23; RUN: ls %t/new/3.o.thinlto.bc24; RUN: FileCheck --check-prefix=CHECK-REPLACE-PREFIX %s < %t/2.txt25; CHECK-REPLACE-PREFIX: new/subdir/1.o26; CHECK-REPLACE-PREFIX-NEXT: new/subdir/2.o27; CHECK-REPLACE-PREFIX-NEXT: new/3.o28 29 30;; Check that this also works with replacing the prefix of linked objects.31; RUN: %lld --thinlto-index-only=%t/3.txt --thinlto-prefix-replace="%t/old/;%t/new/;%t/obj/" -dylib %t/old/subdir/1.o %t/old/subdir/2.o %t/old/3.o -o /dev/null32; RUN: ls %t/new/subdir/1.o.thinlto.bc33; RUN: ls %t/new/subdir/2.o.thinlto.bc34; RUN: ls %t/new/3.o.thinlto.bc35; RUN: FileCheck --check-prefix=CHECK-REPLACE-OBJECT-PREFIX %s < %t/3.txt36; CHECK-REPLACE-OBJECT-PREFIX: obj/subdir/1.o37; CHECK-REPLACE-OBJECT-PREFIX-NEXT: obj/subdir/2.o38; CHECK-REPLACE-OBJECT-PREFIX-NEXT: obj/3.o39 40; Create an error if prefix replace option have 'old;new;obj' format but index file is not set. Ensure that the error is about thinlto-prefix-replace.41; RUN: not %lld --thinlto-prefix-replace="%t/old/;%t/new/;%t/obj/" -dylib %t/old/subdir/1.o %t/old/subdir/2.o %t/old/3.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERROR42; ERROR: error: --thinlto-prefix-replace=old_dir;new_dir;obj_dir must be used with --thinlto-index-only=43 44;--- f.ll45target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"46target triple = "x86_64-apple-darwin"47 48declare void @g(...)49 50define void @f() {51entry:52 call void (...) @g()53 ret void54}55 56;--- g.ll57target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"58target triple = "x86_64-apple-darwin"59 60define void @g() {61entry:62 ret void63}64 65;--- empty.ll66target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"67target triple = "x86_64-apple-darwin"68