blob: 9d24c47f724c32facbe539eb7e06c766366839ee [file] [log] [blame]
George Rimareefa7582016-08-04 09:29:31 +00001# 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 Rimar54a54862016-08-04 09:49:26 +000017# RUN: ASSERT(0, \"fail\") \
George Rimareefa7582016-08-04 09:29:31 +000018# 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