2018-12-03 19:28:17 +08:00
|
|
|
// RUN: rm -rf %T/ctudir
|
|
|
|
// RUN: mkdir %T/ctudir
|
2018-04-13 20:36:08 +08:00
|
|
|
// 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();
|
|
|
|
}
|