Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ site/
*.bc
*.wasm
test_compiler.py

# Compiled binaries in examples (no extension)
examples/compiler/benchmarks/truthiness_test
examples/compiler/benchmarks/loop_fast
examples/compiler/benchmarks/fibonacci
13 changes: 13 additions & 0 deletions examples/compiler/benchmarks/loop_fast.eigs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sum of 1 to 1,000,000
# This is the ultimate test of scalar iteration speed
# Tests the Scalar Fast Path with while loops

i is 0
sum is 0
limit is 1000000

loop while i < limit:
i is i + 1
sum is sum + i

print of sum
14 changes: 14 additions & 0 deletions examples/compiler/benchmarks/truthiness_test.eigs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Test truthiness with scalar countdown
# This tests the ensure_bool() fix where a scalar is used directly as a condition
# Before the fix, this would crash with "cbranch expects i1, got double"

count is 10
sum is 0

# Using a scalar variable directly as a condition (not a comparison)
loop while count:
sum is sum + count
count is count - 1

print of sum
# Expected: 55 (10 + 9 + 8 + ... + 1)