You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
351 B
18 lines
351 B
# RUN: Kaleidoscope-Ch4 < %s 2>&1 | FileCheck %s
|
|
|
|
# Test basic definition, binding, and execution.
|
|
def foo(x) x + 1;
|
|
def bar(x) foo(2 * x);
|
|
bar(2);
|
|
# CHECK: Evaluated to 5.000000
|
|
|
|
# Test redefinition.
|
|
def foo(x) x + 2;
|
|
foo(2);
|
|
# CHECK: Evaluated to 4.000000
|
|
|
|
# Verify that 'bar' still calls the original 'foo'.
|
|
bar(2);
|
|
# CHECK: Evaluated to 5.000000
|
|
|