1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false -triple x86_64-pc-linux-gnu %s
3 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false -triple i386-pc-linux-gnu %s
5 int clang_analyzer_eval(int);
12 void array_struct_bitfield_1() {
13 BITFIELD_CAST ff
= {0};
14 BITFIELD_CAST
*pff
= &ff
;
15 clang_analyzer_eval(*((int *)pff
+ 1) == 0); // expected-warning{{TRUE}}
17 clang_analyzer_eval(*((int *)pff
+ 1) == 3); // expected-warning{{TRUE}}
20 int array_struct_bitfield_2() {
21 BITFIELD_CAST ff
= {0};
22 BITFIELD_CAST
*pff
= &ff
;
23 int a
= *((int *)pff
+ 2); // expected-warning{{Assigned value is garbage or undefined [core.uninitialized.Assign]}}
34 void array_struct_bitfield_3() {
38 clang_analyzer_eval(*((int *)pff
+ 2) == 3); // expected-warning{{TRUE}}