[lld] [lld][test] Precommit test for ld -r links with FatLTO PIC objects (PR #92817)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 11:07:03 PDT 2024
================
@@ -4,13 +4,23 @@
; RUN: rm -rf %t && split-file %s %t
;; Ensure that input files contain .llvm.lto section.
-; RUN: llc %t/a-LTO.ll --filetype=obj -o %t/a-fatLTO.o
+; RUN: llc %t/a-LTO.ll --filetype=obj -o %t/a-fatLTO.o --relocation-model=pic
; RUN: opt < %t/a-LTO.ll --module-summary -o %t/a-fatLTO.bc
-; RUN: llvm-objcopy --add-section=.llvm.lto=%t/a-fatLTO.bc --set-section-flags=.llvm.lto=exclude %t/a-fatLTO.o
+; RUN: llvm-objcopy --add-section=.llvm.lto=%t/a-fatLTO.bc --set-section-flags=.llvm.lto=exclude --set-section-type=.llvm.lto=0x6fff4c0c %t/a-fatLTO.o
-; RUN: llc %t/main-LTO.ll --filetype=obj -o %t/main-fatLTO.o
+
+; RUN: llc %t/main-LTO.ll --filetype=obj -o %t/main-fatLTO.o --relocation-model=pic
; RUN: opt < %t/main-LTO.ll --module-summary -o %t/main-fatLTO.bc
-; RUN: llvm-objcopy --add-section=.llvm.lto=%t/main-fatLTO.bc --set-section-flags=.llvm.lto=exclude %t/main-fatLTO.o
+; RUN: llvm-objcopy --add-section=.llvm.lto=%t/main-fatLTO.bc --set-section-flags=.llvm.lto=exclude --set-section-type=.llvm.lto=0x6fff4c0c %t/main-fatLTO.o
+
+; RUN: llvm-readobj -S %t/a-fatLTO.o | FileCheck --check-prefix=HAS_LLVM_LTO %s
+; RUN: llvm-readobj -S %t/main-fatLTO.o | FileCheck --check-prefix=HAS_LLVM_LTO %s
+
+;; Make sure that the section flags are set correctly
+; HAS_LLVM_LTO: Name: .llvm.lto
----------------
ilovepi wrote:
That seems to work fine, so I've updated the checks in this file.
https://github.com/llvm/llvm-project/pull/92817
More information about the llvm-commits
mailing list