[PATCH] D30277: [COFF] added test for thinlto

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 16:19:29 PST 2017


inglorion added inline comments.


================
Comment at: test/COFF/thinlto.ll:9
+; RUN: llc -filetype=obj -o %T/thinlto/foo.obj %S/Inputs/lto-dep.ll
+; RUN: llvm-ar cru %T/thinlto/foo.lib %T/thinlto/foo.obj
+
----------------
mehdi_amini wrote:
> is `.obj` the standard extension for object on Windows? (and `.lib` for archive?)
Yes.


================
Comment at: test/COFF/thinlto.ll:11
+
+; RUN: lld-link /out:%T/thinlto/main.exe /entry:main /include:f2 /subsystem:console %T/thinlto/main.thinlto.obj %T/thinlto/foo.thinlto.obj
+; RUN: llvm-readobj -file-headers %T/thinlto/main.exe | FileCheck -check-prefix=HEADERS-11 %s
----------------
mehdi_amini wrote:
> I don't know what is the `/include` directive doing? Is it preventing dead-stripping somehow? Or affecting the symbol resolution otherwise?
Right. It instructs the linker to retain that symbol, regardless of what it would otherwise do.


================
Comment at: test/COFF/thinlto.ll:106
+; TEXT-10-NEXT: addq	$40, %rsp
+; TEXT-10-NEXT: retq
+
----------------
mehdi_amini wrote:
> Why do we check this exact sequence of assembly? Overall I don't know what this test is enforcing / verifying right now.
> 
This was essentially performing the same checks as lto.ll. However, per @pcc's suggestion, I've changed the test to be much simpler and not actually look at the disassembly.


https://reviews.llvm.org/D30277





More information about the llvm-commits mailing list