Ensure CC GC is used for the read barrier config.

To prevent the -Xgc option from causing unsupported GC types to run.

Bug: 12687968
Test: test-art-host with CC.
Change-Id: I10b42190c0888342e9127c52e863ddae82e4d7a1
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index ddc3852..f0e619d 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -264,6 +264,10 @@
   if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) {
     LOG(INFO) << "Heap() entering";
   }
+  if (kUseReadBarrier) {
+    CHECK_EQ(foreground_collector_type_, kCollectorTypeCC);
+    CHECK_EQ(background_collector_type_, kCollectorTypeCCBackground);
+  }
   CHECK_GE(large_object_threshold, kMinLargeObjectThreshold);
   ScopedTrace trace(__FUNCTION__);
   Runtime* const runtime = Runtime::Current();