// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s
// RUN: FileCheck --input-file %t %s
#include "undef-value-callee.h"
// This code used to cause a crash since we were not adding fileID of the header to the plist diagnostic.
int test_calling_unimportant_callee(int argc, char *argv[]) {
int x;
callee();
return x; // expected-warning {{Undefined or garbage value returned to caller}}
}
// CHECK: diagnostics
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: path
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: kindevent
// CHECK-NEXT: location
// CHECK-NEXT:
// CHECK-NEXT: line9
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT: ranges
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line9
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line9
// CHECK-NEXT: col7
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: depth0
// CHECK-NEXT: extended_message
// CHECK-NEXT: 'x' declared without an initial value
// CHECK-NEXT: message
// CHECK-NEXT: 'x' declared without an initial value
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: kindcontrol
// CHECK-NEXT: edges
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: start
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line9
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line9
// CHECK-NEXT: col5
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: end
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col8
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: kindevent
// CHECK-NEXT: location
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT: ranges
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col10
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col10
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: depth0
// CHECK-NEXT: extended_message
// CHECK-NEXT: Undefined or garbage value returned to caller
// CHECK-NEXT: message
// CHECK-NEXT: Undefined or garbage value returned to caller
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: descriptionUndefined or garbage value returned to caller
// CHECK-NEXT: categoryLogic error
// CHECK-NEXT: typeGarbage return value
// CHECK-NEXT: check_namecore.uninitialized.UndefReturn
// CHECK-NEXT:
// CHECK-NEXT: issue_hash_content_of_line_in_context1ef750c5562c09a467ea54ea4b4de771
// CHECK-NEXT: issue_context_kindfunction
// CHECK-NEXT: issue_contexttest_calling_unimportant_callee
// CHECK-NEXT: issue_hash_function_offset3
// CHECK-NEXT: location
// CHECK-NEXT:
// CHECK-NEXT: line11
// CHECK-NEXT: col3
// CHECK-NEXT: file0
// CHECK-NEXT:
// CHECK-NEXT:
// CHECK-NEXT: