[PATCH] D44615: [test] Add test for version scripts with extern C++ and GNU ABI tags.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 01:58:08 PDT 2018


grimar added a comment.

Having such test case in LLD seems reasonable to me.



================
Comment at: test/ELF/linkerscript/cxx11-tag-version.s:3
+
+# RUN: echo "VER1 { global: extern \"C++\" { returns_string*; accepts_string*; global*}; local: *; } ;" > %t.script
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
----------------
Please use:
`echo 'VER1 { global: extern "C++" { returns_string*; accepts_string*; global* }; local: *; };' > %t.script`


================
Comment at: test/ELF/linkerscript/cxx11-tag-version.s:24
+
+# CHECK:      Name: _Z6globalB5cxx11@@VER1
+# CHECK-NEXT: Value: 0
----------------
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
```


================
Comment at: test/ELF/linkerscript/cxx11-tag-version.s:33
+.text
+.globl	_Z14returns_stringB5cxx11v # -- Begin function _Z14returns_stringB5cxx11v
+.type	_Z14returns_stringB5cxx11v, at function
----------------
And I would drop the comments, they do not seem to be useful.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44615





More information about the llvm-commits mailing list