aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Examples/Kaleidoscope/Chapter6.test
blob: 1126e0df1f018fc6e7e1497f9feadfd403cb3b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# RUN: Kaleidoscope-Ch6 < %s 2>&1 | FileCheck %s
# REQUIRES: default_triple

# Test unary operator definition.
def unary-(x) 0 - x;
1 + (-1);
# CHECK: Evaluated to 0.000000

# Test binary operator definition.
def binary> 10 (lhs rhs) rhs < lhs;
def foo(x) if x > 10 then 0 else 1;
foo(9);
foo(11);
# CHECK: Evaluated to 1.000000
# CHECK: Evaluated to 0.000000