1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -Wno-objc-literal-conversion %s
3 void clang_analyzer_eval(bool);
7 clang_analyzer_eval(@""); // expected-warning{{TRUE}}
8 clang_analyzer_eval(@"abc"); // expected-warning{{TRUE}}
11 namespace rdar13773117 {
12 NSString *const kConstantGlobalString = @"foo";
13 NSString *globalString = @"bar";
15 extern void invalidateGlobals();
18 clang_analyzer_eval(kConstantGlobalString); // expected-warning{{TRUE}}
19 clang_analyzer_eval(globalString); // expected-warning{{UNKNOWN}}
21 globalString = @"baz";
22 clang_analyzer_eval(globalString); // expected-warning{{TRUE}}
26 clang_analyzer_eval(kConstantGlobalString); // expected-warning{{TRUE}}
27 clang_analyzer_eval(globalString); // expected-warning{{UNKNOWN}}
30 NSString *returnString(NSString *input = @"garply") {
34 void testDefaultArg() {
35 clang_analyzer_eval(returnString(@"")); // expected-warning{{TRUE}}
36 clang_analyzer_eval(returnString(0)); // expected-warning{{FALSE}}
37 clang_analyzer_eval(returnString()); // expected-warning{{TRUE}}