summaryrefslogtreecommitdiff
path: root/test/Analysis/undef-call.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/undef-call.c')
-rw-r--r--test/Analysis/undef-call.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Analysis/undef-call.c b/test/Analysis/undef-call.c
new file mode 100644
index 0000000000000..35c0b685ce7e1
--- /dev/null
+++ b/test/Analysis/undef-call.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -analyze -analyzer-checker=debug.ExprInspection -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=%T/ctudir -verify %s
+// expected-no-diagnostics
+
+struct S {
+ void (*fp)();
+};
+
+int main() {
+ struct S s;
+ // This will cause the analyzer to look for a function definition that has
+ // no FunctionDecl. It used to cause a crash in AnyFunctionCall::getRuntimeDefinition.
+ // It would only occur when CTU analysis is enabled.
+ s.fp();
+}