Files
TheRock/compiler/amd-llvm/lld/test/ELF/lto/thinlto-emit-index-thin-archive.ll
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

50 lines
1.9 KiB
LLVM

; REQUIRES: x86
; RUN: rm -rf %t.dir && mkdir %t.dir && cd %t.dir
; RUN: mkdir dir1 dir2
; RUN: llvm-as %s -o ./dir1/main.o
; RUN: llvm-as %p/Inputs/thinlto.ll -o ./dir1/unused.o
; RUN: llvm-as %p/Inputs/thin1.ll -o ./dir1/thin.o
; RUN: llvm-as %p/Inputs/thin2.ll -o ./dir2/thin.o
; RUN: llvm-ar crT ./dir2/lib.a dir1/unused.o dir1/thin.o dir2/thin.o
;; For a thin archive referencing object files in a different directory,
;; emit index files (lib.a($member at $offset).thinlto.bc) in the directory
;; containing the archive, even in the lazy case. The information about the
;; referenced member's directory is lost.
; RUN: ld.lld --thinlto-emit-index-files ./dir2/lib.a ./dir1/main.o -o c --save-temps
; RUN: ls ./dir2 | FileCheck %s --check-prefix CHECK-UNUSED
; CHECK-UNUSED: lib.a(unused.o at {{[1-9][0-9]+}})
;; Index files emitted from object files in a thin archive should have the
;; offset in the archive specified to avoid collisions
; RUN: FileCheck %s < c.resolution.txt --check-prefix CHECK-COLLISION
; CHECK-COLLISION: dir1/main.o
; CHECK-COLLISION: dir2/lib.a(thin.o at {{[1-9][0-9]+}})
; CHECK-COLLISION-NEXT: -r=./dir2/lib.a(thin.o at {{[1-9][0-9]+}}),blah,pl
; CHECK-COLLISION: dir2/lib.a(thin.o at {{[1-9][0-9]+}})
; CHECK-COLLISION-NEXT: -r=./dir2/lib.a(thin.o at {{[1-9][0-9]+}}),foo,pl
;; Clean up
; RUN: rm -rf ./dir1/*.thinlto.bc
; RUN: rm -rf ./dir2/*.thinlto.bc
;; Empty index files for unused files in thin archives should still be emitted
;; in the same format when using --whole-archive
; RUN: ld.lld --thinlto-emit-index-files --whole-archive ./dir2/lib.a ./dir1/main.o -o d
; RUN: ls ./dir2 | FileCheck %s --check-prefix CHECK-UNUSED
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @blah(i32 %meh)
declare i32 @foo(i32 %goo)
define void @_start() {
entry:
call i32 @foo(i32 0)
call i32 @blah(i32 0)
ret void
}