summaryrefslogtreecommitdiff
path: root/test/Examples/Kaleidoscope/Chapter3.test
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-08-27 18:13:34 +0000
committerLang Hames <lhames@gmail.com>2015-08-27 18:13:34 +0000
commitb325a1ace53c1f0b1b38505fefeb08114f40dc10 (patch)
treeab62639f1f02696b1bfd37cea626b6df495fc3b4 /test/Examples/Kaleidoscope/Chapter3.test
parent2b96ce62f49d4701bc9880e27ebc894a371342e2 (diff)
Add Kaleidoscope regression tests.
These will be run if LLVM_BUILD_EXAMPLES is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Examples/Kaleidoscope/Chapter3.test')
-rw-r--r--test/Examples/Kaleidoscope/Chapter3.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Examples/Kaleidoscope/Chapter3.test b/test/Examples/Kaleidoscope/Chapter3.test
new file mode 100644
index 00000000000..b9c8ba6fad8
--- /dev/null
+++ b/test/Examples/Kaleidoscope/Chapter3.test
@@ -0,0 +1,17 @@
+# RUN: Kaleidoscope-Ch3 < %s 2>&1 | FileCheck %s
+
+# Test basic parsing and IR generation.
+def foo(x) x + 1;
+foo(1);
+
+# CHECK: define double @foo(double %x) {
+# CHECK-NEXT: entry:
+# CHECK-NEXT: %addtmp = fadd double %x, 1.000000e+00
+# CHECK-NEXT: ret double %addtmp
+# CHECK-NEXT: }
+
+# CHECK: define double @__anon_expr() {
+# CHECK-NEXT: entry:
+# CHECK-NEXT: %calltmp = call double @foo(double 1.000000e+00)
+# CHECK-NEXT: ret double %calltmp
+# CHECK-NEXT: }