This is an archive of the discontinued LLVM Phabricator instance.

[test] Add test for version scripts with extern C++ and GNU ABI tags.
Needs ReviewPublic

Authored by RAOF on Mar 18 2018, 5:31 PM.

Details

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

RAOF created this revision.Mar 18 2018, 5:31 PM

Having such test case in LLD seems reasonable to me.

test/ELF/linkerscript/cxx11-tag-version.s
3

Please use:
echo 'VER1 { global: extern "C++" { returns_string*; accepts_string*; global* }; local: *; };' > %t.script

24

I do not think you need to check anything except the names here. So I would shorten the checks:

# CHECK: _Z14accepts_stringRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
# CHECK: _Z14returns_stringB5cxx11v
# CHECK: _Z6globalB5cxx11
33

And I would drop the comments, they do not seem to be useful.

You could use llvm-cxxfilt.cpp to more directly test the demangler, no?

RAOF updated this revision to Diff 139405.Mar 21 2018, 6:23 PM

Updated test case to match review.

ruiu added a comment.Mar 22 2018, 2:34 PM

"cxx11-tag-version.s" is not an appropriate file name for this test case because this is not specific to C++11. I'd name "extern-cpp.s".

test/ELF/linkerscript/cxx11-tag-version.s
4

I think you can remove "VER1".

9

Remove extraneous space characters between "CHECK:" and "Name:"

13–26

You don't need to repeat the same test case three times. Please use only one symbol.