aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iseq.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-17 01:20:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-17 01:20:22 +0000
commit6eac885ebef2b5189bb68acadcba0530bcc4bfb1 (patch)
tree845db20125e97134d4275794c98d2ace48cf9439 /test/ruby/test_iseq.rb
parentfcf6fa8781fe236a9761ad5d75fa1b87f1afeea2 (diff)
downloadruby-6eac885ebef2b5189bb68acadcba0530bcc4bfb1.tar.gz
* compile.c (iseq_compile_each): check
iseq->compile_data->option->specialized_instruction for opt_* insn. * test/ruby/test_iseq.rb: check no specialized_instructions option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iseq.rb')
-rw-r--r--test/ruby/test_iseq.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index d7d15c7703..ede333fd14 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -124,4 +124,14 @@ class TestISeq < Test::Unit::TestCase
ISeq.of(c.instance_method(:foobar)).label
assert_same a, b
end
+
+ def test_diable_opt
+ src = "a['foo'] = a['bar']; 'a'.freeze"
+ _,_,_,_,_,_,_,_,_,_,_,_,_,body= RubyVM::InstructionSequence.compile(src, __FILE__, __FILE__, __LINE__, false).to_a
+ body.each{|insn|
+ next if Integer === insn
+ op = insn.first
+ assert(!op.to_s.match(/^opt_/), "#{op}")
+ }
+ end
end