blob: da62a6f5071af195e8518e67e7051b16dd74bdf1 [file] [log] [blame]
Kirstóf Umann1c8f9992020-04-05 19:53:22 +02001// RUN: %clang_analyze_cc1 %s -verify \
2// RUN: -analyzer-checker=core \
3// RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=true \
4// RUN: -analyzer-output=plist -o %t.plist
5// RUN: cat %t.plist | FileCheck %s
6
7// RUN: %clang_analyze_cc1 %s -verify=no-pointee \
8// RUN: -analyzer-checker=core \
9// RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=false
10
11// no-pointee-no-diagnostics
12
13void doStuff_pointerToConstInt(const int *u){};
14void pointee_uninit() {
15 int i;
16 int *p = &i;
17 doStuff_pointerToConstInt(p); // expected-warning{{1st function call argument is a pointer to uninitialized value [core.CallAndMessage]}}
18}
19
20// TODO: If this hash ever changes, turn
21// core.CallAndMessage:ArgPointeeInitializedness from a checker option into a
22// checker, as described in the CallAndMessage comments!
23// CHECK: <key>issue_hash_content_of_line_in_context</key>
24// CHECK-SAME: <string>97a74322d64dca40aa57303842c745a1</string>