[PATCH] D87824: [lld][ELF][test] Add additional LTO testing

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 11:49:06 PDT 2020


MaskRay added a comment.

I have a suggestion to a test. If you exclude `lto/wrap-2.ll` from this patch, it will look good to me.



================
Comment at: lld/test/ELF/lto/internalize-basic.ll:14
+
+define hidden void @bar() {
   ret void
----------------
You can enhance the test by deleting `hidden`. The important property is `isUsedInRegularObj`, not visibility.


================
Comment at: lld/test/ELF/lto/wrap-2.ll:2
 ; REQUIRES: x86
-; LTO
-; RUN: llvm-as %s -o %t.o
-; RUN: llvm-as %S/Inputs/wrap-bar.ll -o %t1.o
-; RUN: ld.lld %t.o %t1.o -shared -o %t.so -wrap=bar
-; RUN: llvm-objdump -d %t.so | FileCheck %s
-; RUN: llvm-readobj --symbols %t.so | FileCheck -check-prefix=BIND %s
-
-; ThinLTO
-; RUN: opt -module-summary %s -o %t.o
-; RUN: opt -module-summary %S/Inputs/wrap-bar.ll -o %t1.o
-; RUN: ld.lld %t.o %t1.o -shared -o %t.so -wrap=bar
-; RUN: llvm-objdump -d %t.so | FileCheck %s
-; RUN: llvm-readobj --symbols %t.so | FileCheck -check-prefix=BIND %s
-
-; Make sure that calls in foo() are not eliminated and that bar is
-; routed to __wrap_bar and __real_bar is routed to bar.
+;; This test verifies that --wrap works correctly for inter-module references to
+;; the wrapped symbol, when LTO or ThinLTO is involved. It checks for various
----------------
Is it related to D85782? My feeling is https://reviews.llvm.org/D85782#2211636 

I think we need to be careful making this promise. This is not intentionally guaranteed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87824/new/

https://reviews.llvm.org/D87824



More information about the llvm-commits mailing list