George Rimar | eefa758 | 2016-08-04 09:29:31 +0000 | [diff] [blame] | 1 | # REQUIRES: x86 |
| 2 | # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o |
| 3 | |
| 4 | # RUN: echo "SECTIONS { \ |
| 5 | # RUN: ASSERT(1, \"true\") \ |
| 6 | # RUN: }" > %t1.script |
| 7 | # RUN: ld.lld -shared -o %t1 --script %t1.script %t1.o |
| 8 | # RUN: llvm-readobj %t1 > /dev/null |
| 9 | |
| 10 | # RUN: echo "SECTIONS { \ |
| 11 | # RUN: ASSERT(ASSERT(42, \"true\") == 42, \"true\") \ |
| 12 | # RUN: }" > %t2.script |
| 13 | # RUN: ld.lld -shared -o %t2 --script %t2.script %t1.o |
| 14 | # RUN: llvm-readobj %t2 > /dev/null |
| 15 | |
| 16 | # RUN: echo "SECTIONS { \ |
George Rimar | 54a5486 | 2016-08-04 09:49:26 +0000 | [diff] [blame] | 17 | # RUN: ASSERT(0, \"fail\") \ |
George Rimar | eefa758 | 2016-08-04 09:29:31 +0000 | [diff] [blame] | 18 | # RUN: }" > %t3.script |
| 19 | # RUN: not ld.lld -shared -o %t3 --script %t3.script %t1.o > %t.log 2>&1 |
| 20 | # RUN: FileCheck %s -check-prefix=FAIL < %t.log |
| 21 | # FAIL: fail |
| 22 | |
| 23 | # RUN: echo "SECTIONS { \ |
| 24 | # RUN: . = ASSERT(0x1000, \"true\"); \ |
| 25 | # RUN: }" > %t4.script |
| 26 | # RUN: ld.lld -shared -o %t4 --script %t4.script %t1.o |
| 27 | # RUN: llvm-readobj %t4 > /dev/null |