2 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
3 ; RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefixes=SEC,SEC32
4 ; RUN: llvm-objdump -r %t.o | FileCheck %s --check-prefix=RELO
6 ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s
7 ; RUN: llvm-readobj --section-headers %t64.o | FileCheck %s --check-prefixes=SEC,SEC64
8 ; RUN: llvm-objdump -r %t64.o | FileCheck %s --check-prefix=RELO64
10 ; This file is copied from test/DebugInfo/XCOFF/empty.ll.
11 ; In this test, we focus on XCOFF related formats, like section headers,
14 source_filename = "1.c"
15 target datalayout = "E-m:a-p:32:32-i64:64-n32"
17 ; Function Attrs: noinline nounwind optnone
18 define i32 @main() #0 !dbg !8 {
20 %retval = alloca i32, align 4
21 store i32 0, ptr %retval, align 4
26 !llvm.module.flags = !{!3, !4, !5, !6}
29 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
30 !1 = !DIFile(filename: "1.c", directory: "debug")
32 !3 = !{i32 7, !"Dwarf Version", i32 4}
33 !4 = !{i32 2, !"Debug Info Version", i32 3}
34 !5 = !{i32 1, !"wchar_size", i32 2}
35 !6 = !{i32 7, !"PIC Level", i32 2}
36 !7 = !{!"clang version 12.0.0"}
37 !8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
38 !9 = !DISubroutineType(types: !10)
40 !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
41 !12 = !DILocation(line: 3, column: 3, scope: !8)
46 ; SEC-NEXT: Name: .text
47 ; SEC-NEXT: PhysicalAddress: 0x0
48 ; SEC-NEXT: VirtualAddress: 0x0
49 ; SEC-NEXT: Size: 0x28
50 ; SEC32-NEXT: RawDataOffset: 0xDC
51 ; SEC64-NEXT: RawDataOffset: 0x180
52 ; SEC-NEXT: RelocationPointer: 0x0
53 ; SEC-NEXT: LineNumberPointer: 0x0
54 ; SEC-NEXT: NumberOfRelocations: 0
55 ; SEC-NEXT: NumberOfLineNumbers: 0
56 ; SEC-NEXT: Type: STYP_TEXT (0x20)
60 ; SEC-NEXT: Name: .data
61 ; SEC-NEXT: PhysicalAddress: 0x28
62 ; SEC-NEXT: VirtualAddress: 0x28
63 ; SEC32-NEXT: Size: 0xC
64 ; SEC32-NEXT: RawDataOffset: 0x104
65 ; SEC32-NEXT: RelocationPointer: 0x1F4
66 ; SEC64-NEXT: Size: 0x18
67 ; SEC64-NEXT: RawDataOffset: 0x1A8
68 ; SEC64-NEXT: RelocationPointer: 0x2C8
69 ; SEC-NEXT: LineNumberPointer: 0x0
70 ; SEC-NEXT: NumberOfRelocations: 2
71 ; SEC-NEXT: NumberOfLineNumbers: 0
72 ; SEC-NEXT: Type: STYP_DATA (0x40)
76 ; SEC-NEXT: Name: .dwabrev
77 ; SEC-NEXT: PhysicalAddress: 0x0
78 ; SEC-NEXT: VirtualAddress: 0x0
79 ; SEC-NEXT: Size: 0x36
80 ; SEC32-NEXT: RawDataOffset: 0x11C
81 ; SEC64-NEXT: RawDataOffset: 0x1C0
82 ; SEC-NEXT: RelocationPointer: 0x0
83 ; SEC-NEXT: LineNumberPointer: 0x0
84 ; SEC-NEXT: NumberOfRelocations: 0
85 ; SEC-NEXT: NumberOfLineNumbers: 0
86 ; SEC-NEXT: Type: STYP_DWARF (0x10)
90 ; SEC-NEXT: Name: .dwinfo
91 ; SEC-NEXT: PhysicalAddress: 0x0
92 ; SEC-NEXT: VirtualAddress: 0x0
93 ; SEC32-NEXT: Size: 0x57
94 ; SEC32-NEXT: RawDataOffset: 0x15C
95 ; SEC32-NEXT: RelocationPointer: 0x208
96 ; SEC64-NEXT: Size: 0x6F
97 ; SEC64-NEXT: RawDataOffset: 0x200
98 ; SEC64-NEXT: RelocationPointer: 0x2E4
99 ; SEC-NEXT: LineNumberPointer: 0x0
100 ; SEC-NEXT: NumberOfRelocations: 4
101 ; SEC-NEXT: NumberOfLineNumbers: 0
102 ; SEC-NEXT: Type: STYP_DWARF (0x10)
104 ; SEC-NEXT: Section {
106 ; SEC-NEXT: Name: .dwline
107 ; SEC-NEXT: PhysicalAddress: 0x0
108 ; SEC-NEXT: VirtualAddress: 0x0
109 ; SEC32-NEXT: Size: 0x36
110 ; SEC32-NEXT: RawDataOffset: 0x1BC
111 ; SEC32-NEXT: RelocationPointer: 0x230
112 ; SEC64-NEXT: Size: 0x46
113 ; SEC64-NEXT: RawDataOffset: 0x280
114 ; SEC64-NEXT: RelocationPointer: 0x31C
115 ; SEC-NEXT: LineNumberPointer: 0x0
116 ; SEC-NEXT: NumberOfRelocations: 1
117 ; SEC-NEXT: NumberOfLineNumbers: 0
118 ; SEC-NEXT: Type: STYP_DWARF (0x10)
122 ; RELO: RELOCATION RECORDS FOR [.dwinfo]:
123 ; RELO-NEXT: OFFSET TYPE VALUE
124 ; RELO-NEXT: 00000006 R_POS .dwabrev
125 ; RELO-NEXT: 00000027 R_POS .dwline
126 ; RELO-NEXT: 00000009 R_POS
127 ; RELO-NEXT: 0000003a R_POS
128 ; RELO: RELOCATION RECORDS FOR [.dwline]:
129 ; RELO-NEXT: OFFSET TYPE VALUE
130 ; RELO-NEXT: 00000000 R_POS
132 ; RELO64: RELOCATION RECORDS FOR [.dwinfo]:
133 ; RELO64-NEXT: OFFSET TYPE VALUE
134 ; RELO64-NEXT: 000000000000000e R_POS .dwabrev
135 ; RELO64-NEXT: 000000000000000b R_POS .dwline
136 ; RELO64-NEXT: 0000000000000041 R_POS
137 ; RELO64-NEXT: 000000000000004e R_POS
138 ; RELO64: RELOCATION RECORDS FOR [.dwline]:
139 ; RELO64-NEXT: OFFSET TYPE VALUE
140 ; RELO64-NEXT: 000000000000000c R_POS