]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/undef-call.c
Vendor import of clang trunk r338150:
[FreeBSD/FreeBSD.git] / test / Analysis / undef-call.c
1 // 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
2 // expected-no-diagnostics
3
4 struct S {
5   void (*fp)();
6 };
7
8 int main() {
9   struct S s;
10   // This will cause the analyzer to look for a function definition that has
11   // no FunctionDecl. It used to cause a crash in AnyFunctionCall::getRuntimeDefinition.
12   // It would only occur when CTU analysis is enabled.
13   s.fp();
14 }