[PATCH] D36451: [ELF, LinkerScript] Support ! operator in linker script.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 05:08:16 PDT 2017


ruiu added inline comments.


================
Comment at: test/ELF/linkerscript/assert.s:1
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
----------------
I wouldn't add any tests to this file as the feature is tested by symbol-assignexpr.s.


================
Comment at: test/ELF/linkerscript/assert.s:48-52
+# RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t10.script
+# RUN: echo "ASSERT(!(SIZEOF(.foo) == 0), fail);" >> %t10.script
+# RUN: ld.lld -shared -o %t10 --script %t10.script %t1.o
+# RUN: llvm-readobj %t10 > /dev/null
+
----------------
I wouldn't add this test -- the feature is tested enough with the above two tests.


================
Comment at: test/ELF/linkerscript/symbol-assignexpr.s:18
 # RUN:         symbol12 += 1; \
+# RUN:         symbol13 = ! symbol; \
 # RUN:         bar = 0x5678; \
----------------
Replace `!symbol` with `!1` and add `symbol14 = !0`.


https://reviews.llvm.org/D36451





More information about the llvm-commits mailing list