44
55void clang_analyzer_eval (bool );
66void clang_analyzer_value (int );
7+ void clang_analyzer_dump (int );
78
89// Tests doing an out-of-bounds access after the end of an array using:
910// - constant integer index
@@ -206,11 +207,15 @@ int using_assume_attr_has_no_sideeffects(int y) {
206207 int orig_y = y;
207208 clang_analyzer_value (y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
208209 clang_analyzer_value (orig_y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
210+ clang_analyzer_dump (y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
211+ clang_analyzer_dump (orig_y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
209212
210213 // We should not apply sideeffects of the argument of [[assume(...)]].
211214 // "y" should not get incremented;
212215 [[assume (++y == 43 )]]; // expected-warning {{assumption is ignored because it contains (potential) side-effects}}
213216
217+ clang_analyzer_dump (y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
218+ clang_analyzer_dump (orig_y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
214219 clang_analyzer_value (y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
215220 clang_analyzer_value (orig_y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
216221 clang_analyzer_eval (y == orig_y); // expected-warning {{TRUE}} Good.
@@ -222,11 +227,15 @@ int using_builtin_assume_has_no_sideeffects(int y) {
222227 int orig_y = y;
223228 clang_analyzer_value (y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
224229 clang_analyzer_value (orig_y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
230+ clang_analyzer_dump (y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
231+ clang_analyzer_dump (orig_y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
225232
226233 // We should not apply sideeffects of the argument of __builtin_assume(...)
227234 // "u" should not get incremented;
228235 __builtin_assume (++y == 43 ); // expected-warning {{assumption is ignored because it contains (potential) side-effects}}
229236
237+ clang_analyzer_dump (y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
238+ clang_analyzer_dump (orig_y); // expected-warning-re {{{{^}}reg_${{[0-9]+}}<int y> [debug.ExprInspection]{{$}}}}
230239 clang_analyzer_value (y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
231240 clang_analyzer_value (orig_y); // expected-warning {{32s:{ [-2147483648, 2147483647] }}}
232241 clang_analyzer_eval (y == orig_y); // expected-warning {{TRUE}} Good.
0 commit comments