Bp2build Sanitizer Blocklist
Bug: 286894426
Test: Unit tests
Change-Id: I382e028410a185a5017dba1fc47c83ad5b2432cf
diff --git a/bp2build/cc_binary_conversion_test.go b/bp2build/cc_binary_conversion_test.go
index d37722b..f89d42c 100644
--- a/bp2build/cc_binary_conversion_test.go
+++ b/bp2build/cc_binary_conversion_test.go
@@ -868,6 +868,25 @@
})
}
+func TestCcBinaryWithSanitizerBlocklist(t *testing.T) {
+ runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
+ description: "cc_binary has the correct feature when sanitize.blocklist is provided",
+ blueprint: `
+{rule_name} {
+ name: "foo",
+ sanitize: {
+ blocklist: "foo_blocklist.txt",
+ },
+}`,
+ targets: []testBazelTarget{
+ {"cc_binary", "foo", AttrNameToString{
+ "local_includes": `["."]`,
+ "features": `["ubsan_blocklist_foo_blocklist_txt"]`,
+ }},
+ },
+ })
+}
+
func TestCcBinaryWithThinLto(t *testing.T) {
runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
description: "cc_binary has correct features when thin LTO is enabled",