xref: /llvm-project/llvm/test/Examples/Kaleidoscope/Chapter6.test (revision 8b64adb0a2853f42c09bd98759eec86f51b546ba)
1# RUN: Kaleidoscope-Ch6 < %s 2>&1 | FileCheck %s
2# REQUIRES: default_triple
3
4# Test unary operator definition.
5def unary-(x) 0 - x;
61 + (-1);
7# CHECK: Evaluated to 0.000000
8
9# Test binary operator definition.
10def binary> 10 (lhs rhs) rhs < lhs;
11def foo(x) if x > 10 then 0 else 1;
12foo(9);
13foo(11);
14# CHECK: Evaluated to 1.000000
15# CHECK: Evaluated to 0.000000
16
17