]> granicus.if.org Git - clang/commitdiff
Add a test for Static Analyzer checker plugins
authorAlp Toker <alp@nuanti.com>
Thu, 9 Jan 2014 00:47:40 +0000 (00:47 +0000)
committerAlp Toker <alp@nuanti.com>
Thu, 9 Jan 2014 00:47:40 +0000 (00:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198820 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/checker-plugins.c [new file with mode: 0644]

diff --git a/test/Analysis/checker-plugins.c b/test/Analysis/checker-plugins.c
new file mode 100644 (file)
index 0000000..3882ba6
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext -analyze -analyzer-checker='example.MainCallChecker' -verify %s
+// REQUIRES: plugins, examples
+
+// Test that the MainCallChecker example analyzer plugin loads and runs.
+
+int main();
+
+void caller() {
+  main(); // expected-warning {{call to main}}
+}