Do not build tests with ThinLTO am: 85d7297318 am: a8662675e0 am: 27a412e668 am: a916324621

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1866896

Change-Id: I927d206a8a333a67289919760fb82aca97465af8
diff --git a/cc/lto.go b/cc/lto.go
index 6d55579..99598a9 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -137,8 +137,9 @@
 
 func (lto *lto) DefaultThinLTO(ctx BaseModuleContext) bool {
 	host := ctx.Host()
+	test := ctx.testBinary()
 	vndk := ctx.isVndk() // b/169217596
-	return GlobalThinLTO(ctx) && !lto.Never() && !host && !vndk
+	return GlobalThinLTO(ctx) && !lto.Never() && !host && !test && !vndk
 }
 
 func (lto *lto) FullLTO() bool {