brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · eacca25 Raw
41 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o3 4# RUN: echo "SECTIONS { ASSERT(1, fail) }" > %t1.script5# RUN: ld.lld -shared -o %t1 --script %t1.script %t1.o6# RUN: llvm-readobj %t1 > /dev/null7 8# RUN: echo "SECTIONS { ASSERT(0, fail) }" > %t3.script9# RUN: not ld.lld -o /dev/null -T %t3.script %t1.o 2>&1 | FileCheck --check-prefix=FAIL %s10# RUN: ld.lld -o /dev/null -T %t3.script %t1.o --noinhibit-exec 2>&1 | FileCheck --check-prefix=FAIL %s11# FAIL: fail12 13# RUN: echo "SECTIONS { . = ASSERT(0x1000, fail); }" > %t4.script14# RUN: ld.lld -shared -o %t4 --script %t4.script %t1.o15# RUN: llvm-readobj %t4 > /dev/null16 17# RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t5.script18# RUN: echo "ASSERT(SIZEOF(.foo) == 8, fail);" >> %t5.script19# RUN: ld.lld -shared -o %t5 --script %t5.script %t1.o20# RUN: llvm-readobj %t5 > /dev/null21 22## Even without SECTIONS block we still use section names23## in expressions24# RUN: echo "ASSERT(SIZEOF(.foo) == 8, fail);" > %t5.script25# RUN: ld.lld -shared -o %t5 --script %t5.script %t1.o26# RUN: llvm-readobj %t5 > /dev/null27 28## Test assertions inside of output section descriptions.29# RUN: echo "SECTIONS { .foo : { *(.foo) ASSERT(SIZEOF(.foo) == 8, \"true\"); } }" > %t6.script30# RUN: ld.lld -shared -o %t6 --script %t6.script %t1.o31# RUN: llvm-readobj %t6 > /dev/null32 33## Unlike the GNU ld, we accept the ASSERT without the semicolon.34## It is consistent with how ASSERT can be written outside of the35## output section declaration.36# RUN: echo "SECTIONS { .foo : { ASSERT(1, \"true\") } }" > %t7.script37# RUN: ld.lld -shared -o /dev/null --script %t7.script %t1.o38 39.section .foo, "a"40 .quad 041