|
1 |
| -import sys |
2 |
| -import os |
| 1 | +import sys #$ importTimeFlow="ImportExpr -> GSSA Variable sys" |
| 2 | +import os #$ importTimeFlow="ImportExpr -> GSSA Variable os" |
3 | 3 |
|
4 | 4 | sys.path.append(os.path.dirname(os.path.dirname((__file__))))
|
5 | 5 | from testlib import *
|
6 | 6 |
|
7 | 7 | # These are defined so that we can evaluate the test code.
|
8 |
| -NONSOURCE = "not a source" |
9 |
| -SOURCE = "source" |
| 8 | +NONSOURCE = "not a source" #$ importTimeFlow="'not a source' -> GSSA Variable NONSOURCE" |
| 9 | +SOURCE = "source" #$ importTimeFlow="'source' -> GSSA Variable SOURCE" |
10 | 10 |
|
11 | 11 |
|
12 |
| -def is_source(x): |
| 12 | +def is_source(x): #$ importTimeFlow="FunctionExpr -> GSSA Variable is_source" |
13 | 13 | return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j
|
14 | 14 |
|
15 | 15 |
|
16 |
| -def SINK(x): |
| 16 | +def SINK(x): #$ importTimeFlow="FunctionExpr -> GSSA Variable SINK" |
17 | 17 | if is_source(x): #$ runtimeFlow="ModuleVariableNode for multiphase.is_source, l:-17 -> is_source"
|
18 | 18 | print("OK") #$ runtimeFlow="ModuleVariableNode for multiphase.print, l:-18 -> print"
|
19 | 19 | else:
|
20 | 20 | print("Unexpected flow", x) #$ runtimeFlow="ModuleVariableNode for multiphase.print, l:-20 -> print"
|
21 | 21 |
|
22 | 22 |
|
23 |
| -def SINK_F(x): |
| 23 | +def SINK_F(x): #$ importTimeFlow="FunctionExpr -> GSSA Variable SINK_F" |
24 | 24 | if is_source(x): #$ runtimeFlow="ModuleVariableNode for multiphase.is_source, l:-24 -> is_source"
|
25 | 25 | print("Unexpected flow", x) #$ runtimeFlow="ModuleVariableNode for multiphase.print, l:-25 -> print"
|
26 | 26 | else:
|
27 | 27 | print("OK") #$ runtimeFlow="ModuleVariableNode for multiphase.print, l:-27 -> print"
|
28 | 28 |
|
29 |
| -def set_foo(): |
| 29 | +def set_foo(): #$ importTimeFlow="FunctionExpr -> GSSA Variable set_foo" |
30 | 30 | global foo
|
31 |
| - foo = SOURCE #$ runtimeFlow="ModuleVariableNode for multiphase.SOURCE, l:-31 -> SOURCE" MISSING:importTimeFlow="ModuleVariableNode for multiphase.foo" |
| 31 | + foo = SOURCE #$ runtimeFlow="ModuleVariableNode for multiphase.SOURCE, l:-31 -> SOURCE" # missing final definition of foo |
32 | 32 |
|
33 |
| -foo = NONSOURCE |
| 33 | +foo = NONSOURCE #$ importTimeFlow="NONSOURCE -> GSSA Variable foo" |
34 | 34 | set_foo()
|
35 | 35 |
|
36 | 36 | @expects(2)
|
37 |
| -def test_phases(): |
| 37 | +def test_phases(): #$ importTimeFlow="expects(..)(..), l:-1 -> GSSA Variable test_phases" |
38 | 38 | global foo
|
39 | 39 | SINK(foo) #$ runtimeFlow="ModuleVariableNode for multiphase.SINK, l:-39 -> SINK" runtimeFlow="ModuleVariableNode for multiphase.foo, l:-39 -> foo"
|
40 | 40 | foo = NONSOURCE #$ runtimeFlow="ModuleVariableNode for multiphase.NONSOURCE, l:-40 -> NONSOURCE"
|
|
0 commit comments