mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
test/COFF: Fix symbol indexes and names. Update tests to match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115642 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f191d120b1
commit
a25c0a4283
@ -44,13 +44,13 @@ declare i32 @printf(i8* nocapture, ...) nounwind
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 2
|
||||
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
|
||||
; CHECK: SymbolName =
|
||||
; CHECK: SymbolName = .data
|
||||
; CHECK: }
|
||||
; CHECK: 1 = {
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 5
|
||||
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
|
||||
; CHECK: SymbolName = _main
|
||||
; CHECK: SymbolName = _printf
|
||||
; CHECK: }
|
||||
; CHECK: ]
|
||||
; CHECK: }
|
||||
@ -87,7 +87,7 @@ declare i32 @printf(i8* nocapture, ...) nounwind
|
||||
; CHECK: 15 00 00 00 02 00 00 00 - 00 00 00 00 01 00 00 00 |................|
|
||||
; CHECK: 00 00 |..|
|
||||
; CHECK: }
|
||||
; CHECK: 1 = {
|
||||
; CHECK: 2 = {
|
||||
; CHECK: Name = .data
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 2
|
||||
@ -99,7 +99,7 @@ declare i32 @printf(i8* nocapture, ...) nounwind
|
||||
; CHECK: 0C 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................|
|
||||
; CHECK: 00 00 |..|
|
||||
; CHECK: }
|
||||
; CHECK: 2 = {
|
||||
; CHECK: 4 = {
|
||||
; CHECK: Name = _main
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 1
|
||||
@ -109,7 +109,7 @@ declare i32 @printf(i8* nocapture, ...) nounwind
|
||||
; CHECK: NumberOfAuxSymbols = 0
|
||||
; CHECK: AuxillaryData =
|
||||
; CHECK: }
|
||||
; CHECK: 3 = {
|
||||
; CHECK: 5 = {
|
||||
; CHECK: Name = _printf
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 0
|
||||
|
@ -48,25 +48,25 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 2
|
||||
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
|
||||
; CHECK: SymbolName =
|
||||
; CHECK: SymbolName = .data
|
||||
; CHECK: }
|
||||
; CHECK: 1 = {
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 5
|
||||
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
|
||||
; CHECK: SymbolName = _main
|
||||
; CHECK: SymbolName = _printf
|
||||
; CHECK: }
|
||||
; CHECK: 2 = {
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 6
|
||||
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
|
||||
; CHECK: SymbolName = _printf
|
||||
; CHECK: SymbolName = _str
|
||||
; CHECK: }
|
||||
; CHECK: 3 = {
|
||||
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
||||
; CHECK: SymbolTableIndex = 7
|
||||
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
|
||||
; CHECK: SymbolName = _str
|
||||
; CHECK: SymbolName = _puts
|
||||
; CHECK: }
|
||||
; CHECK: ]
|
||||
; CHECK: }
|
||||
@ -105,7 +105,7 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: 00 00 |..|
|
||||
|
||||
; CHECK: }
|
||||
; CHECK: 1 = {
|
||||
; CHECK: 2 = {
|
||||
; CHECK: Name = .data
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 2
|
||||
@ -118,7 +118,7 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: 00 00 |..|
|
||||
|
||||
; CHECK: }
|
||||
; CHECK: 2 = {
|
||||
; CHECK: 4 = {
|
||||
; CHECK: Name = _main
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 1
|
||||
@ -128,7 +128,7 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: NumberOfAuxSymbols = 0
|
||||
; CHECK: AuxillaryData =
|
||||
|
||||
; CHECK: 3 = {
|
||||
; CHECK: 5 = {
|
||||
; CHECK: Name = _printf
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 0
|
||||
@ -139,7 +139,7 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: AuxillaryData =
|
||||
|
||||
; CHECK: }
|
||||
; CHECK: 4 = {
|
||||
; CHECK: 6 = {
|
||||
; CHECK: Name = _str
|
||||
; CHECK: Value = 7
|
||||
; CHECK: SectionNumber = 2
|
||||
@ -150,7 +150,7 @@ declare i32 @puts(i8* nocapture) nounwind
|
||||
; CHECK: AuxillaryData =
|
||||
|
||||
; CHECK: }
|
||||
; CHECK: 5 = {
|
||||
; CHECK: 7 = {
|
||||
; CHECK: Name = _puts
|
||||
; CHECK: Value = 0
|
||||
; CHECK: SectionNumber = 0
|
||||
|
@ -160,10 +160,10 @@ file = ('struct', [
|
||||
0x0010: 'IMAGE_REL_AMD64_SSPAN32',
|
||||
},
|
||||
}))),
|
||||
('SymbolName', ('ptr', '+ PointerToSymbolTable * - SymbolTableIndex 1 18', ('scalar', '<8s', symname)))
|
||||
('SymbolName', ('ptr', '+ PointerToSymbolTable * SymbolTableIndex 18', ('scalar', '<8s', symname)))
|
||||
])))),
|
||||
]))),
|
||||
('Symbols', ('ptr', 'PointerToSymbolTable', ('byte-array', '* NumberOfSymbols 18', ('struct', [
|
||||
('Symbols', ('ptr', 'PointerToSymbolTable', ('byte-array', '18', '* NumberOfSymbols 18', ('struct', [
|
||||
('Name', ('scalar', '<8s', symname)),
|
||||
('Value', ('scalar', '<L', '%d' )),
|
||||
('SectionNumber', ('scalar', '<H', '%d' )),
|
||||
@ -487,24 +487,28 @@ def handle_array(entry):
|
||||
return newItems
|
||||
|
||||
def handle_byte_array(entry):
|
||||
length = entry[1]
|
||||
element = entry[2]
|
||||
ent_size = entry[1]
|
||||
length = entry[2]
|
||||
element = entry[3]
|
||||
|
||||
newItems = []
|
||||
|
||||
write("[\n")
|
||||
indent()
|
||||
|
||||
item_size = read_value(ent_size)
|
||||
value = read_value(length)
|
||||
end_of_array = Input.tell() + value
|
||||
|
||||
prev_loc = Input.tell()
|
||||
index = 0
|
||||
while Input.tell() < end_of_array:
|
||||
write("%d = "%index)
|
||||
write("%d = " % index)
|
||||
value = handle_element(element)
|
||||
write("\n")
|
||||
newItems.append(value)
|
||||
index += 1
|
||||
index += (Input.tell() - prev_loc) / item_size
|
||||
prev_loc = Input.tell()
|
||||
|
||||
dedent()
|
||||
write("]")
|
||||
|
Loading…
Reference in New Issue
Block a user