xref: /llvm-project/clang/test/Analysis/diagnostics/undef-value-caller.c (revision 61c848d2549b5fa4e09776bb0a2d5306e001cb66)
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s
2 // RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/undef-value-caller.c.plist -
3 
4 #include "undef-value-callee.h"
5 
6 // This code used to cause a crash since we were not adding fileID of the header to the plist diagnostic.
7 
test_calling_unimportant_callee(int argc,char * argv[])8 int test_calling_unimportant_callee(int argc, char *argv[]) {
9   int x;
10   callee();
11   return x; // expected-warning {{Undefined or garbage value returned to caller}}
12 }
13 
14