-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathif_for_else2.py
More file actions
20 lines (19 loc) · 814 Bytes
/
Copy pathif_for_else2.py
File metadata and controls
20 lines (19 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Note: driver assumes functions named "testing" and "expect".
def testing(a):
if a:
for i in range(3):
a += 1
else:
a = 10
def expect():
return """
if BasicBlock(#0 range: (0, 2), flags=[0, 14], follow_offset=4, edge_count=2, jumps=[34])
loop BasicBlock(#1 range: (4, 12), flags=[2], follow_offset=14, edge_count=2, jumps=[34])
for else BasicBlock(#2 range: (14, 14), flags=[9], follow_offset=16, edge_count=2, jumps=[28])
continue BasicBlock(#3 range: (16, 26), flags=[8], follow_offset=28, edge_count=2, jumps=[14])
sequence pop block "for else" BasicBlock(#4 range: (28, 32), flags=[6], follow_offset=34, edge_count=1)
end for else
end loop
end if
sequence BasicBlock(#5 range: (34, 36), flags=[1], follow_offset=None, edge_count=0)
"""