17 lines · c
1// RUN: rm -rf %t.dir/ctudir2// RUN: mkdir -p %t.dir/ctudir3// RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=%t.dir/ctudir -verify %s4// expected-no-diagnostics5 6struct S {7 void (*fp)(void);8};9 10int main(void) {11 struct S s;12 // This will cause the analyzer to look for a function definition that has13 // 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}17