summaryrefslogtreecommitdiffstats
path: root/llvm/test/Examples/Kaleidoscope/Chapter4.test
blob: 5fd0e42c9a6d5768b214b1d69331f97a3bbb0d61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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

OpenPOWER on IntegriCloud