1 // RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -verify %s \
2 // RUN: -analyzer-checker=core.builtin \
3 // RUN: -analyzer-checker=debug.ExprInspection \
4 // RUN: -analyzer-checker=unix.cstring \
5 // RUN: -analyzer-config display-checker-name=false
11 void clang_analyzer_explain_int(int);
12 void clang_analyzer_explain_voidp(void *);
13 void clang_analyzer_explain_S(struct S
);
17 void test_1(int param
, void *ptr
) {
18 clang_analyzer_explain_voidp(&glob
); // expected-warning-re{{{{^pointer to global variable 'glob'$}}}}
19 clang_analyzer_explain_int(param
); // expected-warning-re{{{{^argument 'param'$}}}}
20 clang_analyzer_explain_voidp(ptr
); // expected-warning-re{{{{^argument 'ptr'$}}}}
22 clang_analyzer_explain_int(param
); // expected-warning-re{{{{^signed 32-bit integer '42'$}}}}
25 void test_2(struct S s
) {
26 clang_analyzer_explain_S(s
); //expected-warning-re{{{{^lazily frozen compound value of parameter 's'$}}}}
27 clang_analyzer_explain_voidp(&s
); // expected-warning-re{{{{^pointer to parameter 's'$}}}}
28 clang_analyzer_explain_int(s
.z
); // expected-warning-re{{{{^initial value of field 'z' of parameter 's'$}}}}
31 void test_3(int param
) {
32 clang_analyzer_explain_voidp(¶m
); // expected-warning-re{{{{^pointer to parameter 'param'$}}}}
35 void test_non_top_level(int param
) {
36 clang_analyzer_explain_voidp(¶m
); // expected-warning-re{{{{^pointer to parameter 'param'$}}}}
40 test_non_top_level(n
);