1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config eagerly-assume=false -verify %s
5 void clang_analyzer_value(T x
);
6 void clang_analyzer_value();
7 template <typename T1
, typename T2
>
8 void clang_analyzer_value(T1 x
, T2 y
);
11 clang_analyzer_value(x
); // expected-warning{{8s:{ [-128, 127] }}}
13 clang_analyzer_value(x
); // expected-warning{{8s:{ [43, 127] }}}
15 clang_analyzer_value(x
); // expected-warning{{8s:42}}
19 clang_analyzer_value(x
); // expected-warning{{16s:{ [-32768, 32767] }}}
21 clang_analyzer_value(x
); // expected-warning{{16s:{ [-32768, 4199] }}}
23 clang_analyzer_value(x
); // expected-warning{{16s:4200}}
26 void test3(unsigned long long x
) {
27 clang_analyzer_value(x
); // expected-warning{{64u:{ [0, 18446744073709551615] }}}
29 clang_analyzer_value(x
); // expected-warning{{64u:{ [0, 41999999], [42000001, 18446744073709551615] }}}
30 if (x
== 18446744073709551615ull)
31 clang_analyzer_value(x
); // expected-warning{{64u:18446744073709551615}}
36 clang_analyzer_value(s
); // expected-warning{{n/a}}
40 clang_analyzer_value(); // expected-warning{{Missing argument}}
43 void test6(int x
, int y
) {
44 if (x
== 42 && y
== 24)
46 clang_analyzer_value(x
, y
); // expected-warning{{32s:42}}