@@ -37,13 +37,28 @@ class TestStagedConcolicEval extends FunSuite {
37
37
println(result)
38
38
exploreTreeFile
39
39
}
40
+ val exploreTreeFileImm = {
41
+ // Do concolic execution with immutable data structure and snapshot reuse
42
+ val exe = s " $cppFile.imm.exe "
43
+ val exploreTreeFile = s " $filename.imm.tree.dot "
44
+ WasmToCppCompiler .compileToExe(moduleInst, main, cppFile, exe, true , optimizeLevel= 0 , if (exitByCoverage) " BY_COVERAGE" else " EARLY_EXIT" , " USE_IMM" )
45
+ println(s " Running compiled concolic execution with immutable data structure and snapshot reuse: $exe" )
46
+ val result = Process (s " ./ $exe" , None , " TREE_FILE" -> exploreTreeFile).!!
47
+ println(result)
48
+ exploreTreeFile
49
+ }
40
50
// The explore tree generated by two executions should be same
41
51
import java .nio .file .Files
42
52
assert(
43
53
Files .readAllBytes(java.nio.file.Paths .get(exploreTreeFile))
44
54
sameElements Files .readAllBytes(java.nio.file.Paths .get(exploreTreeFileNoReuse)),
45
55
s " Explore trees $exploreTreeFile and $exploreTreeFileNoReuse are different! "
46
56
)
57
+ assert(
58
+ Files .readAllBytes(java.nio.file.Paths .get(exploreTreeFile))
59
+ sameElements Files .readAllBytes(java.nio.file.Paths .get(exploreTreeFileImm)),
60
+ s " Explore trees $exploreTreeFile and $exploreTreeFileImm are different! "
61
+ )
47
62
}
48
63
49
64
// only test concrete execution and its result
@@ -98,6 +113,10 @@ class TestStagedConcolicEval extends FunSuite {
98
113
}
99
114
test(" btree-bug-finding-concolic" ) { testFileConcolicCpp(" ./benchmarks/wasm/btree/2o1u-unlabeled.wat" , exitByCoverage = true ) }
100
115
116
+ test(" long-trivial-execution-concrete" ) {
117
+ // This is a example to show how much performance improvement we can get by immutable data structure
118
+ testFileConcreteCpp(" ./benchmarks/wasm/staged/long-trivial-execution.wat" , None )
119
+ }
101
120
102
121
test(" return-poly - concrete" ) {
103
122
testFileConcreteCpp(" ./benchmarks/wasm/staged/return_poly.wat" , Some (" $real_main" ), expect= Some (List (42 )))
0 commit comments