[Clang] replace 'bitfield' with 'bit-field' for consistency (#117881)
[llvm-project.git] / lld / test / ELF / input-section-flags-keep.s
blob51891892940d2b93035ee83dcf47e826b60be3eb
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: echo "SECTIONS { \
4 # RUN: . = SIZEOF_HEADERS; \
5 # RUN: .keep : { KEEP( INPUT_SECTION_FLAGS(!SHF_WRITE) *(.sec*)) } \
6 # RUN: }" > %t.script
7 # RUN: ld.lld --gc-sections -o %t --script %t.script %t.o
8 # RUN: llvm-readobj --symbols %t | FileCheck %s
10 ## Check that INPUT_SECTION_FLAGS can be used within KEEP, and affects what
11 ## is kept.
12 # CHECK: Name: keep
13 # CHECK-NOT: NAME: collect
14 .text
15 .global _start
16 _start:
17 .long 0
19 .section .sec1, "a"
20 .global keep
21 keep:
22 .long 1
24 .section .sec2, "aw"
25 .global collect
26 collect:
27 .long 2