2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: echo "SECTIONS { \
4 # RUN: .writable : ONLY_IF_RW { *(.writable) } \
5 # RUN: .readable : ONLY_IF_RO { *(.readable) }}" > %t.script
6 # RUN: ld.lld -o %t1 --script %t.script %t
7 # RUN: llvm-objdump --section-headers %t1 | \
8 # RUN: FileCheck -check-prefix=BASE %s
10 # BASE-NEXT: Idx Name Size
11 # BASE-NEXT: 0 00000000
12 # BASE: .writable 00000004
13 # BASE: .readable 00000004
15 # RUN: echo "SECTIONS { \
16 # RUN: .foo : ONLY_IF_RO { *(.foo.*) } \
17 # RUN: .writable : ONLY_IF_RW { *(.writable) } \
18 # RUN: .readable : ONLY_IF_RO { *(.readable) }}" > %t2.script
19 # RUN: ld.lld -o %t2 --script %t2.script %t
20 # RUN: llvm-objdump --section-headers %t2 | \
21 # RUN: FileCheck -check-prefix=NO1 %s
23 # NO1-NEXT: Idx Name Size
24 # NO1-NEXT: 0 00000000
25 # NO1: .writable 00000004
26 # NO1: .foo.2 00000004
27 # NO1: .readable 00000004
28 # NO1: .foo.1 00000004
34 .section .writable, "aw"
38 .section .readable, "a"
42 .section .foo.1, "awx"