[PATCH] D52564: [PPC64] Add test for toc-restore on recursive call.
Sean Fertile via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 13:47:25 PDT 2018
sfertile added inline comments.
================
Comment at: test/ELF/ppc64-toc-restore-recursive-call.s:41
+ addi 5, 3, -1
+ mulld 4, 4, 3
+ mr 3, 5
----------------
MaskRay wrote:
> Are these extra operations (addi, mulld, ...) needed to make the test feel more authentic?
essentially. Its from one of the unit tests I wrote to figure out how we could have a recursive function call that crossed module boundaries, so I needed some 'testable' behavior.
================
Comment at: test/ELF/ppc64-toc-restore-recursive-call.s:44
+ bl recursive_func
+ nop
+ mr 4, 3
----------------
MaskRay wrote:
> Is this related to the behavior of powerpc gcc >= 5.0?
>
> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/powerpc.cc;hb=4e57b456393946cb4f90131b78e162cdec903c8a#l9069
>
>
> We had a discussion in https://reviews.llvm.org/D46204 that pre-5 versions of GCC did not emit a nop after bl.
Yes that discussion is what prompted this, this test is for documenting that we **need** the toc restore following the recursive call.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D52564
More information about the llvm-commits
mailing list