1 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -filetype=obj -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s -o %t32.o
5 ; RUN: llvm-readobj %t32.o --syms --relocs | FileCheck %s -D#NFA=2 --check-prefix=OBJ32
6 ; RUN: llc -filetype=obj -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs < %s -o %t64.o
7 ; RUN: llvm-readobj %t64.o --syms --relocs | FileCheck %s -D#NFA=2 --check-prefix=OBJ64
9 @i = external global i32, align 4 #0
11 ; Function Attrs: noinline nounwind optnone
17 attributes #0 = { "toc-data" }
19 ; CHECK: la 3, i[TD](2)
21 ; CHECK-NEXT: .extern i[TD]
23 ; OBJ32: Relocations [
24 ; OBJ32-NEXT: Section (index: 1) .text {
25 ; OBJ32-NEXT: 0x2 R_TOC i([[#NFA+1]]) 0xF
27 ; OBJ32-NEXT: Section (index: 2) .data {
28 ; OBJ32-NEXT: 0x20 R_POS .get([[#NFA+5]]) 0x1F
29 ; OBJ32-NEXT: 0x24 R_POS TOC([[#NFA+9]]) 0x1F
34 ; OBJ32: Index: [[#NFA+1]]
36 ; OBJ32-NEXT: Value (RelocatableAddress): 0x0
37 ; OBJ32-NEXT: Section: N_UNDEF
38 ; OBJ32-NEXT: Type: 0x0
39 ; OBJ32-NEXT: StorageClass: C_EXT (0x2)
40 ; OBJ32-NEXT: NumberOfAuxEntries: 1
41 ; OBJ32-NEXT: CSECT Auxiliary Entry {
42 ; OBJ32-NEXT: Index: [[#NFA+2]]
43 ; OBJ32-NEXT: SectionLen: 0
44 ; OBJ32-NEXT: ParameterHashIndex: 0x0
45 ; OBJ32-NEXT: TypeChkSectNum: 0x0
46 ; OBJ32-NEXT: SymbolAlignmentLog2: 0
47 ; OBJ32-NEXT: SymbolType: XTY_ER (0x0)
48 ; OBJ32-NEXT: StorageMappingClass: XMC_TD (0x10)
49 ; OBJ32-NEXT: StabInfoIndex: 0x0
50 ; OBJ32-NEXT: StabSectNum: 0x0
54 ; OBJ32: Index: [[#NFA+9]]
55 ; OBJ32-NEXT: Name: TOC
56 ; OBJ32-NEXT: Value (RelocatableAddress): 0x2C
57 ; OBJ32-NEXT: Section: .data
58 ; OBJ32-NEXT: Type: 0x0
59 ; OBJ32-NEXT: StorageClass: C_HIDEXT (0x6B)
60 ; OBJ32-NEXT: NumberOfAuxEntries: 1
61 ; OBJ32-NEXT: CSECT Auxiliary Entry {
62 ; OBJ32-NEXT: Index: [[#NFA+10]]
63 ; OBJ32-NEXT: SectionLen: 0
64 ; OBJ32-NEXT: ParameterHashIndex: 0x0
65 ; OBJ32-NEXT: TypeChkSectNum: 0x0
66 ; OBJ32-NEXT: SymbolAlignmentLog2: 2
67 ; OBJ32-NEXT: SymbolType: XTY_SD (0x1)
68 ; OBJ32-NEXT: StorageMappingClass: XMC_TC0 (0xF)
69 ; OBJ32-NEXT: StabInfoIndex: 0x0
70 ; OBJ32-NEXT: StabSectNum: 0x0
74 ; OBJ64: Relocations [
75 ; OBJ64-NEXT: Section (index: 1) .text {
76 ; OBJ64-NEXT: 0x2 R_TOC i([[#NFA+1]]) 0xF
78 ; OBJ64-NEXT: Section (index: 2) .data {
79 ; OBJ64-NEXT: 0x20 R_POS .get([[#NFA+5]]) 0x3F
80 ; OBJ64-NEXT: 0x28 R_POS TOC([[#NFA+9]]) 0x3F
85 ; OBJ64: Index: [[#NFA+1]]
87 ; OBJ64-NEXT: Value (RelocatableAddress): 0x0
88 ; OBJ64-NEXT: Section: N_UNDEF
89 ; OBJ64-NEXT: Type: 0x0
90 ; OBJ64-NEXT: StorageClass: C_EXT (0x2)
91 ; OBJ64-NEXT: NumberOfAuxEntries: 1
92 ; OBJ64-NEXT: CSECT Auxiliary Entry {
93 ; OBJ64-NEXT: Index: [[#NFA+2]]
94 ; OBJ64-NEXT: SectionLen: 0
95 ; OBJ64-NEXT: ParameterHashIndex: 0x0
96 ; OBJ64-NEXT: TypeChkSectNum: 0x0
97 ; OBJ64-NEXT: SymbolAlignmentLog2: 0
98 ; OBJ64-NEXT: SymbolType: XTY_ER (0x0)
99 ; OBJ64-NEXT: StorageMappingClass: XMC_TD (0x10)
100 ; OBJ64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)
104 ; OBJ64: Index: [[#NFA+9]]
105 ; OBJ64-NEXT: Name: TOC
106 ; OBJ64-NEXT: Value (RelocatableAddress): 0x38
107 ; OBJ64-NEXT: Section: .data
108 ; OBJ64-NEXT: Type: 0x0
109 ; OBJ64-NEXT: StorageClass: C_HIDEXT (0x6B)
110 ; OBJ64-NEXT: NumberOfAuxEntries: 1
111 ; OBJ64-NEXT: CSECT Auxiliary Entry {
112 ; OBJ64-NEXT: Index: [[#NFA+10]]
113 ; OBJ64-NEXT: SectionLen: 0
114 ; OBJ64-NEXT: ParameterHashIndex: 0x0
115 ; OBJ64-NEXT: TypeChkSectNum: 0x0
116 ; OBJ64-NEXT: SymbolAlignmentLog2: 2
117 ; OBJ64-NEXT: SymbolType: XTY_SD (0x1)
118 ; OBJ64-NEXT: StorageMappingClass: XMC_TC0 (0xF)
119 ; OBJ64-NEXT: Auxiliary Type: AUX_CSECT (0xFB)