xref: /aosp_15_r20/external/clang/test/Analysis/default-diagnostic-visitors.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s
2*67e74705SXin Li 
3*67e74705SXin Li // This file is for testing enhanced diagnostics produced by the default BugReporterVisitors.
4*67e74705SXin Li 
getPasswordAndItem()5*67e74705SXin Li int getPasswordAndItem()
6*67e74705SXin Li {
7*67e74705SXin Li   int err = 0;
8*67e74705SXin Li   int *password; // expected-note {{'password' declared without an initial value}}
9*67e74705SXin Li   if (password == 0) { // expected-warning {{The left operand of '==' is a garbage value}} // expected-note {{The left operand of '==' is a garbage value}}
10*67e74705SXin Li     err = *password;
11*67e74705SXin Li   }
12*67e74705SXin Li   return err;
13*67e74705SXin Li }
14