-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-sanity1.mc
69 lines (57 loc) · 839 Bytes
/
test-sanity1.mc
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
68
69
//OPIS: Sanity check za miniC gramatiku
// Davalo je FAILED zbog warning-a da main() nema return
int f(int x) {
int y;
return x + 2 - y;
}
unsigned f2() {
return 2u;
}
unsigned ff(unsigned x) {
unsigned y;
return x + f2() - y;
}
int main() {
int a;
int b;
int aa;
int bb;
int c;
int d;
unsigned u;
unsigned w;
unsigned uu;
unsigned ww;
//poziv funkcije
a = f(3);
//if iskaz sa else delom
if(a < b) //1
a = 1;
else
a = -2;
if(a + c == b + d - 4) //2
a = 1;
else
a = 2;
if(u == w) { //3
u = ff(1u);
a = f(11);
} else {
w = 2u;
}
if(a + c == b - d - -4) { //4
a = 1;
} else
a = 2;
a = f(42);
if(a + (aa - c) - d < b + (bb - a)) //5
uu = w - u + uu;
else
d = aa + bb - c;
//if iskaz bez else dela
if(a < b) //6
a = 1;
if(a + c == b - +4) //7
a = 1;
return a; // Dodato
}