aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/parser/def_var_expr.good
blob: 2d8ea0ea54e79bf23d956e4043d6c13b00ed1a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

int a = 1+2;
int b = 1 + 2*3;
int c = 1*2 + 3;
int d = 1+2+3;
int e = 1*2 + 3*4*5*6 + 7*8;

bool f = 1 < 2 or 3 > 4;
bool g = 1+2 as int < 3+4 as int or not 5+6*7 as int > 8-9 as int and 0 > 1;

int^? h = none;
int^^? hh = none;
int^?^?^? hhh = none;
int i;

() test_j() { bool j = (h?^ + hh?^^) as int < hhh?^?^?^; }
int^ k = @i;

uint l = (1+2) * 3 << 4 + 5;
() test_m() { bool m = not 5 < (h?^ + 6) as int or b + 1 as int < 0; }

() test_n() {
    int n = fun();
    int o = funa(1);
    int p = funb(1, 2);
    int q = 1 + 2*funb(3, 4);
    int r = funb(1+2*3, 4+5*6)*7 + 8;
}
uint16 s = compl 0;
uint16 t = compl 123;
uint16 u = s bitand 0x12;
uint16 v = 0x1 bitor 0x4;
uint16 w = 0x24 bitor 0x15;
bool x = s bitand 0x2 as uint16 == 0; // TODO automatically detect largest type
uint16 y = 1 bitor 2 bitand 3;
uint16 z = 0x10 >> 3;

int fun() { return 0; }
int funa(int a) { return 0; }
int funb(int a,int b) { return 0; }