George Karpenkov | 3916509 | 2018-06-12 19:07:41 +0000 | [diff] [blame] | 1 | // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s |
Hubert Tong | 61c848d | 2019-06-11 14:21:32 +0000 | [diff] [blame] | 2 | // RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/undef-value-caller.c.plist - |
Anna Zaks | 4ff9097 | 2012-06-04 21:03:31 +0000 | [diff] [blame] | 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. |
Anna Zaks | 5d4ec36 | 2012-08-29 21:22:37 +0000 | [diff] [blame] | 7 | |
Anna Zaks | 4ff9097 | 2012-06-04 21:03:31 +0000 | [diff] [blame] | 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 | } |
Ted Kremenek | 54baf2e | 2012-06-05 22:00:52 +0000 | [diff] [blame] | 13 | |