Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / x86-64 / COFF_section_relocs.test
blob739dbf7b153844946943f017dd27d936f36f8eef
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-jitlink -noexec -abs __ImageBase=0xfff00000 \
3 # RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
4 # RUN: -check %s %t 
5
6 # Check IMAGE_REL_AMD64_SECTION and IMAGE_REL_AMD64_SECREL relocations
7 # are working correctly.
9 # jitlink-check: *{2}(sect) = 2
10 # jitlink-check: *{4}(sect+2) = 4
11 --- !COFF
12 header:
13   Machine:         IMAGE_FILE_MACHINE_AMD64
14   Characteristics: [  ]
15 sections:
16   - Name:            .text
17     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
18     Alignment:       16
19     SectionData:     '0000000000000000'
20   - Name:            .func
21     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
22     Alignment:       16
23     SectionData:     '0000000000000000'
24   - Name:            .sect
25     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
26     Alignment:       4
27     SectionData:     '0000000000000000'
28     Relocations:
29       - VirtualAddress:  0
30         SymbolTableIndex: 7
31         Type:            IMAGE_REL_AMD64_SECTION
32       - VirtualAddress:  2
33         SymbolTableIndex: 7
34         Type:            IMAGE_REL_AMD64_SECREL
35 symbols:
36   - Name:            .text
37     Value:           0
38     SectionNumber:   1
39     SimpleType:      IMAGE_SYM_TYPE_NULL
40     ComplexType:     IMAGE_SYM_DTYPE_NULL
41     StorageClass:    IMAGE_SYM_CLASS_STATIC
42     SectionDefinition:
43       Length:          8
44       NumberOfRelocations: 0
45       CheckSum:            0
46       NumberOfLinenumbers: 0
47       Number:          1
48   - Name:            .func
49     Value:           0
50     SectionNumber:   2
51     SimpleType:      IMAGE_SYM_TYPE_NULL
52     ComplexType:     IMAGE_SYM_DTYPE_NULL
53     StorageClass:    IMAGE_SYM_CLASS_STATIC
54     SectionDefinition:
55       Length:          8
56       NumberOfRelocations: 0
57       CheckSum:            0
58       NumberOfLinenumbers: 0
59       Number:          2
60   - Name:            .pdata
61     Value:           0
62     SectionNumber:   3
63     SimpleType:      IMAGE_SYM_TYPE_NULL
64     ComplexType:     IMAGE_SYM_DTYPE_NULL
65     StorageClass:    IMAGE_SYM_CLASS_STATIC
66     SectionDefinition:
67       Length:          8
68       NumberOfRelocations: 1
69       CheckSum:            0
70       NumberOfLinenumbers: 0
71       Number:          3
72   - Name:            main
73     Value:           0
74     SectionNumber:   1
75     SimpleType:      IMAGE_SYM_TYPE_NULL
76     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
77     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
78   - Name:            func
79     Value:           4
80     SectionNumber:   2
81     SimpleType:      IMAGE_SYM_TYPE_NULL
82     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
83     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
84   - Name:            sect
85     Value:           0
86     SectionNumber:   3
87     SimpleType:      IMAGE_SYM_TYPE_NULL
88     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
89     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL