aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-31 07:23:26 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-31 07:37:29 +0800
commit23182c7fdfd675b99ed9ea86b30e3ff1dd9516f2 (patch)
treee21a4c4936c646a211c3ed67c86a90a62a882896
parenta3f77527e9da0005e3c6d9cbd4c6a56c17c1089c (diff)
downloaddexon-solidity-23182c7fdfd675b99ed9ea86b30e3ff1dd9516f2.tar.gz
dexon-solidity-23182c7fdfd675b99ed9ea86b30e3ff1dd9516f2.tar.zst
dexon-solidity-23182c7fdfd675b99ed9ea86b30e3ff1dd9516f2.zip
Add --without-optimizer option to fuzzer
-rw-r--r--test/fuzzer.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp
index 2c39dde2..53ba7201 100644
--- a/test/fuzzer.cpp
+++ b/test/fuzzer.cpp
@@ -121,13 +121,12 @@ void testStandardCompiler()
}
}
-void testCompiler()
+void testCompiler(bool optimize)
{
if (!quiet)
- cout << "Testing compiler." << endl;
+ cout << "Testing compiler " << (optimize ? "with" : "without") << " optimizer." << endl;
string input = readInput();
- bool optimize = true;
string outputString(compileJSON(input.c_str(), optimize));
Json::Value outputJson;
if (!Json::Reader().parse(outputString, outputJson))
@@ -191,6 +190,10 @@ Allowed options)",
"const-opt",
"Run the constant optimizer instead of compiling. "
"Expects a binary string of up to 32 bytes on stdin."
+ )
+ (
+ "without-optimizer",
+ "Run without optimizations. Cannot be used together with standard-json."
);
po::variables_map arguments;
@@ -216,7 +219,7 @@ Allowed options)",
else if (arguments.count("standard-json"))
testStandardCompiler();
else
- testCompiler();
+ testCompiler(!arguments.count("without-optimizer"));
return 0;
}