Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/anonymous-func' into routines, go
routine with anonymous function test
- Loading branch information
Showing
32 changed files
with
540 additions
and
104 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
go-lisa/go-testcases/blankidentifier/analysis___[int__,_int__]_~LiSAProgram.f().dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
digraph { | ||
"node0" [shape="rect",color="black",peripheries="2",label=<return (tuple)(1, 2)<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ heap[w]:heap: [1, 2]<BR/>ret_value@f: _|_ ]]<BR/>}} -> [ret_value@f]>]; | ||
subgraph cluster_legend { | ||
label="Legend"; | ||
style=dotted; | ||
node [shape=plaintext]; | ||
"legend" [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0"><tr><td align="right">node border </td><td align="left"><font color="gray">gray</font>, single</td></tr><tr><td align="right">entrypoint border </td><td align="left"><font color="black">black</font>, single</td></tr><tr><td align="right">exitpoint border </td><td align="left"><font color="black">black</font>, double</td></tr><tr><td align="right">sequential edge </td><td align="left"><font color="black">black</font>, solid</td></tr><tr><td align="right">true edge </td><td align="left"><font color="blue">blue</font>, dashed</td></tr><tr><td align="right">false edge </td><td align="left"><font color="red">red</font>, dashed</td></tr></table>>]; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
go-lisa/go-testcases/blankidentifier/analysis___untyped_~LiSAProgram.blankAssig().dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
digraph { | ||
"node0" [shape="rect",color="black",label=<x, _ := [unresolved]f()<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ x: [-Inf, +Inf] ]]<BR/>}} -> [x]>]; | ||
"node1" [shape="rect",color="black",peripheries="2",label=<ret<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ y: [-Inf, +Inf] ]]<BR/>}} -> [skip]>]; | ||
"node2" [shape="rect",color="gray",label=<_, y := [unresolved]f()<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ y: [-Inf, +Inf] ]]<BR/>}} -> [y]>]; | ||
"node0" -> "node2" [color="black"]; | ||
"node2" -> "node1" [color="black"]; | ||
subgraph cluster_legend { | ||
label="Legend"; | ||
style=dotted; | ||
node [shape=plaintext]; | ||
"legend" [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0"><tr><td align="right">node border </td><td align="left"><font color="gray">gray</font>, single</td></tr><tr><td align="right">entrypoint border </td><td align="left"><font color="black">black</font>, single</td></tr><tr><td align="right">exitpoint border </td><td align="left"><font color="black">black</font>, double</td></tr><tr><td align="right">sequential edge </td><td align="left"><font color="black">black</font>, solid</td></tr><tr><td align="right">true edge </td><td align="left"><font color="blue">blue</font>, dashed</td></tr><tr><td align="right">false edge </td><td align="left"><font color="red">red</font>, dashed</td></tr></table>>]; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
go-lisa/go-testcases/blankidentifier/analysis___untyped_~LiSAProgram.main().dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
digraph { | ||
"node0" [shape="rect",color="black",label=<x, _ = [unresolved]f()<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ x: [-Inf, +Inf] ]]<BR/>}} -> [x]>]; | ||
"node1" [shape="rect",color="gray",label=<_, y = [unresolved]f()<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ y: [-Inf, +Inf] ]]<BR/>}} -> [y]>]; | ||
"node2" [shape="rect",color="black",peripheries="2",label=<ret<BR/>{{<BR/>heap [[ monolith ]]<BR/>value [[ y: [-Inf, +Inf] ]]<BR/>}} -> [skip]>]; | ||
"node0" -> "node1" [color="black"]; | ||
"node1" -> "node2" [color="black"]; | ||
subgraph cluster_legend { | ||
label="Legend"; | ||
style=dotted; | ||
node [shape=plaintext]; | ||
"legend" [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0"><tr><td align="right">node border </td><td align="left"><font color="gray">gray</font>, single</td></tr><tr><td align="right">entrypoint border </td><td align="left"><font color="black">black</font>, single</td></tr><tr><td align="right">exitpoint border </td><td align="left"><font color="black">black</font>, double</td></tr><tr><td align="right">sequential edge </td><td align="left"><font color="black">black</font>, solid</td></tr><tr><td align="right">true edge </td><td align="left"><font color="blue">blue</font>, dashed</td></tr><tr><td align="right">false edge </td><td align="left"><font color="red">red</font>, dashed</td></tr></table>>]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package main | ||
|
||
func f() (int,int) { | ||
return 1,2 | ||
} | ||
|
||
//https://golang.org/doc/effective_go#blank_assign | ||
func blankAssig(){ | ||
x, _ := f() | ||
_, y := f() | ||
} | ||
|
||
|
||
//https://golang.org/doc/effective_go#maps | ||
fun mapTest(tz string) { | ||
|
||
var timeZone = map[string]int{ | ||
"UTC": 0*60*60, | ||
"EST": -5*60*60, | ||
"CST": -6*60*60, | ||
"MST": -7*60*60, | ||
"PST": -8*60*60, | ||
} | ||
|
||
_, present := timeZone[tz] | ||
|
||
} | ||
|
||
func main() { | ||
|
||
blankAssig() | ||
mapTest("PST") | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//This file contains some cases not yet covered or to investigate | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
) | ||
|
||
//https://golang.org/doc/effective_go#for | ||
func rangeTest(){ | ||
|
||
array := []int{2, 3, 4} | ||
sum := 0 | ||
for _, value := range array { | ||
sum += value | ||
} | ||
} | ||
|
||
//https://golang.org/doc/effective_go#blank_import | ||
import _ "net/http/pprof" | ||
|
||
//https://golang.org/doc/effective_go#blank_unused | ||
var _ = fmt.Printf | ||
var _ io.Reader | ||
|
||
//https://golang.org/doc/effective_go#constants | ||
type ByteSize float64 | ||
const ( | ||
_ = iota // ignore first value by assigning to blank identifier | ||
KB ByteSize = 1 << (10 * iota) | ||
MB | ||
GB | ||
TB | ||
PB | ||
EB | ||
ZB | ||
YB | ||
) | ||
|
||
const ( | ||
C1 = iota + 1 | ||
_ | ||
C3 | ||
C4 | ||
) | ||
fmt.Println(C1, C3, C4) // "1 3 4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"warnings" : [ ], | ||
"files" : [ "analysis___[int__,_int__]_~LiSAProgram.f().dot", "analysis___untyped_~LiSAProgram.blankAssig().dot" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ func say(s string) { | |
func main() { | ||
go say("world") | ||
say("hello") | ||
go func(int i){ return i + 1}(5) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"warnings" : [ ], | ||
"files" : [ "untyped_~LiSAProgram.main().dot", "untyped_~LiSAProgram.say(string_s).dot" ] | ||
"files" : [ "untyped_~LiSAProgram.anonymousFunction0(i_int).dot", "untyped_~LiSAProgram.main().dot", "untyped_~LiSAProgram.say(string_s).dot" ] | ||
} |
10 changes: 10 additions & 0 deletions
10
go-lisa/go-testcases/cfg/routine/untyped_~LiSAProgram.anonymousFunction0(i_int).dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
digraph { | ||
"node0" [shape="rect",color="black",peripheries="2",label=<return +(i, 1)>]; | ||
subgraph cluster_legend { | ||
label="Legend"; | ||
style=dotted; | ||
node [shape=plaintext]; | ||
"legend" [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0"><tr><td align="right">node border </td><td align="left"><font color="gray">gray</font>, single</td></tr><tr><td align="right">entrypoint border </td><td align="left"><font color="black">black</font>, single</td></tr><tr><td align="right">exitpoint border </td><td align="left"><font color="black">black</font>, double</td></tr><tr><td align="right">sequential edge </td><td align="left"><font color="black">black</font>, solid</td></tr><tr><td align="right">true edge </td><td align="left"><font color="blue">blue</font>, dashed</td></tr><tr><td align="right">false edge </td><td align="left"><font color="red">red</font>, dashed</td></tr></table>>]; | ||
} | ||
|
||
} |
10 changes: 6 additions & 4 deletions
10
go-lisa/go-testcases/cfg/routine/untyped_~LiSAProgram.main().dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
go-lisa/go-testcases/cfg/routine/untyped_~LiSAProgram.say(string_s).dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
go-lisa/go-testcases/interprocedural/interproc2/analysis___untyped_~LiSAProgram.main().dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.