Do not build tests with ThinLTO am: 85d7297318 am: a8662675e0

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

Change-Id: Ide4e88dc3b9f026bf2ad114a864434ea3d9280e4
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 {