Expose TocFile via CcInfo

To reflect what's provided in SharedLibraryInfoProvider

Move the logic for identifying the toc file into Starlark
instead of the Soong Go code.

Adapt TestGetCcInfoParseResults to expect the toc as well.

Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
diff --git a/cc/library_test.go b/cc/library_test.go
index 6caee49..7ddfaa7 100644
--- a/cc/library_test.go
+++ b/cc/library_test.go
@@ -337,19 +337,29 @@
 				Includes:             []string{"include"},
 				SystemIncludes:       []string{"system_include"},
 				RootDynamicLibraries: []string{"foo.so"},
+				TocFile:              "foo.so.toc",
 			},
 		},
 	}
 	ctx := testCcWithConfig(t, config)
 
 	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
+	producer := sharedFoo.(android.OutputFileProducer)
+	outputFiles, err := producer.OutputFiles("")
 	if err != nil {
 		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
 	}
 	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
 	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
 
+	tocFilePath := sharedFoo.(*Module).Toc()
+	if !tocFilePath.Valid() {
+		t.Errorf("Invalid tocFilePath: %s", tocFilePath)
+	}
+	tocFile := tocFilePath.Path()
+	expectedToc := "outputbase/execroot/__main__/foo.so.toc"
+	android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
+
 	entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
 	expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
 	gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]