]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/linkerscript/define.s
Vendor import of lld trunk r321530:
[FreeBSD/FreeBSD.git] / test / ELF / linkerscript / define.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3
4 # RUN: echo "SECTIONS                                \
5 # RUN: {                                             \
6 # RUN:  . = DEFINED(defined) ? 0x11000 : .;          \
7 # RUN:  .foo : { *(.foo*) }                          \
8 # RUN:  . = DEFINED(notdefined) ? 0x12000 : 0x13000; \
9 # RUN:  .bar : { *(.bar*) }                          \
10 # RUN: }" > %t.script
11 # RUN: ld.lld -o %t1 --script %t.script %t
12 # RUN: llvm-objdump -section-headers %t1 | FileCheck %s
13
14 # CHECK: 1 .foo  00000008 0000000000011000 DATA
15 # CHECK: 2 .bar  00000008 0000000000013000 DATA
16 # CHECK: 3 .text 00000000 0000000000013008 TEXT DATA
17
18 .global defined
19 defined = 0
20
21 .section .foo,"a"
22 .quad 1
23
24 .section .bar,"a"
25 .quad 1