1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3# RUN: echo "SECTIONS { \
4# RUN:  .text : { *(.text) } \
5# RUN:  . = 0x1000; .aaa : ONLY_IF_RO { *(.aaa.*) } \
6# RUN:  . = 0x2000; .aaa : ONLY_IF_RW { *(.aaa.*) } } " > %t.script
7# RUN: ld.lld -o %t1 --script %t.script %t
8# RUN: llvm-objdump --section-headers %t1 | FileCheck %s
9
10# CHECK:      Sections:
11# CHECK-NEXT: Idx Name          Size      VMA          Type
12# CHECK: .aaa          00000010 0000000000002000 DATA
13
14
15# RUN: echo "SECTIONS { \
16# RUN:  .text : { *(.text) } \
17# RUN:  . = 0x1000; .aaa : ONLY_IF_RW { *(.aaa.*) } \
18# RUN:  . = 0x2000; .aaa : ONLY_IF_RO { *(.aaa.*) } } " > %t2.script
19# RUN: ld.lld -o %t2 --script %t2.script %t
20# RUN: llvm-objdump --section-headers %t2 | FileCheck %s --check-prefix=REV
21
22# REV:      Sections:
23# REV-NEXT: Idx Name          Size       VMA          Type
24# REV:  .aaa          00000010 0000000000001000 DATA
25
26.global _start
27_start:
28 nop
29
30.section .aaa.1, "aw"
31.quad 1
32
33.section .aaa.2, "aw"
34.quad 1
35