mirror of
https://github.com/ruby/ruby.git
synced 2026-07-30 15:41:06 +08:00
Add snapshot tests verifying correct HIR generation for each annotated method: - Float cfuncs (nan?, finite?, infinite?) emit CCall with BoolExact or Fixnum|NilClass return type - Integer builtins (zero?, even?, odd?) emit InvokeBuiltin with BoolExact return type - Float builtins (zero?, positive?, negative?) emit InvokeBuiltin with BoolExact return type Add benchmark yml files for Float and Integer predicates to the benchmark/ directory.
10 lines
192 B
YAML
10 lines
192 B
YAML
prelude: |
|
|
nums = (0..9).to_a
|
|
|
|
benchmark:
|
|
integer_zero?: nums.each { |n| n.zero? }
|
|
integer_even?: nums.each { |n| n.even? }
|
|
integer_odd?: nums.each { |n| n.odd? }
|
|
|
|
loop_count: 1000000
|