aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/expr_types.bad
blob: d87cdc6c66e4a35e73c2caae8982b70eb958b879 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

/* ERRORS */
int ia = bool:true;
int ib = not :false;
int ic = :true xor :false;
int id = ba;
int ie = -ba;

/* ERRORS operators that don't support floating point or negative numbers */
float fa = compl 1;
float fb = compl 1.1;
float fc = 0x1 shl 1;
float fd = 0x2 bitor 0x1;
int na = compl 1;
uint nb = compl -1;
int nc = 1 bitxor 2;
uint nd = -1 bitand 1;
eint ne = compl 0x123;
eint nf = 0x256 << 1;

/* ERRORS */
bool ba = 1;
bool bb = -1;
bool bc = 1 + 1;
bool bd = -1 + 1;
bool be = ia;
bool bf = bc + 1;
bool bg = bc or 1;

/* ERRORS */
int8 i8 = bool:false;
int16 i16 = bool:false;
int32 i32 = bool:false;
int64 i64 = bool:false;
int128 i128 = bool:false;

/* ERRORS */
byte u8 = bool:false;
uint8 u8 = bool:false;
uint16 u16 = bool:false;
uint32 u32 = bool:false;
uint64 u64 = bool:false;
uint128 u128 = bool:false;

/* ERRORS */
wuint8 w8 = bool:false;
wuint16 w16 = bool:false;
wuint32 w32 = bool:false;
wuint64 w64 = bool:false;
wuint128 w128 = bool:false;

int#[2] arr2 = [1,2];
int#[3] arr3 = [1,2,3];
int#[4] arr4 = [1,2,3,4];
/* ERRORS arrays of incorrect length */
int#[2] arr2a = [1,2,3];
int#[2] arr2b = arr3;
bool arrlen1 = arr3 == arr2;
bool arrlen2 = arr3 == arr4;
bool arrlen2 = arr3 != arr4;

() f() {
    /* ERRORS */
    int a = f();
    int b = f() + 1;
    int c = 1 + f();
}