summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
index 573b6909b18..9201922f5be 100644
--- a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
+++ b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
@@ -143,6 +143,18 @@ TEST(CallEvent, CallDescription) {
{{{"bar", "foo"}}, false},
{{"foo"}, true},
}), "void foo(); struct bar { void foo(); }; void test() { foo(); }"));
+
+ // Test CDF_MaybeBuiltin - a flag that allows matching weird builtins.
+ EXPECT_TRUE(tooling::runToolOnCode(
+ new CallDescriptionAction({
+ {{"memset", 3}, false},
+ {{CDF_MaybeBuiltin, "memset", 3}, true}
+ }),
+ "void foo() {"
+ " int x;"
+ " __builtin___memset_chk(&x, 0, sizeof(x),"
+ " __builtin_object_size(&x, 0));"
+ "}"));
}
} // namespace
OpenPOWER on IntegriCloud