diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-26 02:48:04 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-26 02:48:04 +0000 |
commit | b3730b1a3de7fe37a660bd30d3d0d55bcea22d1d (patch) | |
tree | 4c472055955c29fca31637583a604c17907fc96b /test/MC | |
parent | 7fd6b0fff74a7c9fbc054b3303fee1a8f22002b2 (diff) | |
download | external_llvm-b3730b1a3de7fe37a660bd30d3d0d55bcea22d1d.zip external_llvm-b3730b1a3de7fe37a660bd30d3d0d55bcea22d1d.tar.gz external_llvm-b3730b1a3de7fe37a660bd30d3d0d55bcea22d1d.tar.bz2 |
llvm-mc/Mach-O: Set addresses for symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r-- | test/MC/MachO/symbol-indirect.s | 15 | ||||
-rw-r--r-- | test/MC/MachO/values.s | 135 |
2 files changed, 140 insertions, 10 deletions
diff --git a/test/MC/MachO/symbol-indirect.s b/test/MC/MachO/symbol-indirect.s index 4592ead..1812ac3 100644 --- a/test/MC/MachO/symbol-indirect.s +++ b/test/MC/MachO/symbol-indirect.s @@ -117,8 +117,7 @@ sym_nlp_G: // CHECK: # Section 2 // CHECK: (('section_name', '__nl_symbol_ptr\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') - // FIXME: Enable this when fixed! -// CHECX: ('address', 20) +// CHECK: ('address', 20) // CHECK: ('size', 20) // CHECK: ('offset', 412) // CHECK: ('alignment', 2) @@ -145,8 +144,7 @@ sym_nlp_G: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 8) +// CHECK: ('n_value', 8) // CHECK: ('_string', 'sym_lsp_C') // CHECK: ), // CHECK: # Symbol 1 @@ -154,8 +152,7 @@ sym_nlp_G: // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 3) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 28) +// CHECK: ('n_value', 28) // CHECK: ('_string', 'sym_nlp_C') // CHECK: ), // CHECK: # Symbol 2 @@ -163,8 +160,7 @@ sym_nlp_G: // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 16) +// CHECK: ('n_value', 16) // CHECK: ('_string', 'sym_lsp_G') // CHECK: ), // CHECK: # Symbol 3 @@ -172,8 +168,7 @@ sym_nlp_G: // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 3) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 36) +// CHECK: ('n_value', 36) // CHECK: ('_string', 'sym_nlp_G') // CHECK: ), // CHECK: # Symbol 4 diff --git a/test/MC/MachO/values.s b/test/MC/MachO/values.s new file mode 100644 index 0000000..2a472ab --- /dev/null +++ b/test/MC/MachO/values.s @@ -0,0 +1,135 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + + .long 0 +text_def_int: + .long 0 + + .globl text_def_ext +text_def_ext: + .long 0 + + .data + .long 0 +data_def_int: + .long 0 + + .globl data_def_ext +data_def_ext: + .long 0 + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 296) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 192) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 24) +// CHECK: ('file_offset', 324) +// CHECK: ('file_size', 24) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 2) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 12) +// CHECK: ('offset', 324) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 1 +// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 12) +// CHECK: ('size', 12) +// CHECK: ('offset', 336) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x0) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 348) +// CHECK: ('nsyms', 4) +// CHECK: ('stroff', 396) +// CHECK: ('strsize', 56) +// CHECK: ('_string_data', '\x00text_def_ext\x00data_def_ext\x00text_def_int\x00data_def_int\x00\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 27) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 4) +// CHECK: ('_string', 'text_def_int') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 40) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 16) +// CHECK: ('_string', 'data_def_int') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 14) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 20) +// CHECK: ('_string', 'data_def_ext') +// CHECK: ), +// CHECK: # Symbol 3 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 8) +// CHECK: ('_string', 'text_def_ext') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 2) +// CHECK: ('iextdefsym', 2) +// CHECK: ('nextdefsym', 2) +// CHECK: ('iundefsym', 4) +// CHECK: ('nundefsym', 0) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 0) +// CHECK: ('nindirectsyms', 0) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) |