Skip to content

Commit

Permalink
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/truffle/compiler/osr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

ruby -X+T -J-G:+TruffleCompilationExceptionsAreFatal test/truffle/compiler/osr/osr.rb
28 changes: 28 additions & 0 deletions test/truffle/compiler/osr/osr.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

timeout = Time.now + 30

begin
while Time.now < timeout
Truffle::Primitive.assert_not_compiled
end

puts "while loop optimisation timed out"
exit 1
rescue RubyTruffleError => e
if e.message.include? 'Truffle::Primitive.assert_not_compiled'
puts "while loop optimising"
exit 0
else
puts "some other error"
exit 1
end
end

exit 1

0 comments on commit febf590

Please sign in to comment.