Files
TheRock/compiler/amd-llvm/lld/test/MachO/lto-object-path.ll
T
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

80 lines
4.0 KiB
LLVM

; REQUIRES: x86
; UNSUPPORTED: system-windows
; RUN: rm -rf %t; mkdir %t
; RUN: llc -filetype=obj %s -o %t/test-obj.o
; RUN: opt -thinlto-bc %s -o %t/test.o
; RUN: opt %s -o %t/test-nonthin.o
; RUN: %lld %t/test.o -o %t/test
; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,NOOBJPATH
; RUN: %lld %t/test-obj.o -o %t/test-obj -object_path_lto %t/lto-temps-obj
; RUN: llvm-nm -pa %t/test-obj | FileCheck %s --check-prefixes CHECK,NOLTOFILES -DDIR=%t
; RUN: env ZERO_AR_DATE=0 %lld %t/test.o -o %t/test -object_path_lto %t/lto-temps
; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH-DIR -DDIR=%t/lto-temps
;; Ensure object path is still used if the cache is used
; RUN: env ZERO_AR_DATE=0 %lld %t/test.o -o %t/test -object_path_lto %t/lto-temps -prune_interval_lto 20 -cache_path_lto %t/cache --thinlto-cache-policy=cache_size_files=1:cache_size_bytes=10
; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH-DIR -DDIR=%t/lto-temps
;; And that dsymutil can read the result
; RUN: dsymutil -f -o - %t/test | llvm-dwarfdump - | FileCheck %s --check-prefix=DSYM
;; Test that the object path hardlinks to the cache when possible
;; NB:
;; 1) Need to delete current object path contents or hardlink will fail.
;; 2) Note the cache policy is different from the test above (which is crafted
;; to ensure that the cache is pruned immediately; we want the opposite here).
; RUN: rm -rf %t/lto-temps
; RUN: %lld %t/test.o -o %t/test -object_path_lto %t/lto-temps -prune_interval_lto 20 -cache_path_lto %t/cache --thinlto-cache-policy=cache_size_files=10:cache_size_bytes=10000
;; Get the link count.
; RUN: ls -l %t/lto-temps/1.x86_64.lto.o | tr -s ' ' | cut -f 2 -d ' ' | FileCheck %s --check-prefix=HARDLINK
;; check that the object path can be an existing file
; RUN: touch %t/lto-tmp.o
; RUN: env ZERO_AR_DATE=0 %lld %t/test-nonthin.o -o %t/test -object_path_lto %t/lto-tmp.o
; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH-FILE -DFILE=%t/lto-tmp.o
; RUN: llvm-otool -l %t/lto-tmp.o | FileCheck %s --check-prefixes=MINOS
;; Test that attempting to hardlink when cache and lto-temps are not empty does NOT cause a crash
;; Link attempt must be done twice, first run populates lto-temps/ and cache/.
; RUN: opt -thinlto-bc %S/Inputs/large-lto-object.ll -o %t/large.o
; RUN: rm -rf %t/lto-temps
; RUN: rm -rf %t/cache
; RUN: %lld %t/test.o %t/large.o -o %t/test -object_path_lto %t/lto-temps -cache_path_lto %t/cache --thinlto-jobs=all --lto-O0
; RUN: %lld %t/test.o %t/large.o -o %t/test -object_path_lto %t/lto-temps -cache_path_lto %t/cache --thinlto-jobs=all --lto-O0
; CHECK: 0000000000000000 - 00 0000 SO /tmp/test.cpp
; NOOBJPATH-NEXT: 0000000000000000 - 03 0001 OSO /tmp/lto.tmp
; NOLTOFILES-NEXT: 0000000000000000 - 03 0001 OSO [[DIR]]/test-obj.o
;; check that modTime is nonzero when `-object_path_lto` is provided
; OBJPATH-DIR-NEXT: {{[0-9a-f]*[1-9a-f]+[0-9a-f]*}} - 03 0001 OSO [[DIR]]/1.x86_64.lto.o
; OBJPATH-FILE-NEXT: {{[0-9a-f]*[1-9a-f]+[0-9a-f]*}} - 03 0001 OSO [[FILE]]
; CHECK-NEXT: {{[0-9a-f]+}} - 01 0000 FUN _main
; CHECK-NEXT: 0000000000000001 - 00 0000 FUN
; CHECK: 0000000000000000 - 01 0000 SO
; CHECK-NEXT: {{[0-9a-f]+}} T _main
; DSYM: DW_AT_name ("test.cpp")
; HARDLINK: 2
; MINOS: 10.15
target triple = "x86_64-apple-macosx10.15.0"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
define void @main() #0 !dbg !4 {
ret void
}
!llvm.module.flags = !{ !0, !1 }
!llvm.dbg.cu = !{!2}
!0 = !{i32 7, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, emissionKind: FullDebug)
!3 = !DIFile(filename: "test.cpp", directory: "/tmp")
!4 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 1, type: !5, scopeLine: 1, unit: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{}