summaryrefslogtreecommitdiffstats
path: root/test/Analysis/diagnostics/undef-value-caller.c
blob: 0beefd6e538a664269a4ddb6f784becf179bf2fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s
// RUN: cat %t | %diff_plist %S/Inputs/expected-plists/undef-value-caller.c.plist

#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}}
}