brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.7 KiB · 96cac6b Raw
116 lines · plain
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.o5# RUN: llvm-objdump -d --traceback-table --symbol-description %t.o | \6# RUN:   FileCheck --match-full-lines --strict-whitespace %s7 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 %s11 12--- !XCOFF13FileHeader:14  MagicNumber:       0x1DF15Sections:16  - Name:            .text17    Flags:           [ STYP_TEXT ]18    SectionData:     "9421ffc0000000000000204080000201000000000000000400064164644e756d0000000093e1fffc0000000000002a6080c202072c90000000000004000000036f0000010000000a000001000003666f6f1f0203c000000000002000000000000000000000000000010000000000000100000000000000000000000000123400000000"19Symbols:20  - Name:            .AddNum21    Value:           022    Section:         .text23    Type:            0x2024    StorageClass:    C_EXT25    AuxEntries:26      - Type:                   AUX_CSECT27        SectionOrLength:        0x2428        SymbolAlignmentAndType: 0x2129        StorageMappingClass:    XMC_PR30  - Name:            .foo31    Value:           0x2432    Section:         .text33    Type:            0x2034    StorageClass:    C_EXT35    AuxEntries:36      - Type:                   AUX_CSECT37        SectionOrLength:        0x5F38        SymbolAlignmentAndType: 0x2139        StorageMappingClass:    XMC_PR40 41## The above .text section data is generated using the compiler command:42##   xlc -o test.o -c test.c43## We also modified the binary content of the traceback table in the object file to add vector information44## 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 start58# CHECK-NEXT:       8: 00           	# Version = 059# CHECK-NEXT:       9: 00           	# Language = C60# CHECK-NEXT:       a: 20           	# -isGlobalLinkage, -isOutOfLineEpilogOrPrologue61# CHECK-NEXT:                       	  +hasTraceBackTableOffset, -isInternalProcedure62# CHECK-NEXT:                       	  -hasControlledStorage, -isTOCless63# CHECK-NEXT:                       	  -isFloatingPointPresent64# CHECK-NEXT:                       	  -isFloatingPointOperationLogOrAbortEnabled65# CHECK-NEXT:       b: 40           	# -isInterruptHandler, +isFuncNamePresent, -isAllocaUsed66# CHECK-NEXT:                       	  OnConditionDirective = 0, -isCRSaved, -isLRSaved67# CHECK-NEXT:       c: 80           	# +isBackChainStored, -isFixup, NumOfFPRsSaved = 068# CHECK-NEXT:       d: 00           	# -hasExtensionTable, -hasVectorInfo, NumOfGPRsSaved = 069# CHECK-NEXT:       e: 02           	# NumberOfFixedParms = 270# CHECK-NEXT:       f: 01           	# NumberOfFPParms = 0, +hasParmsOnStack71# CHECK-NEXT:      10: 00 00 00 00  	# ParmsType = i, i72# CHECK-NEXT:      14: 00 00 00 04  	# TraceBackTableOffset = 473# CHECK-NEXT:      18: 00 06        	# FunctionNameLen = 674# CHECK-NEXT:      1a: 41 64 64 4e  	# FunctionName = AddNum75# CHECK-NEXT:      1e: 75 6d        76# CHECK-NEXT:      20: 00 00 00 00  	# Padding77 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 start81# CHECK-NEXT:      2c: 00           	# Version = 082# CHECK-NEXT:      2d: 00           	# Language = C83# CHECK-NEXT:      2e: 2a           	# -isGlobalLinkage, -isOutOfLineEpilogOrPrologue84# CHECK-NEXT:                       	  +hasTraceBackTableOffset, -isInternalProcedure85# CHECK-NEXT:                       	  +hasControlledStorage, -isTOCless86# CHECK-NEXT:                       	  +isFloatingPointPresent87# CHECK-NEXT:                       	  -isFloatingPointOperationLogOrAbortEnabled88# CHECK-NEXT:      2f: 60           	# -isInterruptHandler, +isFuncNamePresent, +isAllocaUsed89# CHECK-NEXT:                       	  OnConditionDirective = 0, -isCRSaved, -isLRSaved90# CHECK-NEXT:      30: 80           	# +isBackChainStored, -isFixup, NumOfFPRsSaved = 091# CHECK-NEXT:      31: c2           	# +hasExtensionTable, +hasVectorInfo, NumOfGPRsSaved = 292# CHECK-NEXT:      32: 02           	# NumberOfFixedParms = 293# CHECK-NEXT:      33: 07           	# NumberOfFPParms = 3, +hasParmsOnStack94# CHECK-NEXT:      34: 2c 90 00 00  	# ParmsType = i, f, d, i, f, v95# CHECK-NEXT:      38: 00 00 00 04  	# TraceBackTableOffset = 496# CHECK-NEXT:      3c: 00 00 00 03  	# NumOfCtlAnchors = 397# CHECK-NEXT:      40: 6f 00 00 01  	# ControlledStorageInfoDisp[0] = 186227097798# CHECK-NEXT:      44: 00 00 00 0a  	  ControlledStorageInfoDisp[1] = 1099# CHECK-NEXT:      48: 00 00 01 00  	  ControlledStorageInfoDisp[2] = 256100# CHECK-NEXT:      4c: 00 03        	# FunctionNameLen = 3101# CHECK-NEXT:      4e: 66 6f 6f     	# FunctionName = foo102# CHECK-NEXT:      51: 1f           	# AllocaRegister = 31103# CHECK-NEXT:      52: 02           	# NumberOfVRSaved = 0, +isVRSavedOnStack, -hasVarArgs104# CHECK-NEXT:      53: 03           	# NumberOfVectorParms = 1, +hasVMXInstruction105# CHECK-NEXT:      54: c0 00 00 00  	# VectorParmsInfoString = vf106# CHECK-NEXT:      58: 00 00        	# Padding107# CHECK-NEXT:      5a: 20           	# ExtensionTable = TB_SSP_CANARY108# CHECK-NEXT:      5b: 00           	# Padding109# 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