[llvm-commits] [llvm] r115642 - in /llvm/trunk/test: MC/COFF/basic-coff.ll MC/COFF/symbol-fragment-offset.ll Scripts/coff-dump.py

Michael J. Spencer bigcheesegs at gmail.com
Tue Oct 5 10:57:09 PDT 2010


Author: mspencer
Date: Tue Oct  5 12:57:08 2010
New Revision: 115642

URL: http://llvm.org/viewvc/llvm-project?rev=115642&view=rev
Log:
test/COFF: Fix symbol indexes and names. Update tests to match.

Modified:
    llvm/trunk/test/MC/COFF/basic-coff.ll
    llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll
    llvm/trunk/test/Scripts/coff-dump.py

Modified: llvm/trunk/test/MC/COFF/basic-coff.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/basic-coff.ll?rev=115642&r1=115641&r2=115642&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/basic-coff.ll (original)
+++ llvm/trunk/test/MC/COFF/basic-coff.ll Tue Oct  5 12:57:08 2010
@@ -44,13 +44,13 @@
 ; 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 @@
 ; 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 @@
 ; 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 @@
 ; CHECK:       NumberOfAuxSymbols       = 0
 ; CHECK:       AuxillaryData            =
 ; CHECK:     }
-; CHECK:     3 = {
+; CHECK:     5 = {
 ; CHECK:       Name                     = _printf
 ; CHECK:       Value                    = 0
 ; CHECK:       SectionNumber            = 0

Modified: llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll?rev=115642&r1=115641&r2=115642&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll (original)
+++ llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll Tue Oct  5 12:57:08 2010
@@ -48,25 +48,25 @@
 ; 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 @@
 ; CHECK:         00 00                                             |..|
 
 ; CHECK:     }
-; CHECK:     1 = {
+; CHECK:     2 = {
 ; CHECK:       Name                     = .data
 ; CHECK:       Value                    = 0
 ; CHECK:       SectionNumber            = 2
@@ -118,7 +118,7 @@
 ; CHECK:         00 00                                             |..|
 
 ; CHECK:     }
-; CHECK:     2 = {
+; CHECK:     4 = {
 ; CHECK:       Name                     = _main
 ; CHECK:       Value                    = 0
 ; CHECK:       SectionNumber            = 1
@@ -128,7 +128,7 @@
 ; CHECK:       NumberOfAuxSymbols       = 0
 ; CHECK:       AuxillaryData            =
 
-; CHECK:     3 = {
+; CHECK:     5 = {
 ; CHECK:       Name                     = _printf
 ; CHECK:       Value                    = 0
 ; CHECK:       SectionNumber            = 0
@@ -139,7 +139,7 @@
 ; CHECK:       AuxillaryData            =
 
 ; CHECK:     }
-; CHECK:     4 = {
+; CHECK:     6 = {
 ; CHECK:       Name                     = _str
 ; CHECK:       Value                    = 7
 ; CHECK:       SectionNumber            = 2
@@ -150,7 +150,7 @@
 ; CHECK:       AuxillaryData            =
 
 ; CHECK:     }
-; CHECK:     5 = {
+; CHECK:     7 = {
 ; CHECK:       Name                     = _puts
 ; CHECK:       Value                    = 0
 ; CHECK:       SectionNumber            = 0

Modified: llvm/trunk/test/Scripts/coff-dump.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/coff-dump.py?rev=115642&r1=115641&r2=115642&view=diff
==============================================================================
--- llvm/trunk/test/Scripts/coff-dump.py (original)
+++ llvm/trunk/test/Scripts/coff-dump.py Tue Oct  5 12:57:08 2010
@@ -160,10 +160,10 @@
           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 @@
   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("]")





More information about the llvm-commits mailing list