# REQUIRES: x86

# RUN: yaml2obj %s -o %t.obj
# RUN: lld-link -dll -out:%t.dll %t.obj -noentry -subsystem:console -lldmap:%t.map
# RUN: llvm-objdump -s %t.dll | FileCheck %s
# RUN: FileCheck %s --check-prefix=MAP < %t.map

# CHECK:      Contents of section .itest:
# CHECK-NEXT:  180001000 0c100000 0c100000 00000000 01000000

# MAP: 00001000 0000000a     4         {{.*}}:(.itest$2)
# MAP: 00001000 00000000     0                 .itest$2
# MAP: 0000100c 00000000     4         {{.*}}:(.itest$4)
# MAP: 0000100c 00000000     0                 .itest$4
# MAP: 0000100c 00000004     2         {{.*}}:(.itest$6)
# MAP: 0000100c 00000000     0                 .itest$6

--- !COFF
header:
  Machine:         IMAGE_FILE_MACHINE_AMD64
  Characteristics: [  ]
sections:
  - Name:            '.itest$2'
    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
    Alignment:       4
    SectionData:     '00000000000000000000'
    SizeOfRawData:   10
    Relocations:
      - VirtualAddress:  0
        SymbolName:      '.itest$4'
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  4
        SymbolName:      '.itest$6'
        Type:            IMAGE_REL_AMD64_ADDR32NB
  - Name:            '.itest$6'
    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
    Alignment:       2
    SectionData:     01000000
    SizeOfRawData:   4
symbols:
  - Name:            '.itest$2'
    Value:           0
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_SECTION
  - Name:            '.itest$6'
    Value:           3221225536
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_SECTION
  - Name:            '.itest$4'
    Value:           3221225536
    SectionNumber:   0
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_SECTION
...
