diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest/cfg.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/test/gtest/cfg.cpp b/test/gtest/cfg.cpp index ae1b9215e..65b449745 100644 --- a/test/gtest/cfg.cpp +++ b/test/gtest/cfg.cpp @@ -2,6 +2,7 @@ #include "analysis/cfg.h" #include "analysis/lattice.h" +#include "analysis/liveness-transfer-function.h" #include "analysis/monotone-analyzer.h" #include "print-test.h" #include "wasm.h" @@ -111,9 +112,8 @@ TEST_F(CFGTest, LinearLiveness) { )wasm"; auto analyzerText = R"analyzer(CFG Analyzer -State Block: 0 -Beginning State: 000 -End State: 000 +CFG Block: 0 +Input State: 000 Predecessors: Successors: Intermediate States (reverse order): @@ -148,8 +148,10 @@ End CFG cfg = CFG::fromFunction(wasm.getFunction("bar")); FinitePowersetLattice lattice(wasm.getFunction("bar")->getNumLocals()); - MonotoneCFGAnalyzer<FinitePowersetLattice> analyzer(lattice); - analyzer.fromCFG(&cfg); + LivenessTransferFunction transferFunction; + + MonotoneCFGAnalyzer<FinitePowersetLattice, LivenessTransferFunction> analyzer( + lattice, transferFunction, cfg); analyzer.evaluate(); std::stringstream ss; @@ -184,9 +186,8 @@ TEST_F(CFGTest, NonlinearLiveness) { )wasm"; auto analyzerText = R"analyzer(CFG Analyzer -State Block: 0 -Beginning State: 00 -End State: 10 +CFG Block: 0 +Input State: 10 Predecessors: Successors: 1 2 Intermediate States (reverse order): @@ -201,9 +202,8 @@ local.set $0 00 i32.const 1 00 -State Block: 1 -Beginning State: 00 -End State: 00 +CFG Block: 1 +Input State: 00 Predecessors: 0 Successors: 3 Intermediate States (reverse order): @@ -212,9 +212,8 @@ local.set $1 00 i32.const 4 00 -State Block: 2 -Beginning State: 10 -End State: 00 +CFG Block: 2 +Input State: 00 Predecessors: 0 Successors: 3 Intermediate States (reverse order): @@ -223,9 +222,8 @@ drop 00 local.get $0 10 -State Block: 3 -Beginning State: 00 -End State: 00 +CFG Block: 3 +Input State: 00 Predecessors: 2 1 Successors: Intermediate States (reverse order): @@ -240,8 +238,10 @@ End CFG cfg = CFG::fromFunction(wasm.getFunction("bar")); FinitePowersetLattice lattice(wasm.getFunction("bar")->getNumLocals()); - MonotoneCFGAnalyzer<FinitePowersetLattice> analyzer(lattice); - analyzer.fromCFG(&cfg); + LivenessTransferFunction transferFunction; + + MonotoneCFGAnalyzer<FinitePowersetLattice, LivenessTransferFunction> analyzer( + lattice, transferFunction, cfg); analyzer.evaluate(); std::stringstream ss; |