summaryrefslogtreecommitdiff
path: root/test/Examples/Kaleidoscope/Chapter3.test
diff options
context:
space:
mode:
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: }