brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · bcb90e2 Raw
50 lines · plain
1; REQUIRES: x862 3; RUN: rm -rf %t.dir && mkdir %t.dir && cd %t.dir4; RUN: mkdir dir1 dir25; RUN: llvm-as %s -o ./dir1/main.o6; RUN: llvm-as %p/Inputs/thinlto.ll -o ./dir1/unused.o7; RUN: llvm-as %p/Inputs/thin1.ll -o ./dir1/thin.o8; RUN: llvm-as %p/Inputs/thin2.ll -o ./dir2/thin.o9; RUN: llvm-ar crT ./dir2/lib.a dir1/unused.o dir1/thin.o dir2/thin.o10 11;; For a thin archive referencing object files in a different directory,12;; emit index files (lib.a($member at $offset).thinlto.bc) in the directory13;; containing the archive, even in the lazy case. The information about the14;; referenced member's directory is lost.15; RUN: ld.lld --thinlto-emit-index-files ./dir2/lib.a ./dir1/main.o -o c --save-temps16; RUN: ls ./dir2 | FileCheck %s --check-prefix CHECK-UNUSED17 18; CHECK-UNUSED: lib.a(unused.o at {{[1-9][0-9]+}})19 20;; Index files emitted from object files in a thin archive should have the21;; offset in the archive specified to avoid collisions22; RUN: FileCheck %s < c.resolution.txt --check-prefix CHECK-COLLISION23 24; CHECK-COLLISION: dir1/main.o25; CHECK-COLLISION: dir2/lib.a(thin.o at {{[1-9][0-9]+}})26; CHECK-COLLISION-NEXT: -r=./dir2/lib.a(thin.o at {{[1-9][0-9]+}}),blah,pl27; CHECK-COLLISION: dir2/lib.a(thin.o at {{[1-9][0-9]+}})28; CHECK-COLLISION-NEXT: -r=./dir2/lib.a(thin.o at {{[1-9][0-9]+}}),foo,pl29 30;; Clean up31; RUN: rm -rf ./dir1/*.thinlto.bc32; RUN: rm -rf ./dir2/*.thinlto.bc33;; Empty index files for unused files in thin archives should still be emitted34;; in the same format when using --whole-archive35; RUN: ld.lld --thinlto-emit-index-files --whole-archive ./dir2/lib.a ./dir1/main.o -o d36; RUN: ls ./dir2 | FileCheck %s --check-prefix CHECK-UNUSED37 38target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"39target triple = "x86_64-unknown-linux-gnu"40 41declare i32 @blah(i32 %meh)42declare i32 @foo(i32 %goo)43 44define void @_start() {45entry:46  call i32 @foo(i32 0)47  call i32 @blah(i32 0)48  ret void49}50