Files
TheRock/compiler/amd-llvm/cross-project-tests/dtlto/fat-lto-objects.test
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

56 lines
2.1 KiB
Plaintext

REQUIRES: ld.lld,llvm-ar
# Test that a DTLTO link succeeds and outputs the expected set of files
# correctly when FatLTO objects are present.
RUN: rm -rf %t && split-file %s %t && cd %t
# Compile bitcode. -O2 is required for cross-module importing.
RUN: %clang -O2 --target=x86_64-linux-gnu -flto=thin -ffat-lto-objects -c \
RUN: foo.c boo.c start.c
# We want to test FatLTO objects when included in archives.
RUN: llvm-ar rcs foo.a foo.o
RUN: llvm-ar rcsT boo.a boo.o
# Build with DTLTO.
RUN: %clang --target=x86_64-linux-gnu -flto=thin -ffat-lto-objects \
RUN: -fuse-ld=lld -nostdlib foo.a boo.a start.o -Wl,--save-temps \
RUN: -fthinlto-distributor=%python \
RUN: -Xthinlto-distributor=%llvm_src_root/utils/dtlto/local.py
# Check that the required output files have been created.
RUN: ls | FileCheck %s
# thin archive member: <archive>(<member> at <offset>).<task>.<pid>.<task>.<pid>.native.o
CHECK-DAG: {{^}}boo.a(boo.o at [[#BOO_OFFSET:]]).3.[[#%X,HEXPID:]].3.[[#PID:]].native.o{{$}}
# archive member: <archive>(<member> at <offset>).<task>.<pid>.<task>.<pid>.native.o
CHECK-DAG: {{^}}foo.a(foo.o at [[#FOO_OFFSET:]]).2.[[#%X,HEXPID]].2.[[#PID]].native.o{{$}}
# FatLTO object: <file>.<task>.<pid>.<task>.<pid>.native.o.
CHECK-DAG: {{^}}start.o.1.[[#%X,HEXPID]].1.[[#PID]].native.o{{$}}
# Check that all objects are named in all of the index files.
# We expect this to happen because each object references symbols from the
# others.
RUN: llvm-dis *.1.*.thinlto.bc -o - | \
RUN: FileCheck %s --check-prefixes=OBJECTS
RUN: llvm-dis *.2.*.thinlto.bc -o - | \
RUN: FileCheck %s --check-prefixes=OBJECTS
RUN: llvm-dis *.3.*.thinlto.bc -o - | \
RUN: FileCheck %s --check-prefixes=OBJECTS
OBJECTS-DAG: foo.o
OBJECTS-DAG: boo.o
OBJECTS-DAG: start.o
#--- foo.c
extern int boo(int), _start(int);
__attribute__((retain)) int foo(int x) { return x + boo(x) + _start(x); }
#--- boo.c
extern int foo(int), _start(int);
__attribute__((retain)) int boo(int x) { return x + foo(x) + _start(x); }
#--- start.c
extern int foo(int), boo(int);
__attribute__((retain)) int _start(int x) { return x + foo(x) + boo(x); }