1 ; Testing 32-bit and 64-bit exception section entries, no exception auxilliary
2 ; entries should be produced as no debug information is specified.
3 ; RUN: llc -mtriple=powerpc-ibm-aix-xcoff -mcpu=ppc -filetype=obj -o %t_32.o < %s
4 ; RUN: llvm-readobj --exception-section %t_32.o | FileCheck %s --check-prefix=EXCEPT
5 ; RUN: llvm-readobj --section-headers %t_32.o | FileCheck %s --check-prefix=READ
6 ; RUN: llvm-readobj --syms %t_32.o | FileCheck %s --check-prefix=SYMS
8 ; RUN: llc -mtriple=powerpc64-unknown-aix -mcpu=ppc -filetype=obj -o %t_64.o < %s
9 ; RUN: llvm-readobj --exception-section %t_64.o | FileCheck %s --check-prefix=EXCEPT64
10 ; RUN: llvm-readobj --section-headers %t_64.o | FileCheck %s --check-prefix=READ64
11 ; RUN: llvm-readobj --syms %t_64.o | FileCheck %s --check-prefix=SYMS64
13 !1 = !{!"ppc-trap-reason", !"1", !"2"}
14 declare void @llvm.ppc.trap(i32 %a)
15 define dso_local void @sub_test() {
16 call void @llvm.ppc.trap(i32 1), !annotation !1
19 define dso_local void @test__trap_annotation(i32 %a) {
20 call void @llvm.ppc.trap(i32 %a), !annotation !1
22 call void @llvm.ppc.trap(i32 %a), !annotation !1
26 ; EXCEPT: Exception section {
27 ; EXCEPT-NEXT: Symbol: .sub_test
28 ; EXCEPT-NEXT: LangID: 0
29 ; EXCEPT-NEXT: Reason: 0
30 ; EXCEPT-NEXT: Trap Instr Addr: 0x4
31 ; EXCEPT-NEXT: LangID: 1
32 ; EXCEPT-NEXT: Reason: 2
33 ; EXCEPT-NEXT: Symbol: .test__trap_annotation
34 ; EXCEPT-NEXT: LangID: 0
35 ; EXCEPT-NEXT: Reason: 0
36 ; EXCEPT-NEXT: Trap Instr Addr: 0x3C
37 ; EXCEPT-NEXT: LangID: 1
38 ; EXCEPT-NEXT: Reason: 2
39 ; EXCEPT-NEXT: Trap Instr Addr: 0x44
40 ; EXCEPT-NEXT: LangID: 1
41 ; EXCEPT-NEXT: Reason: 2
44 ; There are multiple "Section {" lines in the readobj output so we need to start this READ check
45 ; on a unique line (Type: STYP_DATA (0x40)) so that the checks know where to start reading
46 ; READ: Type: STYP_DATA (0x40)
48 ; READ-NEXT: Section {
50 ; READ-NEXT: Name: .except
51 ; READ-NEXT: PhysicalAddress: 0x0
52 ; READ-NEXT: VirtualAddress: 0x0
53 ; READ-NEXT: Size: 0x1E
54 ; READ-NEXT: RawDataOffset: 0x12C
55 ; READ-NEXT: RelocationPointer: 0x0
56 ; READ-NEXT: LineNumberPointer: 0x0
57 ; READ-NEXT: NumberOfRelocations: 0
58 ; READ-NEXT: NumberOfLineNumbers: 0
59 ; READ-NEXT: Type: STYP_EXCEPT (0x100)
63 ; SYMS: Index: [[#IND:]]{{.*}}{{[[:space:]] *}}Name: .sub_test
64 ; SYMS-NEXT: Value (RelocatableAddress): 0x0
65 ; SYMS-NEXT: Section: .text
66 ; SYMS-NEXT: Type: 0x20
67 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
68 ; SYMS-NEXT: NumberOfAuxEntries: 2
69 ; SYMS-NEXT: Function Auxiliary Entry {
70 ; SYMS-NEXT: Index: [[#IND+1]]
71 ; SYMS-NEXT: OffsetToExceptionTable: 0x12C
72 ; SYMS-NEXT: SizeOfFunction: 0xC
73 ; SYMS-NEXT: PointerToLineNum: 0x0
74 ; SYMS-NEXT: SymbolIndexOfNextBeyond: [[#IND+3]]
76 ; SYMS-NEXT: CSECT Auxiliary Entry {
77 ; SYMS-NEXT: Index: [[#IND+2]]
78 ; SYMS-NEXT: ContainingCsectSymbolIndex: [[#IND-2]]
79 ; SYMS-NEXT: ParameterHashIndex: 0x0
80 ; SYMS-NEXT: TypeChkSectNum: 0x0
81 ; SYMS-NEXT: SymbolAlignmentLog2: 0
82 ; SYMS-NEXT: SymbolType: XTY_LD (0x2)
83 ; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0)
84 ; SYMS-NEXT: StabInfoIndex: 0x0
85 ; SYMS-NEXT: StabSectNum: 0x0
89 ; SYMS-NEXT: Index: [[#IND+3]]
90 ; SYMS-NEXT: Name: .test__trap_annotation
91 ; SYMS-NEXT: Value (RelocatableAddress): 0x28
92 ; SYMS-NEXT: Section: .text
93 ; SYMS-NEXT: Type: 0x20
94 ; SYMS-NEXT: StorageClass: C_EXT (0x2)
95 ; SYMS-NEXT: NumberOfAuxEntries: 2
96 ; SYMS-NEXT: Function Auxiliary Entry {
97 ; SYMS-NEXT: Index: [[#IND+4]]
98 ; SYMS-NEXT: OffsetToExceptionTable: 0x138
99 ; SYMS-NEXT: SizeOfFunction: 0x34
100 ; SYMS-NEXT: PointerToLineNum: 0x0
101 ; SYMS-NEXT: SymbolIndexOfNextBeyond: [[#IND+6]]
103 ; SYMS-NEXT: CSECT Auxiliary Entry {
104 ; SYMS-NEXT: Index: [[#IND+5]]
105 ; SYMS-NEXT: ContainingCsectSymbolIndex: [[#IND-2]]
106 ; SYMS-NEXT: ParameterHashIndex: 0x0
107 ; SYMS-NEXT: TypeChkSectNum: 0x0
108 ; SYMS-NEXT: SymbolAlignmentLog2: 0
109 ; SYMS-NEXT: SymbolType: XTY_LD (0x2)
110 ; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0)
111 ; SYMS-NEXT: StabInfoIndex: 0x0
112 ; SYMS-NEXT: StabSectNum: 0x0
116 ; EXCEPT64: Exception section {
117 ; EXCEPT64-NEXT: Symbol: .sub_test
118 ; EXCEPT64-NEXT: LangID: 0
119 ; EXCEPT64-NEXT: Reason: 0
120 ; EXCEPT64-NEXT: Trap Instr Addr: 0x4
121 ; EXCEPT64-NEXT: LangID: 1
122 ; EXCEPT64-NEXT: Reason: 2
123 ; EXCEPT64-NEXT: Symbol: .test__trap_annotation
124 ; EXCEPT64-NEXT: LangID: 0
125 ; EXCEPT64-NEXT: Reason: 0
126 ; EXCEPT64-NEXT: Trap Instr Addr: 0x3C
127 ; EXCEPT64-NEXT: LangID: 1
128 ; EXCEPT64-NEXT: Reason: 2
129 ; EXCEPT64-NEXT: Trap Instr Addr: 0x44
130 ; EXCEPT64-NEXT: LangID: 1
131 ; EXCEPT64-NEXT: Reason: 2
134 ; READ64: Type: STYP_DATA (0x40)
136 ; READ64-NEXT: Section {
137 ; READ64-NEXT: Index: 3
138 ; READ64-NEXT: Name: .except
139 ; READ64-NEXT: PhysicalAddress: 0x0
140 ; READ64-NEXT: VirtualAddress: 0x0
141 ; READ64-NEXT: Size: 0x32
142 ; READ64-NEXT: RawDataOffset: 0x1A8
143 ; READ64-NEXT: RelocationPointer: 0x0
144 ; READ64-NEXT: LineNumberPointer: 0x0
145 ; READ64-NEXT: NumberOfRelocations: 0
146 ; READ64-NEXT: NumberOfLineNumbers: 0
147 ; READ64-NEXT: Type: STYP_EXCEPT (0x100)
151 ; SYMS64: Index: [[#IND:]]{{.*}}{{[[:space:]] *}}Name: .sub_test
152 ; SYMS64-NEXT: Value (RelocatableAddress): 0x0
153 ; SYMS64-NEXT: Section: .text
154 ; SYMS64-NEXT: Type: 0x0
155 ; SYMS64-NEXT: StorageClass: C_EXT (0x2)
156 ; SYMS64-NEXT: NumberOfAuxEntries: 2
157 ; SYMS64-NEXT: Function Auxiliary Entry {
158 ; SYMS64-NEXT: Index: [[#IND+1]]
159 ; SYMS64-NEXT: SizeOfFunction: 0x18
160 ; SYMS64-NEXT: PointerToLineNum: 0x0
161 ; SYMS64-NEXT: SymbolIndexOfNextBeyond: [[#IND+3]]
162 ; SYMS64-NEXT: Auxiliary Type: AUX_FCN (0xFE)
164 ; SYMS64-NEXT: CSECT Auxiliary Entry {
165 ; SYMS64-NEXT: Index: [[#IND+2]]
166 ; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#IND-2]]
167 ; SYMS64-NEXT: ParameterHashIndex: 0x0
168 ; SYMS64-NEXT: TypeChkSectNum: 0x0
169 ; SYMS64-NEXT: SymbolAlignmentLog2: 0
170 ; SYMS64-NEXT: SymbolType: XTY_LD (0x2)
171 ; SYMS64-NEXT: StorageMappingClass: XMC_PR (0x0)
172 ; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
175 ; SYMS64-NEXT: Symbol {
176 ; SYMS64-NEXT: Index: [[#IND+3]]
177 ; SYMS64-NEXT: Name: .test__trap_annotation
178 ; SYMS64-NEXT: Value (RelocatableAddress): 0x28
179 ; SYMS64-NEXT: Section: .text
180 ; SYMS64-NEXT: Type: 0x0
181 ; SYMS64-NEXT: StorageClass: C_EXT (0x2)
182 ; SYMS64-NEXT: NumberOfAuxEntries: 2
183 ; SYMS64-NEXT: Function Auxiliary Entry {
184 ; SYMS64-NEXT: Index: [[#IND+4]]
185 ; SYMS64-NEXT: SizeOfFunction: 0x68
186 ; SYMS64-NEXT: PointerToLineNum: 0x0
187 ; SYMS64-NEXT: SymbolIndexOfNextBeyond: [[#IND+6]]
188 ; SYMS64-NEXT: Auxiliary Type: AUX_FCN (0xFE)
190 ; SYMS64-NEXT: CSECT Auxiliary Entry {
191 ; SYMS64-NEXT: Index: [[#IND+5]]
192 ; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#IND-2]]
193 ; SYMS64-NEXT: ParameterHashIndex: 0x0
194 ; SYMS64-NEXT: TypeChkSectNum: 0x0
195 ; SYMS64-NEXT: SymbolAlignmentLog2: 0
196 ; SYMS64-NEXT: SymbolType: XTY_LD (0x2)
197 ; SYMS64-NEXT: StorageMappingClass: XMC_PR (0x0)
198 ; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)