Merge "Fix TestAfdoDeps for darwin" into main

This commit is contained in:
Colin Cross
2024-02-09 22:41:46 +00:00
committed by Gerrit Code Review

View File

@@ -15,6 +15,7 @@
package cc package cc
import ( import (
"runtime"
"strings" "strings"
"testing" "testing"
@@ -228,12 +229,14 @@ func TestAfdoDeps(t *testing.T) {
uniqueInternalLinkageNamesCFlag, cFlags) uniqueInternalLinkageNamesCFlag, cFlags)
} }
ldFlags = libTestHost.Rule("ld").Args["ldFlags"] if runtime.GOOS != "darwin" {
if !strings.Contains(ldFlags, noAfdoLtoLdFlag) { ldFlags := libTestHost.Rule("ld").Args["ldFlags"]
t.Errorf("Expected host 'libTest' to not enable afdo, but did not find %q in ldflags %q", noAfdoLtoLdFlag, ldFlags) if !strings.Contains(ldFlags, noAfdoLtoLdFlag) {
} t.Errorf("Expected host 'libTest' to not enable afdo, but did not find %q in ldflags %q", noAfdoLtoLdFlag, ldFlags)
if strings.Contains(ldFlags, afdoLtoLdFlag) { }
t.Errorf("Expected host 'libTest' to not enable afdo, but found %q in ldflags %q", afdoLtoLdFlag, ldFlags) if strings.Contains(ldFlags, afdoLtoLdFlag) {
t.Errorf("Expected host 'libTest' to not enable afdo, but found %q in ldflags %q", afdoLtoLdFlag, ldFlags)
}
} }
// Check dependency edge from afdo-enabled module to static deps // Check dependency edge from afdo-enabled module to static deps