[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / tools / llvm-objcopy / COFF / empty-sections.s
blob00e1a7d75b4bccb71bcb93e9c14c1a39bc4d5c67
1 ## Check how the PointerToRawData field is set for empty sections.
2 ##
3 ## Some tools may leave it set to a nonzero value, while others
4 ## set it to zero. Currently, the LLVM MC layer produces a .data
5 ## section with a nonzero PointerToRawData value, even if no
6 ## .data section needs to be emitted. Other tools, such as yaml2obj
7 ## writes a zero field if there's no data.
8 ##
9 ## When llvm-objcopy copies object files, it either needs to
10 ## update the value to a valid value (within the bounds of the
11 ## file, even if the section is empty) or zero. Some tools
12 ## (such as obj2yaml or llvm-objcopy) can error out if the value
13 ## is out of bounds.
15 ## Check that our input file has got a nonzero field, and that
16 ## it is set to zero after a run with llvm-objcopy.
18 # REQUIRES: x86-registered-target
20 # RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s -o %t.in.obj
21 # RUN: llvm-readobj --sections %t.in.obj | FileCheck %s --check-prefix=INPUT
22 # RUN: llvm-objcopy --remove-section=.bss %t.in.obj %t.out.obj
23 # RUN: llvm-readobj --sections %t.out.obj | FileCheck %s --check-prefix=OUTPUT
25 # INPUT: Name: .data
26 # INPUT-NEXT: VirtualSize: 0x0
27 # INPUT-NEXT: VirtualAddress: 0x0
28 # INPUT-NEXT: RawDataSize: 0
29 # INPUT-NEXT: PointerToRawData: 0x8D
31 # OUTPUT: Name: .data
32 # OUTPUT-NEXT: VirtualSize: 0x0
33 # OUTPUT-NEXT: VirtualAddress: 0x0
34 # OUTPUT-NEXT: RawDataSize: 0
35 # OUTPUT-NEXT: PointerToRawData: 0x0{{$}}
37 .text
38 .globl func
39 func:
40 ret