Skip to content

Commit

Permalink
Showing 10 changed files with 74 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/truffle/pe/core/array_pe.rb
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@

example "[3, 1, 2][1]"

# fails because of a call to <=> that is not inlined
example "[3, 1, 2].sort[1]"

# why does this fail but the next one work?
9 changes: 9 additions & 0 deletions test/truffle/pe/core/binding_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2015 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

example "x = 14; p = Proc.new { }; p.binding.local_variable_get(:x)"
17 changes: 17 additions & 0 deletions test/truffle/pe/core/eval_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2015 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

example "eval('14')"

example "eval('14 + 2')"

example "eval('[1, 2, 3]')[1]"

example "eval([1, 2, 3].inspect)[1]"

counter_example "eval(rand.to_s)"
1 change: 0 additions & 1 deletion test/truffle/pe/core/hash_pe.rb
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

# fails because of a call to eql? that is not inlined
example "({a: 0, b: 1, c: 2})[:b]"

example "({a: 0, b: 1, c: 2}).map{ |k, v| v }[0]"
6 changes: 3 additions & 3 deletions test/truffle/pe/core/method_pe.rb
Original file line number Diff line number Diff line change
@@ -10,6 +10,6 @@
example "1.method(:abs).unbind.bind(-2).call"

# These 3 are not constant currently since they produce new objects
# example "1.method(:abs)"
# example "1.method(:abs).unbind"
# example "1.method(:abs).unbind.bind(-2)"
tagged_example "1.method(:abs)"
tagged_example "1.method(:abs).unbind"
tagged_example "1.method(:abs).unbind.bind(-2)"
17 changes: 17 additions & 0 deletions test/truffle/pe/core/objectid_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2015 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

tagged_example "nil.object_id"

example "true.object_id"

example "false.object_id"

example "14.object_id"

example "(14 + 2).object_id"
13 changes: 13 additions & 0 deletions test/truffle/pe/core/send_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2015 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

example "14.send(:*, 2)"

example "14.send('*', 2)"

example "14.send((')'.ord + 1).chr, 2)"
10 changes: 10 additions & 0 deletions test/truffle/pe/language/controlflow_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2014, 2015 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

example "rand < 0.5 ? 14 : 16 - 2"
counter_example "rand < 0.5 ? 14 : 16 + 2"
1 change: 0 additions & 1 deletion test/truffle/pe/language/metaprogramming_pe.rb
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ def existing_method(a)

end

# all fail due to calls not being inlined
example "MetaprogrammingFixtures::MethodMissing.new.does_not_exist"
example "MetaprogrammingFixtures::ClassWithExistingMethod.new.respond_to?(:existing_method)"
example "MetaprogrammingFixtures::ClassWithExistingMethod.new.send(:existing_method, 14)"
5 changes: 5 additions & 0 deletions test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@ def tagged_example(code)
example "14"
counter_example "rand"

require_relative 'language/controlflow_pe.rb'
require_relative 'language/closures_pe.rb'
require_relative 'language/constant_pe.rb'
require_relative 'language/metaprogramming_pe.rb'
@@ -54,6 +55,10 @@ def tagged_example(code)
require_relative 'core/method_pe.rb'
require_relative 'core/array_pe.rb'
require_relative 'core/hash_pe.rb'
require_relative 'core/eval_pe.rb'
require_relative 'core/send_pe.rb'
require_relative 'core/objectid_pe.rb'
require_relative 'core/binding_pe.rb'
require_relative 'macro/pushing_pixels_pe.rb'

tested = 0

0 comments on commit be3e23c

Please sign in to comment.