Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / yaml2obj / COFF / xrelocs.yaml
blobcecef3b0fdad99b1fc589023c8d79d079e907e96
1 ## This test checks that yaml2obj correctly handles COFF sections with
2 ## extended relocation tables (IMAGE_SCN_LNK_NRELOC_OVFL).
3 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-readobj --sections --relocations %t | FileCheck %s --check-prefix=CHECK-OBJ
5 # RUN: obj2yaml %t | FileCheck %s --check-prefix=CHECK-YAML
7 # CHECK-OBJ:      Sections [
8 # CHECK-OBJ-NEXT:   Section {
9 # CHECK-OBJ-NEXT:     Number: 1
10 # CHECK-OBJ-NEXT:     Name: .data
11 # CHECK-OBJ:          RawDataSize: 16
12 # CHECK-OBJ:          RelocationCount: 65535
13 # CHECK-OBJ:          Characteristics [
14 # CHECK-OBJ-NEXT:       IMAGE_SCN_ALIGN_16BYTES
15 # CHECK-OBJ-NEXT:       IMAGE_SCN_CNT_INITIALIZED_DATA
16 # CHECK-OBJ-NEXT:       IMAGE_SCN_LNK_NRELOC_OVFL
17 # CHECK-OBJ-NEXT:       IMAGE_SCN_MEM_READ
18 # CHECK-OBJ-NEXT:     ]
19 # CHECK-OBJ-NEXT:   }
20 # CHECK-OBJ-NEXT: ]
21 # CHECK-OBJ-NEXT: Relocations [
22 # CHECK-OBJ-NEXT:   Section (1) .data {
23 # CHECK-OBJ-NEXT:     0x0 IMAGE_REL_AMD64_ADDR64 foo (0)
24 # CHECK-OBJ-NEXT:     0x8 IMAGE_REL_AMD64_ADDR64 bar (1)
25 # CHECK-OBJ-NEXT:   }
26 # CHECK-OBJ-NEXT: ]
28 # CHECK-YAML:      sections:
29 # CHECK-YAML-NEXT:   - Name:            .data
30 # CHECK-YAML-NEXT:     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_NRELOC_OVFL, IMAGE_SCN_MEM_READ ]
31 # CHECK-YAML-NEXT:     Alignment:       16
32 # CHECK-YAML-NEXT:     SectionData:     '00000000000000000000000000000000'
33 # CHECK-YAML-NEXT:     SizeOfRawData:   16
34 # CHECK-YAML-NEXT:     Relocations:
35 # CHECK-YAML-NEXT:       - VirtualAddress:  0
36 # CHECK-YAML-NEXT:         SymbolName:      foo
37 # CHECK-YAML-NEXT:         Type:            IMAGE_REL_AMD64_ADDR64
38 # CHECK-YAML-NEXT:       - VirtualAddress:  8
39 # CHECK-YAML-NEXT:         SymbolName:      bar
40 # CHECK-YAML-NEXT:         Type:            IMAGE_REL_AMD64_ADDR64
41 # CHECK-YAML-NEXT: symbols:
43 --- !COFF
44 header:
45   Machine:         IMAGE_FILE_MACHINE_AMD64
46   Characteristics: [  ]
47 sections:
48   - Name:            .data
49     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_NRELOC_OVFL, IMAGE_SCN_MEM_READ ]
50     Alignment:       16
51     SectionData:     '00000000000000000000000000000000'
52     Relocations:
53       - VirtualAddress:  0
54         SymbolName:      foo
55         Type:            IMAGE_REL_AMD64_ADDR64
56       - VirtualAddress:  8
57         SymbolName:      bar
58         Type:            IMAGE_REL_AMD64_ADDR64
59 symbols:
60   - Name:            foo
61     Value:           0
62     SectionNumber:   0
63     SimpleType:      IMAGE_SYM_TYPE_NULL
64     ComplexType:     IMAGE_SYM_DTYPE_NULL
65     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
66   - Name:            bar
67     Value:           0
68     SectionNumber:   0
69     SimpleType:      IMAGE_SYM_TYPE_NULL
70     ComplexType:     IMAGE_SYM_DTYPE_NULL
71     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
72 ...