summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_settracefunc.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index b6ec2f14eb..edb356d3dd 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1901,4 +1901,17 @@ class TestSetTraceFunc < Test::Unit::TestCase
assert_equal ["c-call", base_line + 35], events[9] # Thread#set_trace_func
assert_equal nil, events[10]
end
+
+ def test_lineno_in_optimized_insn
+ actual, _, _ = EnvUtil.invoke_ruby [], <<-EOF.gsub(/^.*?: */, ""), true
+ 1: class String
+ 2: def -@
+ 3: puts caller_locations(1, 1)[0].lineno
+ 4: end
+ 5: end
+ 6:
+ 7: -""
+ EOF
+ assert_equal "7\n", actual, '[Bug #14809]'
+ end
end