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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 04:05:47 PDT 2017


grimar added inline comments.


================
Comment at: test/ELF/linkerscript/assert.s:46
+# RUN: FileCheck %s -check-prefix=FAIL1 < %t.log
+# FAIL1: fail
+
----------------
abidh wrote:
> grimar wrote:
> > You can reuse `FAIL` I think.
> > 
> > ```
> > # RUN: FileCheck %s -check-prefix=FAIL < %t.log
> > ```
> I tried but it was not immediately obvious how to do it.
Following just works, no ?

```
# RUN: echo "SECTIONS { ASSERT(!(1), fail) }" > %t9.script
# RUN: not ld.lld -shared -o %t9 --script %t9.script %t1.o > %t.log 2>&1
# RUN: FileCheck %s -check-prefix=FAIL < %t.log
```


================
Comment at: test/ELF/linkerscript/symbol-assignexpr.s:18
 # RUN:         symbol12 += 1; \
+# RUN:         symbol13 = !(symbol); \
 # RUN:         bar = 0x5678; \
----------------
abidh wrote:
> grimar wrote:
> > All your new testcases using parentheses, is there some problem without them ?
> The linker script parsing have problem where it can not separate these operator. You will see that test of ~ operator also use '(' or space in between. I have also changed one test to use space but this needs to be fixed as a separate problem.
I fixed '~' here: D36508, I think you should be able to do the same for '!`


https://reviews.llvm.org/D36451





More information about the llvm-commits mailing list