// RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - %s | FileCheck %s
// Test blacklist functionality.
-// RUN: echo "global-init-src:%s" > %t-file.blacklist
-// RUN: echo "global-init-type:PODWithCtorAndDtor" > %t-type.blacklist
+// RUN: echo "src:%s=init" > %t-file.blacklist
+// RUN: echo "type:PODWithCtorAndDtor=init" > %t-type.blacklist
// RUN: echo "type:NS::PODWithCtor=init" >> %t-type.blacklist
// RUN: %clang_cc1 -fsanitize=address -fsanitize-blacklist=%t-file.blacklist -emit-llvm -o - %s | FileCheck %s --check-prefix=BLACKLIST
// RUN: %clang_cc1 -fsanitize=address -fsanitize-blacklist=%t-type.blacklist -emit-llvm -o - %s | FileCheck %s --check-prefix=BLACKLIST
EXPECT_FALSE(SCL->inSection("src", "hello", "category"));
}
-TEST_F(SpecialCaseListTest, GlobalInitCompat) {
+TEST_F(SpecialCaseListTest, GlobalInit) {
std::unique_ptr<SpecialCaseList> SCL =
makeSpecialCaseList("global:foo=init\n");
EXPECT_FALSE(SCL->inSection("global", "foo"));
EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
EXPECT_FALSE(SCL->inSection("global", "bar", "init"));
- SCL = makeSpecialCaseList("global-init:foo\n");
- EXPECT_FALSE(SCL->inSection("global", "foo"));
- EXPECT_FALSE(SCL->inSection("global", "bar"));
- EXPECT_TRUE(SCL->inSection("global", "foo", "init"));
- EXPECT_FALSE(SCL->inSection("global", "bar", "init"));
-
SCL = makeSpecialCaseList("type:t2=init\n");
EXPECT_FALSE(SCL->inSection("type", "t1"));
EXPECT_FALSE(SCL->inSection("type", "t2"));
EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
- SCL = makeSpecialCaseList("global-init-type:t2\n");
- EXPECT_FALSE(SCL->inSection("type", "t1"));
- EXPECT_FALSE(SCL->inSection("type", "t2"));
- EXPECT_FALSE(SCL->inSection("type", "t1", "init"));
- EXPECT_TRUE(SCL->inSection("type", "t2", "init"));
-
SCL = makeSpecialCaseList("src:hello=init\n");
EXPECT_FALSE(SCL->inSection("src", "hello"));
EXPECT_FALSE(SCL->inSection("src", "bye"));
EXPECT_TRUE(SCL->inSection("src", "hello", "init"));
EXPECT_FALSE(SCL->inSection("src", "bye", "init"));
-
- SCL = makeSpecialCaseList("global-init-src:hello\n");
- EXPECT_FALSE(SCL->inSection("src", "hello"));
- EXPECT_FALSE(SCL->inSection("src", "bye"));
- EXPECT_TRUE(SCL->inSection("src", "hello", "init"));
- EXPECT_FALSE(SCL->inSection("src", "bye", "init"));
}
TEST_F(SpecialCaseListTest, Substring) {