blob: c7aa844d79824be01f3059f829a5cc16a12a582f [file] [log] [blame]
Ilya Biryukov905a1362018-12-03 11:28:17 +00001// RUN: rm -rf %T/ctudir
2// RUN: mkdir %T/ctudir
Gabor Horvathca7923a2018-04-13 12:36:08 +00003// 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
4// expected-no-diagnostics
5
6struct S {
7 void (*fp)();
8};
9
10int main() {
11 struct S s;
12 // This will cause the analyzer to look for a function definition that has
13 // no FunctionDecl. It used to cause a crash in AnyFunctionCall::getRuntimeDefinition.
14 // It would only occur when CTU analysis is enabled.
15 s.fp();
16}