xref: /llvm-project/lld/test/ELF/linkerscript/fill.test (revision c44a23f8f450bdb8cec784ef0c4f0ca502b7524f)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/fill.s -o %t.o
3# RUN: ld.lld -o %t --script %s %t.o
4# RUN: llvm-objdump -s %t | FileCheck %s
5
6SECTIONS {
7  .out : {
8   FILL(0x11111111)
9   . += 2;
10   FILL(0x10101010)
11   *(.aaa)
12   . += 4;
13   *(.bbb)
14   . += 4;
15   FILL(0x22220000 + 0x2222);
16   . += 4;
17  }
18}
19
20# CHECK:      Contents of section .out:
21# CHECK-NEXT: 2222aa22 222222bb 22222222 22222222
22
23# RUN: echo 'SECTIONS { .out : { FILL 0x11111111 } }' > %t.script
24# RUN: not ld.lld -o /dev/null --script %t.script 2>&1 | FileCheck %s --check-prefix=ERR
25# ERR: ( expected, but got 0x11111111
26