1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
3 int printf(const char *restrict
,...);
5 // Testing core functionality of the region store.
7 int compoundLiteralTest(void) {
9 for (index
= 0; index
< 2; index
++) {
10 int thing
= (int []){0, 1}[index
];
11 printf("thing: %i\n", thing
);
16 int compoundLiteralTest2(void) {
18 for (index
= 0; index
< 3; index
++) {
19 int thing
= (int [][3]){{0,0,0}, {1,1,1}, {2,2,2}}[index
][index
];
20 printf("thing: %i\n", thing
);
25 int concreteOffsetBindingIsInvalidatedBySymbolicOffsetAssignment(int length
,
29 return values
[0]; // no-warning
35 int initStruct(struct X
*st
);
36 int structOffsetBindingIsInvalidated(int length
, int i
){
39 return l
.mem
; // no-warning
42 void clang_analyzer_eval(int);
43 void testConstraintOnRegionOffset(int *values
, int length
, int i
){
46 clang_analyzer_eval(values
[1] == 4);// expected-warning {{UNKNOWN}}
50 int initArray(int *values
);
51 void testConstraintOnRegionOffsetStack(int *values
, int length
, int i
) {
54 clang_analyzer_eval(values
[0] == 4);// expected-warning {{UNKNOWN}}