1 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
2 ; RUN: -mattr=+altivec -vec-extabi -xcoff-traceback-table=true < %s | \
3 ; RUN: FileCheck --check-prefixes=CHECK-ASM,COMMON %s
5 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -function-sections \
6 ; RUN: -mcpu=pwr4 -mattr=+altivec -vec-extabi < %s | \
7 ; RUN: FileCheck --check-prefixes=CHECK-FUNC,COMMON %s
9 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
10 ; RUN: -mattr=+altivec -vec-extabi -xcoff-traceback-table=true -filetype=obj -o %t.o < %s
11 ; RUN: llvm-objdump -d --traceback-table --symbol-description %t.o | \
12 ; RUN: FileCheck --match-full-lines --strict-whitespace --check-prefixes=OBJ-DIS,NO-FUNC-SEC %s
14 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
15 ; RUN: -mattr=+altivec -vec-extabi -xcoff-traceback-table=true -function-sections -filetype=obj -o %t_func.o < %s
16 ; RUN: llvm-objdump -d --traceback-table --symbol-description %t_func.o | \
17 ; RUN: FileCheck --match-full-lines --strict-whitespace --check-prefixes=OBJ-DIS,FUNC-SEC %s
19 define float @bar() #0 {
21 %fvalue = alloca float, align 4
22 %taken = alloca i32, align 4
23 %data = alloca i32, align 4
24 store float 1.000000e+00, ptr %fvalue, align 4
25 %0 = load float, ptr %fvalue, align 4
26 %1 = call float asm "fneg $0,$1\0A\09", "=b,b,~{f31},~{f30},~{f29},~{f28},~{f27}"(float %0)
27 store float %1, ptr %fvalue, align 4
28 store i32 123, ptr %data, align 4
29 %2 = load i32, ptr %data, align 4
30 %3 = call i32 asm "cntlzw $0, $1\0A\09", "=b,b,~{r31},~{r30},~{r29},~{r28}"(i32 %2)
31 store i32 %3, ptr %taken, align 4
32 %4 = load i32, ptr %taken, align 4
33 %conv = sitofp i32 %4 to float
34 %5 = load float, ptr %fvalue, align 4
35 %add = fadd float %conv, %5
39 define <4 x i32> @foov() #0 {
41 %taken = alloca <4 x i32>, align 16
42 %data = alloca <4 x i32>, align 16
43 store <4 x i32> <i32 123, i32 0, i32 0, i32 0>, ptr %data, align 16
44 call void asm sideeffect "", "~{v31},~{v30},~{v29},~{v28}"()
45 %0 = load <4 x i32>, ptr %taken, align 16
49 ; COMMON: .vbyte 4, 0x00000000 # Traceback table begin
50 ; COMMON-NEXT: .byte 0x00 # Version = 0
51 ; COMMON-NEXT: .byte 0x09 # Language = CPlusPlus
52 ; COMMON-NEXT: .byte 0x22 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
53 ; COMMON-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
54 ; COMMON-NEXT: # -HasControlledStorage, -IsTOCless
55 ; COMMON-NEXT: # +IsFloatingPointPresent
56 ; COMMON-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
57 ; COMMON-NEXT: .byte 0x40 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
58 ; COMMON-NEXT: # OnConditionDirective = 0, -IsCRSaved, -IsLRSaved
59 ; COMMON-NEXT: .byte 0x05 # -IsBackChainStored, -IsFixup, NumOfFPRsSaved = 5
60 ; COMMON-NEXT: .byte 0x04 # -HasExtensionTable, -HasVectorInfo, NumOfGPRsSaved = 4
61 ; COMMON-NEXT: .byte 0x00 # NumberOfFixedParms = 0
62 ; COMMON-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
63 ; CHECK-ASM-NEXT: .vbyte 4, L..bar0-.bar # Function size
64 ; CHECK-FUNC-NEXT: .vbyte 4, L..bar0-.bar[PR] # Function size
65 ; COMMON-NEXT: .vbyte 2, 0x0003 # Function name len = 3
66 ; COMMON-NEXT: .byte "bar" # Function Name
67 ; COMMON-NEXT: # -- End function
70 ; COMMON-NEXT: .vbyte 4, 0x00000000 # Traceback table begin
71 ; COMMON-NEXT: .byte 0x00 # Version = 0
72 ; COMMON-NEXT: .byte 0x09 # Language = CPlusPlus
73 ; COMMON-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
74 ; COMMON-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
75 ; COMMON-NEXT: # -HasControlledStorage, -IsTOCless
76 ; COMMON-NEXT: # -IsFloatingPointPresent
77 ; COMMON-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
78 ; COMMON-NEXT: .byte 0x40 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
79 ; COMMON-NEXT: # OnConditionDirective = 0, -IsCRSaved, -IsLRSaved
80 ; COMMON-NEXT: .byte 0x00 # -IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0
81 ; COMMON-NEXT: .byte 0xc0 # +HasExtensionTable, +HasVectorInfo, NumOfGPRsSaved = 0
82 ; COMMON-NEXT: .byte 0x00 # NumberOfFixedParms = 0
83 ; COMMON-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
84 ; CHECK-ASM-NEXT: .vbyte 4, L..foov0-.foov # Function size
85 ; CHECK-FUNC-NEXT: .vbyte 4, L..foov0-.foov[PR] # Function size
86 ; COMMON-NEXT: .vbyte 2, 0x0004 # Function name len = 4
87 ; COMMON-NEXT: .byte "foov" # Function Name
88 ; COMMON-NEXT: .byte 0x12 # NumOfVRsSaved = 4, +IsVRSavedOnStack, -HasVarArgs
89 ; COMMON-NEXT: .byte 0x01 # NumOfVectorParams = 0, +HasVMXInstruction
90 ; COMMON-NEXT: .vbyte 4, 0x00000000 # Vector Parameter type =
91 ; COMMON-NEXT: .vbyte 2, 0x0000 # Padding
92 ; COMMON-NEXT: .byte 0x08 # ExtensionTableFlag = TB_EH_INFO
93 ; COMMON-NEXT: .align 2
94 ; COMMON-NEXT: .vbyte 4, L..C2-TOC[TC0] # EHInfo Table
96 ; COMMON: .csect .eh_info_table[RW],2
97 ; COMMON-NEXT:__ehinfo.1:
98 ; COMMON-NEXT: .vbyte 4, 0
99 ; COMMON-NEXT: .align 2
100 ; COMMON-NEXT: .vbyte 4, 0
101 ; COMMON-NEXT: .vbyte 4, 0
102 ; CHECK-ASM-NEXT: .csect [PR],5
103 ; CHECK-FUNC-NEXT: .csect .foov[PR],5
104 ; COMMON-NEXT: # -- End function
107 ; COMMON-NEXT: .tc __ehinfo.1[TC],__ehinfo.1
110 ; OBJ-DIS: 9c: 00 00 00 00 # Traceback table start
111 ; OBJ-DIS-NEXT: a0: 00 # Version = 0
112 ; OBJ-DIS-NEXT: a1: 09 # Language = CPlusPlus
113 ; OBJ-DIS-NEXT: a2: 22 # -isGlobalLinkage, -isOutOfLineEpilogOrPrologue
114 ; OBJ-DIS-NEXT: +hasTraceBackTableOffset, -isInternalProcedure
115 ; OBJ-DIS-NEXT: -hasControlledStorage, -isTOCless
116 ; OBJ-DIS-NEXT: +isFloatingPointPresent
117 ; OBJ-DIS-NEXT: -isFloatingPointOperationLogOrAbortEnabled
118 ; OBJ-DIS-NEXT: a3: 40 # -isInterruptHandler, +isFuncNamePresent, -isAllocaUsed
119 ; OBJ-DIS-NEXT: OnConditionDirective = 0, -isCRSaved, -isLRSaved
120 ; OBJ-DIS-NEXT: a4: 05 # -isBackChainStored, -isFixup, NumOfFPRsSaved = 5
121 ; OBJ-DIS-NEXT: a5: 04 # -hasExtensionTable, -hasVectorInfo, NumOfGPRsSaved = 4
122 ; OBJ-DIS-NEXT: a6: 00 # NumberOfFixedParms = 0
123 ; OBJ-DIS-NEXT: a7: 01 # NumberOfFPParms = 0, +hasParmsOnStack
124 ; OBJ-DIS-NEXT: a8: 00 00 00 9c # TraceBackTableOffset = 156
125 ; OBJ-DIS-NEXT: ac: 00 03 # FunctionNameLen = 3
126 ; OBJ-DIS-NEXT: ae: 62 61 72 # FunctionName = bar
127 ; NO-FUNC-SEC-NEXT: b1: 60 00 00 # Padding
128 ; NO-FUNC-SEC-NEXT: b4: 00 60 00 00
129 ; NO-FUNC-SEC-NEXT: b8: 00 60 00 00
130 ; NO-FUNC-SEC-NEXT: bc: 00 00 00 00
131 ; FUNC-SEC-NEXT: b1: 00 00 00 # Padding
134 ; OBJ-DIS: 11c: 00 00 00 00 # Traceback table start
135 ; OBJ-DIS-NEXT: 120: 00 # Version = 0
136 ; OBJ-DIS-NEXT: 121: 09 # Language = CPlusPlus
137 ; OBJ-DIS-NEXT: 122: 20 # -isGlobalLinkage, -isOutOfLineEpilogOrPrologue
138 ; OBJ-DIS-NEXT: +hasTraceBackTableOffset, -isInternalProcedure
139 ; OBJ-DIS-NEXT: -hasControlledStorage, -isTOCless
140 ; OBJ-DIS-NEXT: -isFloatingPointPresent
141 ; OBJ-DIS-NEXT: -isFloatingPointOperationLogOrAbortEnabled
142 ; OBJ-DIS-NEXT: 123: 40 # -isInterruptHandler, +isFuncNamePresent, -isAllocaUsed
143 ; OBJ-DIS-NEXT: OnConditionDirective = 0, -isCRSaved, -isLRSaved
144 ; OBJ-DIS-NEXT: 124: 00 # -isBackChainStored, -isFixup, NumOfFPRsSaved = 0
145 ; OBJ-DIS-NEXT: 125: c0 # +hasExtensionTable, +hasVectorInfo, NumOfGPRsSaved = 0
146 ; OBJ-DIS-NEXT: 126: 00 # NumberOfFixedParms = 0
147 ; OBJ-DIS-NEXT: 127: 01 # NumberOfFPParms = 0, +hasParmsOnStack
148 ; OBJ-DIS-NEXT: 128: 00 00 00 5c # TraceBackTableOffset = 92
149 ; OBJ-DIS-NEXT: 12c: 00 04 # FunctionNameLen = 4
150 ; OBJ-DIS-NEXT: 12e: 66 6f 6f 76 # FunctionName = foov
151 ; OBJ-DIS-NEXT: 132: 12 # NumberOfVRSaved = 4, +isVRSavedOnStack, -hasVarArgs
152 ; OBJ-DIS-NEXT: 133: 01 # NumberOfVectorParms = 0, +hasVMXInstruction
153 ; OBJ-DIS-NEXT: 134: 00 00 00 00 # VectorParmsInfoString =
154 ; OBJ-DIS-NEXT: 138: 00 00 # Padding
155 ; OBJ-DIS-NEXT: 13a: 08 # ExtensionTable = TB_EH_INFO
156 ; OBJ-DIS-NEXT: 13b: 00 # Alignment padding for eh info displacement
157 ; OBJ-DIS-NEXT: 13c: 00 00 00 08 # EH info displacement