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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 04:38:41 PDT 2020


grimar added inline comments.


================
Comment at: lld/test/ELF/lto/archive-mixed.ll:26
+; RUN:   FileCheck %s --implicit-check-not={{.}}
+; RUN: ld.lld -o /dev/null --trace ref.o a.o.b.bc.a  other.bc.a | \
+; RUN:   FileCheck %s --implicit-check-not={{.}}
----------------
nit: in the `llvm-ar` block above, `a.bc.b.o.a` follows the `a.bc.b.bc.a`. I'd suggest to keep the order here.


================
Comment at: lld/test/ELF/lto/undef-mixed2.s:3
+## not internalized and is emitted in the output.
+# REQUIRES: x86
+# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
----------------
I'd put "REQUIRES" on the first line.


================
Comment at: lld/test/ELF/lto/undef-mixed2.s:5
+# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
+# RUN: llvm-as %p/Inputs/undef-mixed2.ll -o %t2.o
+# RUN: ld.lld %t2.o %t.o -o %t.so -shared
----------------
Any reason not to use `split-file` instead of adding a new input?


================
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.
+;; LTO + LTO
+; RUN: llvm-as %s -o %t.bc
----------------
Probably worth adding a general comment about what this test case validates?


================
Comment at: lld/test/ELF/lto/wrap-2.ll:5
+; RUN: llvm-as %S/Inputs/wrap-bar.ll -o %t1.bc
+; RUN: ld.lld %t.bc %t1.bc -shared -o %t.bc.bc.so -wrap=bar
+; RUN: llvm-objdump -d %t.bc.bc.so | FileCheck %s --check-prefixes=CHECK,JMP
----------------
`%t.bc.bc.so` looks a bit strange, though I see why you name it like this.
Do `%t.bc-bc.so` reads better? (the same for other .so).


================
Comment at: lld/test/ELF/lto/wrap-2.ll:16
+;; Object + LTO
+; RUN: llc %s -o %t.o --filetype=obj
+; RUN: ld.lld %t.o %t1.bc -shared -o %t.o.bc.so -wrap=bar
----------------
Perhaps `%t2.o`, since you have `%t1.o` already?


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