Add test configuration for the switch interpreter.

Bug: 31358597
Test: ./art/test/testrunner/run_build_test_target.py art-interpreter-cxx
Change-Id: Iebb7a3a5168a27654984f3749a7b86542422671b
diff --git a/build/art.go b/build/art.go
index 0b5ee44..1c8be0f 100644
--- a/build/art.go
+++ b/build/art.go
@@ -53,6 +53,9 @@
 		cflags = append(cflags, "-DART_HEAP_POISONING=1")
 		asflags = append(asflags, "-DART_HEAP_POISONING=1")
 	}
+	if envTrue(ctx, "ART_USE_CXX_INTERPRETER") {
+		cflags = append(cflags, "-DART_USE_CXX_INTERPRETER=1")
+	}
 
 	if !envFalse(ctx, "ART_USE_READ_BARRIER") && ctx.AConfig().ArtUseReadBarrier() {
 		// Used to change the read barrier type. Valid values are BAKER, BROOKS,
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 5784b9b..d004d64 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -237,7 +237,11 @@
   kMterpImplKind          // Assembly interpreter
 };
 
+#if ART_USE_CXX_INTERPRETER
+static constexpr InterpreterImplKind kInterpreterImplKind = kSwitchImplKind;
+#else
 static constexpr InterpreterImplKind kInterpreterImplKind = kMterpImplKind;
+#endif
 
 static inline JValue Execute(
     Thread* self,
diff --git a/test/testrunner/target_config.py b/test/testrunner/target_config.py
index 978e9cb3..9efe435 100644
--- a/test/testrunner/target_config.py
+++ b/test/testrunner/target_config.py
@@ -40,6 +40,12 @@
     'art-interpreter' : {
         'run-test' : ['--interpreter']
     },
+    'art-interpreter-cxx' : {
+        'run-test' : ['--interpreter'],
+        'env' : {
+            'ART_USE_CXX_INTERPRETER' : 'true'
+        }
+    },
     'art-interpreter-access-checks' : {
         'run-test' : ['--interp-ac']
     },