summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-11-25 08:00:33 +0900
committerGitHub <[email protected]>2016-11-25 08:00:33 +0900
commit99f6de529e3ffd35bd2924c727e12962f6c90999 (patch)
treed6f3ce9ecaf598b76a70e80e58e5af348a9f51ef /test
parenta630c4f413f6af764e68210430e8b61a435d38d7 (diff)
parent964427f82c5a8556daf4448b47cc65fb6d2a94b8 (diff)
downloadmruby-99f6de529e3ffd35bd2924c727e12962f6c90999.tar.gz
mruby-99f6de529e3ffd35bd2924c727e12962f6c90999.zip
Merge pull request #3290 from bouk/unsafe-peep
Fix unsafe peephole optimization
Diffstat (limited to 'test')
-rw-r--r--test/t/codegen.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
new file mode 100644
index 000000000..f910d37fb
--- /dev/null
+++ b/test/t/codegen.rb
@@ -0,0 +1,11 @@
+##
+# Codegen tests
+
+assert('peephole optimization does not eliminate move whose result is reused') do
+ assert_raise LocalJumpError do
+ def method
+ yield
+ end
+ method(&a &&= 0)
+ end
+end