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