1
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-prefix=SEC
4; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
5; RUN: llvm-objdump -r %t.o | FileCheck %s --check-prefix=RELO
6
7; This file is copied from test/DebugInfo/XCOFF/empty.ll.
8; In this test, we focus on XCOFF related formats, like section headers,
9; relocation entries.
10
11source_filename = "1.c"
12target datalayout = "E-m:a-p:32:32-i64:64-n32"
13
14; Function Attrs: noinline nounwind optnone
15define i32 @main() #0 !dbg !8 {
16entry:
17  %retval = alloca i32, align 4
18  store i32 0, i32* %retval, align 4
19  ret i32 0, !dbg !12
20}
21
22!llvm.dbg.cu = !{!0}
23!llvm.module.flags = !{!3, !4, !5, !6}
24!llvm.ident = !{!7}
25
26!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)
27!1 = !DIFile(filename: "1.c", directory: "debug")
28!2 = !{}
29!3 = !{i32 7, !"Dwarf Version", i32 4}
30!4 = !{i32 2, !"Debug Info Version", i32 3}
31!5 = !{i32 1, !"wchar_size", i32 2}
32!6 = !{i32 7, !"PIC Level", i32 2}
33!7 = !{!"clang version 12.0.0"}
34!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
35!9 = !DISubroutineType(types: !10)
36!10 = !{!11}
37!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
38!12 = !DILocation(line: 3, column: 3, scope: !8)
39
40; SEC:       AddressSize: 32bit
41; SEC-NEXT:  Sections [
42; SEC-NEXT:    Section {
43; SEC-NEXT:      Index: 1
44; SEC-NEXT:      Name: .text
45; SEC-NEXT:      PhysicalAddress: 0x0
46; SEC-NEXT:      VirtualAddress: 0x0
47; SEC-NEXT:      Size: 0x28
48; SEC-NEXT:      RawDataOffset: 0xDC
49; SEC-NEXT:      RelocationPointer: 0x0
50; SEC-NEXT:      LineNumberPointer: 0x0
51; SEC-NEXT:      NumberOfRelocations: 0
52; SEC-NEXT:      NumberOfLineNumbers: 0
53; SEC-NEXT:      Type: STYP_TEXT (0x20)
54; SEC-NEXT:    }
55; SEC-NEXT:    Section {
56; SEC-NEXT:      Index: 2
57; SEC-NEXT:      Name: .data
58; SEC-NEXT:      PhysicalAddress: 0x28
59; SEC-NEXT:      VirtualAddress: 0x28
60; SEC-NEXT:      Size: 0xC
61; SEC-NEXT:      RawDataOffset: 0x104
62; SEC-NEXT:      RelocationPointer: 0x1D8
63; SEC-NEXT:      LineNumberPointer: 0x0
64; SEC-NEXT:      NumberOfRelocations: 2
65; SEC-NEXT:      NumberOfLineNumbers: 0
66; SEC-NEXT:      Type: STYP_DATA (0x40)
67; SEC-NEXT:    }
68; SEC-NEXT:    Section {
69; SEC-NEXT:      Index: 3
70; SEC-NEXT:      Name: .dwabrev
71; SEC-NEXT:      PhysicalAddress: 0x0
72; SEC-NEXT:      VirtualAddress: 0x0
73; SEC-NEXT:      Size: 0x36
74; SEC-NEXT:      RawDataOffset: 0x110
75; SEC-NEXT:      RelocationPointer: 0x0
76; SEC-NEXT:      LineNumberPointer: 0x0
77; SEC-NEXT:      NumberOfRelocations: 0
78; SEC-NEXT:      NumberOfLineNumbers: 0
79; SEC-NEXT:      Type: STYP_DWARF (0x10)
80; SEC-NEXT:    }
81; SEC-NEXT:    Section {
82; SEC-NEXT:      Index: 4
83; SEC-NEXT:      Name: .dwinfo
84; SEC-NEXT:      PhysicalAddress: 0x0
85; SEC-NEXT:      VirtualAddress: 0x0
86; SEC-NEXT:      Size: 0x57
87; SEC-NEXT:      RawDataOffset: 0x148
88; SEC-NEXT:      RelocationPointer: 0x1EC
89; SEC-NEXT:      LineNumberPointer: 0x0
90; SEC-NEXT:      NumberOfRelocations: 4
91; SEC-NEXT:      NumberOfLineNumbers: 0
92; SEC-NEXT:      Type: STYP_DWARF (0x10)
93; SEC-NEXT:    }
94; SEC-NEXT:    Section {
95; SEC-NEXT:      Index: 5
96; SEC-NEXT:      Name: .dwline
97; SEC-NEXT:      PhysicalAddress: 0x0
98; SEC-NEXT:      VirtualAddress: 0x0
99; SEC-NEXT:      Size: 0x36
100; SEC-NEXT:      RawDataOffset: 0x1A0
101; SEC-NEXT:      RelocationPointer: 0x214
102; SEC-NEXT:      LineNumberPointer: 0x0
103; SEC-NEXT:      NumberOfRelocations: 1
104; SEC-NEXT:      NumberOfLineNumbers: 0
105; SEC-NEXT:      Type: STYP_DWARF (0x10)
106; SEC-NEXT:    }
107; SEC-NEXT:  ]
108
109; RELO:      RELOCATION RECORDS FOR [.dwinfo]:
110; RELO-NEXT:  OFFSET   TYPE                     VALUE
111; RELO-NEXT:  00000006 R_POS                    .dwabrev
112; RELO-NEXT:  00000027 R_POS                    .dwline
113; RELO-NEXT:  00000009 R_POS                    .text
114; RELO-NEXT:  0000003a R_POS                    .text
115; RELO:       RELOCATION RECORDS FOR [.dwline]:
116; RELO-NEXT:  OFFSET   TYPE                     VALUE
117; RELO-NEXT:  00000000 R_POS                    .text
118