add another test (still failing)

This commit is contained in:
Torsten Ruger 2016-12-30 13:15:08 +02:00
parent 523302ebe2
commit 631038dfbd
3 changed files with 21 additions and 8 deletions

View File

@ -20,12 +20,12 @@ module Elf
assembler = Register::Assembler.new(Register.machine) assembler = Register::Assembler.new(Register.machine)
set_text assembler.write_as_string set_text assembler.write_as_string
# for debug add labels to the block positions # for debug add labels for labels
Register.machine.space.types.values.each do |clazz| Register.machine.space.types.values.each do |type|
clazz.instance_methods.each do |f| type.instance_methods.each do |f|
f.instructions.each_label do |label| f.instructions.each_label do |label|
add_symbol "#{clazz.name}::#{f.name}:#{label.name}" , label.position add_symbol "#{clazz.name}::#{f.name}:#{label.name}" , label.position
end end
end end
end end
@ -37,9 +37,9 @@ module Elf
label = "#{slot.class.name}::#{slot.position.to_s(16)}" label = "#{slot.class.name}::#{slot.position.to_s(16)}"
end end
label += "=#{slot}" if slot.is_a?(Symbol) or slot.is_a?(String) label += "=#{slot}" if slot.is_a?(Symbol) or slot.is_a?(String)
add_symbol label , slot.position add_symbol label , slot.position
if slot.is_a?(Parfait::TypedMethod) if slot.is_a?(Parfait::TypedMethod)
add_symbol slot.name.to_s , slot.binary.position add_symbol slot.name.to_s , slot.binary.position
end end
end end
end end

View File

@ -1 +1,2 @@
require_relative "test_hello" require_relative "test_hello"
require_relative "test_zero"

12
test/elf/test_zero.rb Normal file
View File

@ -0,0 +1,12 @@
require_relative "../helper"
class TestZeroCode < MiniTest::Test
def test_string_put
machine = Register.machine.boot
machine.collect
machine.translate_arm
# writer = Elf::ObjectWriter.new
# writer.save "test/zero.o"
end
end