-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathif_cycle_after.si
63 lines (54 loc) · 865 Bytes
/
if_cycle_after.si
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
algorithm main(output uint8 leds)
{
uint8 test = 8;
/// case A
while (test != 0) {
__display("- test: %d",test);
if (test > 6) {
break;
}
test = test - 1;
}
__display("after while");
/// case B
if (test > 4) {
goto label1;
}
__display("after if 1");
label1:
/// case C
if (test > 4) {
__display("in if 2");
} else {
goto label2;
}
__display("after if 2");
label2:
/// case D
if (test > 4) {
goto label3;
}
__display("after if D, test:%d",test);
label4:
__display("after after if D");
goto label5;
label3:
goto label4;
label5:
if (test > 0) {
goto b;
__display("unreached3");
b:
__display("reached3");
}
__display("after 3");
if (test > 2) {
goto d;
__display("unreached4");
d:
__display("reached4");
} else {
__display("else4");
}
__display("bottom");
}