Run 176.gcc with benchmark binary
Change-Id: I20e901b8c4ab0d658379f70516322f390d218c27
diff --git a/176.gcc/BUILD.gn b/176.gcc/BUILD.gn
index b7b62b0..b534521 100644
--- a/176.gcc/BUILD.gn
+++ b/176.gcc/BUILD.gn
@@ -2,6 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+inputs = [
+ "data/ref/input/166.i",
+ "data/ref/input/200.i",
+ "data/ref/input/expr.i",
+ "data/ref/input/integrate.i",
+ "data/ref/input/scilab.i",
+]
+
executable("176.gcc") {
testonly = true
@@ -103,4 +111,20 @@
"-Wno-unused-variable",
"-Wno-varargs",
]
+
+ if (current_os == "fuchsia") {
+ data = inputs
+ } else {
+ data_deps = [
+ ":copy_inputs",
+ ]
+ }
+}
+
+copy("copy_inputs") {
+ visibility = [ ":*" ]
+ sources = inputs
+ outputs = [
+ "$root_out_dir/data/176.gcc/{{source_file_part}}",
+ ]
}
diff --git a/benchmarks/main.cc b/benchmarks/main.cc
index caf7928..56bf739 100644
--- a/benchmarks/main.cc
+++ b/benchmarks/main.cc
@@ -58,6 +58,11 @@
AmmpFixture() : SpecFixture("188.ammp"){};
};
+class GccFixture : public SpecFixture {
+ protected:
+ GccFixture() : SpecFixture("176.gcc"){};
+};
+
} // namespace
std::string executableDir;
@@ -179,6 +184,25 @@
}
}
+// TODO(anmittal): Currently it doesn't work with fuchsia as getrlimit is not
+// implemented. Re-enable this once that is implemented
+#ifndef __Fuchsia__
+BENCHMARK_F(GccFixture, 176_gcc)(benchmark::State& st) {
+ const char* file_prefixes[] = {"166", "200", "expr", "integrate", "scilab"};
+ while (st.KeepRunning()) {
+ for (int i = 0; i < 5; i++) {
+ const char* args[] = {(std::string(file_prefixes[i]) + ".i").c_str(),
+ "-o",
+ (std::string(file_prefixes[i]) + ".s").c_str()};
+ if ((RunSpec(args, 3, NULL)) != 0) {
+ (std::string("Error while running benchmark: ") + strerror(errno))
+ .c_str();
+ }
+ }
+ }
+}
+#endif
+
int main(int argc, char* argv[]) {
::benchmark::Initialize(&argc, argv);
google::InitGoogleLogging(argv[0]);