1*e2edcdcdSLang Hames# RUN: Kaleidoscope-Ch6 < %s 2>&1 | FileCheck %s
2*e2edcdcdSLang Hames
3*e2edcdcdSLang Hames# Test unary operator definition.
4*e2edcdcdSLang Hamesdef unary-(x) 0 - x;
5*e2edcdcdSLang Hames1 + (-1);
6*e2edcdcdSLang Hames# CHECK: Evaluated to 0.000000
7*e2edcdcdSLang Hames
8*e2edcdcdSLang Hames# Test binary operator definition.
9*e2edcdcdSLang Hamesdef binary> 10 (lhs rhs) rhs < lhs;
10*e2edcdcdSLang Hamesdef foo(x) if x > 10 then 0 else 1;
11*e2edcdcdSLang Hamesfoo(9);
12*e2edcdcdSLang Hamesfoo(11);
13*e2edcdcdSLang Hames# CHECK: Evaluated to 1.000000
14*e2edcdcdSLang Hames# CHECK: Evaluated to 0.000000
15*e2edcdcdSLang Hames
16