C++ binary to help test calls made by the java bindings

PiperOrigin-RevId: 328963231
diff --git a/bindings/javatests/com/google/iree/integration_test.cc b/bindings/javatests/com/google/iree/integration_test.cc
new file mode 100644
index 0000000..eac0905
--- /dev/null
+++ b/bindings/javatests/com/google/iree/integration_test.cc
@@ -0,0 +1,73 @@
+// Copyright 2020 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <memory>
+
+#include "bindings/java/com/google/iree/native/context_wrapper.h"
+#include "bindings/java/com/google/iree/native/function_wrapper.h"
+#include "bindings/java/com/google/iree/native/instance_wrapper.h"
+#include "bindings/java/com/google/iree/native/module_wrapper.h"
+#include "bindings/javatests/com/google/iree/simple_mul_bytecode_module.h"
+#include "iree/base/init.h"
+
+namespace iree {
+namespace java {
+namespace {
+
+extern "C" int main(int argc, char** argv) {
+  auto instance = std::make_unique<InstanceWrapper>();
+  auto instance_status = instance->Create();
+  if (!instance_status.ok()) {
+    LOG(ERROR) << "Instance error: " << instance_status.code();
+    return 1;
+  }
+  LOG(INFO) << "Instance created";
+
+  auto module = std::make_unique<ModuleWrapper>();
+  const auto* module_file = simple_mul_bytecode_module_create();
+  auto module_status = module->Create(
+      reinterpret_cast<const uint8_t*>(module_file->data), module_file->size);
+  if (!module_status.ok()) {
+    LOG(ERROR) << "Module error: " << module_status.code();
+    return 1;
+  }
+  std::vector<ModuleWrapper*> modules = {module.get()};
+  LOG(INFO) << "Module created";
+
+  auto context = std::make_unique<ContextWrapper>();
+  auto context_status = context->CreateWithModules(*instance, modules);
+  if (!context_status.ok()) {
+    LOG(ERROR) << "Context error: " << context_status.code();
+    return 1;
+  }
+  LOG(INFO) << "Context created";
+
+  FunctionWrapper function;
+  const char* function_name = "module.simple_mul";
+  auto function_status = context->ResolveFunction(
+      iree_string_view_t{function_name, strlen(function_name)}, &function);
+  if (!context_status.ok()) {
+    LOG(ERROR) << "Function error: " << function_status.code();
+    return 1;
+  }
+  LOG(INFO) << "Function created";
+  LOG(INFO) << "Function name: "
+            << std::string(function.name().data, function.name().size);
+
+  return 0;
+}
+
+}  // namespace
+}  // namespace java
+}  // namespace iree