1## Test that "llvm-objdump --traceback-table" decodes the ControlledStorageInfo, 2## AllocaRegister, and extension table of the traceback table. 3 4# RUN: yaml2obj %s -o %t.o 5# RUN: llvm-objdump -d --traceback-table --symbol-description %t.o | \ 6# RUN: FileCheck --match-full-lines --strict-whitespace %s 7 8## Show that --traceback-table implies --disassemble. 9# RUN: llvm-objdump --traceback-table --symbol-description %t.o | \ 10# RUN: FileCheck --match-full-lines --strict-whitespace %s 11 12--- !XCOFF 13FileHeader: 14 MagicNumber: 0x1DF 15Sections: 16 - Name: .text 17 Flags: [ STYP_TEXT ] 18 SectionData: "9421ffc0000000000000204080000201000000000000000400064164644e756d0000000093e1fffc0000000000002a6080c202072c90000000000004000000036f0000010000000a000001000003666f6f1f0203c000000000002000000000000000000000000000010000000000000100000000000000000000000000123400000000" 19Symbols: 20 - Name: .AddNum 21 Value: 0 22 Section: .text 23 Type: 0x20 24 StorageClass: C_EXT 25 AuxEntries: 26 - Type: AUX_CSECT 27 SectionOrLength: 0x24 28 SymbolAlignmentAndType: 0x21 29 StorageMappingClass: XMC_PR 30 - Name: .foo 31 Value: 0x24 32 Section: .text 33 Type: 0x20 34 StorageClass: C_EXT 35 AuxEntries: 36 - Type: AUX_CSECT 37 SectionOrLength: 0x5F 38 SymbolAlignmentAndType: 0x21 39 StorageMappingClass: XMC_PR 40 41## The above .text section data is generated using the compiler command: 42## xlc -o test.o -c test.c 43## We also modified the binary content of the traceback table in the object file to add vector information 44## for function "foo", including ControlledStorageInfo, AllocaRegister, and ExtensionTable. 45 46## test.c: 47## int AddNum(int i,intj) { 48## return i+j; 49## } 50 51## float foo(int i1,float f1,double d1,int i2, float f2) { 52## return i1+f1+d1+i2+f2; 53## } 54 55# CHECK:00000000 (idx: 0) .AddNum[PR]: 56# CHECK-NEXT: 0: 94 21 ff c0 stwu 1, -64(1) 57# CHECK-NEXT: 4: 00 00 00 00 # Traceback table start 58# CHECK-NEXT: 8: 00 # Version = 0 59# CHECK-NEXT: 9: 00 # Language = C 60# CHECK-NEXT: a: 20 # -isGlobalLinkage, -isOutOfLineEpilogOrPrologue 61# CHECK-NEXT: +hasTraceBackTableOffset, -isInternalProcedure 62# CHECK-NEXT: -hasControlledStorage, -isTOCless 63# CHECK-NEXT: -isFloatingPointPresent 64# CHECK-NEXT: -isFloatingPointOperationLogOrAbortEnabled 65# CHECK-NEXT: b: 40 # -isInterruptHandler, +isFuncNamePresent, -isAllocaUsed 66# CHECK-NEXT: OnConditionDirective = 0, -isCRSaved, -isLRSaved 67# CHECK-NEXT: c: 80 # +isBackChainStored, -isFixup, NumOfFPRsSaved = 0 68# CHECK-NEXT: d: 00 # -hasExtensionTable, -hasVectorInfo, NumOfGPRsSaved = 0 69# CHECK-NEXT: e: 02 # NumberOfFixedParms = 2 70# CHECK-NEXT: f: 01 # NumberOfFPParms = 0, +hasParmsOnStack 71# CHECK-NEXT: 10: 00 00 00 00 # ParmsType = i, i 72# CHECK-NEXT: 14: 00 00 00 04 # TraceBackTableOffset = 4 73# CHECK-NEXT: 18: 00 06 # FunctionNameLen = 6 74# CHECK-NEXT: 1a: 41 64 64 4e # FunctionName = AddNum 75# CHECK-NEXT: 1e: 75 6d 76# CHECK-NEXT: 20: 00 00 00 00 # Padding 77 78# CHECK:00000024 (idx: 2) .foo[PR]: 79# CHECK-NEXT: 24: 93 e1 ff fc stw 31, -4(1) 80# CHECK-NEXT: 28: 00 00 00 00 # Traceback table start 81# CHECK-NEXT: 2c: 00 # Version = 0 82# CHECK-NEXT: 2d: 00 # Language = C 83# CHECK-NEXT: 2e: 2a # -isGlobalLinkage, -isOutOfLineEpilogOrPrologue 84# CHECK-NEXT: +hasTraceBackTableOffset, -isInternalProcedure 85# CHECK-NEXT: +hasControlledStorage, -isTOCless 86# CHECK-NEXT: +isFloatingPointPresent 87# CHECK-NEXT: -isFloatingPointOperationLogOrAbortEnabled 88# CHECK-NEXT: 2f: 60 # -isInterruptHandler, +isFuncNamePresent, +isAllocaUsed 89# CHECK-NEXT: OnConditionDirective = 0, -isCRSaved, -isLRSaved 90# CHECK-NEXT: 30: 80 # +isBackChainStored, -isFixup, NumOfFPRsSaved = 0 91# CHECK-NEXT: 31: c2 # +hasExtensionTable, +hasVectorInfo, NumOfGPRsSaved = 2 92# CHECK-NEXT: 32: 02 # NumberOfFixedParms = 2 93# CHECK-NEXT: 33: 07 # NumberOfFPParms = 3, +hasParmsOnStack 94# CHECK-NEXT: 34: 2c 90 00 00 # ParmsType = i, f, d, i, f, v 95# CHECK-NEXT: 38: 00 00 00 04 # TraceBackTableOffset = 4 96# CHECK-NEXT: 3c: 00 00 00 03 # NumOfCtlAnchors = 3 97# CHECK-NEXT: 40: 6f 00 00 01 # ControlledStorageInfoDisp[0] = 1862270977 98# CHECK-NEXT: 44: 00 00 00 0a ControlledStorageInfoDisp[1] = 10 99# CHECK-NEXT: 48: 00 00 01 00 ControlledStorageInfoDisp[2] = 256 100# CHECK-NEXT: 4c: 00 03 # FunctionNameLen = 3 101# CHECK-NEXT: 4e: 66 6f 6f # FunctionName = foo 102# CHECK-NEXT: 51: 1f # AllocaRegister = 31 103# CHECK-NEXT: 52: 02 # NumberOfVRSaved = 0, +isVRSavedOnStack, -hasVarArgs 104# CHECK-NEXT: 53: 03 # NumberOfVectorParms = 1, +hasVMXInstruction 105# CHECK-NEXT: 54: c0 00 00 00 # VectorParmsInfoString = vf 106# CHECK-NEXT: 58: 00 00 # Padding 107# CHECK-NEXT: 5a: 20 # ExtensionTable = TB_SSP_CANARY 108# CHECK-NEXT: 5b: 00 # Padding 109# CHECK-NEXT: ... 110# CHECK-NEXT: 68: 01 00 00 00 111# CHECK-NEXT: 6c: 00 00 00 01 112# CHECK-NEXT: 70: 00 00 00 00 113# CHECK-NEXT: ... 114# CHECK-NEXT: 7c: 00 12 34 00 115# CHECK-NEXT: 80: 00 00 00 116