summaryrefslogtreecommitdiffstats
path: root/llvm/test/Examples/Kaleidoscope/Chapter4.test
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-08-27 20:33:22 +0000
committerLang Hames <lhames@gmail.com>2015-08-27 20:33:22 +0000
commite2edcdcd934d3134114476beb098716331ecbf39 (patch)
treeb21773287b8a62401794ebd1f740f8db3d69c211 /llvm/test/Examples/Kaleidoscope/Chapter4.test
parent53b2afa28f6592f8e85b2f97e83f219dc8dde891 (diff)
downloadbcm5719-llvm-e2edcdcd934d3134114476beb098716331ecbf39.tar.gz
bcm5719-llvm-e2edcdcd934d3134114476beb098716331ecbf39.zip
Oops - Re-add the Kaleidoscope regression tests themselves (accidentally left
out of r246201). llvm-svn: 246203
Diffstat (limited to 'llvm/test/Examples/Kaleidoscope/Chapter4.test')
-rw-r--r--llvm/test/Examples/Kaleidoscope/Chapter4.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Examples/Kaleidoscope/Chapter4.test b/llvm/test/Examples/Kaleidoscope/Chapter4.test
new file mode 100644
index 00000000000..5fd0e42c9a6
--- /dev/null
+++ b/llvm/test/Examples/Kaleidoscope/Chapter4.test
@@ -0,0 +1,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