llvm.org GIT mirror llvm / 88dc43f
Remove support for undocumented SpecialCaseList entries. "global-init", "global-init-src" and "global-init-type" were originally used to blacklist entities in ASan init-order checker. However, they were never documented, and later were replaced by "=init" category. Old blacklist entries should be converted as follows: * global-init:foo -> global:foo=init * global-init-src:bar -> src:bar=init * global-init-type:baz -> type:baz=init git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222401 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Samsonov 4 years ago
2 changed file(s) with 1 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
102102 std::string Regexp = SplitRegexp.first;
103103 StringRef Category = SplitRegexp.second;
104104
105 // Backwards compatibility.
106 if (Prefix == "global-init") {
107 Prefix = "global";
108 Category = "init";
109 } else if (Prefix == "global-init-type") {
110 Prefix = "type";
111 Category = "init";
112 } else if (Prefix == "global-init-src") {
113 Prefix = "src";
114 Category = "init";
115 }
116
117105 // See if we can store Regexp in Strings.
118106 if (Regex::isLiteralERE(Regexp)) {
119107 Entries[Prefix][Category].Strings.insert(Regexp);
4848 EXPECT_FALSE(SCL->inSection("src", "hello", "category"));
4949 }
5050
51 TEST_F(SpecialCaseListTest, GlobalInitCompat) {
51 TEST_F(SpecialCaseListTest, GlobalInit) {
5252 std::unique_ptr SCL =
5353 makeSpecialCaseList("global:foo=init\n");
54 EXPECT_FALSE(SCL->inSection("global", "foo"));
55 EXPECT_FALSE(SCL->inSection("global", "bar"));
56 EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
57 EXPECT_FALSE(SCL->inSection("global", "bar", "init"));
58
59 SCL = makeSpecialCaseList("global-init:foo\n");
6054 EXPECT_FALSE(SCL->inSection("global", "foo"));
6155 EXPECT_FALSE(SCL->inSection("global", "bar"));
6256 EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
6862 EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
6963 EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
7064
71 SCL = makeSpecialCaseList("global-init-type:t2\n");
72 EXPECT_FALSE(SCL->inSection("type", "t1"));
73 EXPECT_FALSE(SCL->inSection("type", "t2"));
74 EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
75 EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
76
7765 SCL = makeSpecialCaseList("src:hello=init\n");
78 EXPECT_FALSE(SCL->inSection("src", "hello"));
79 EXPECT_FALSE(SCL->inSection("src", "bye"));
80 EXPECT_TRUE(SCL->inSection("src", "hello", "init"));
81 EXPECT_FALSE(SCL->inSection("src", "bye", "init"));
82
83 SCL = makeSpecialCaseList("global-init-src:hello\n");
8466 EXPECT_FALSE(SCL->inSection("src", "hello"));
8567 EXPECT_FALSE(SCL->inSection("src", "bye"));
8668 EXPECT_TRUE(SCL->inSection("src", "hello", "init"));