1 // RUN: %clang_cc1 -triple=i386-apple-darwin10 -verify %s -analyze \
2 // RUN: -analyzer-checker=debug.ExprInspection
5 void clang_analyzer_eval(int);
7 // pr28449: Used to crash.
9 static const unsigned short array
[] = (const unsigned short[]){0x0F00};
10 clang_analyzer_eval(array
[0] == 0x0F00); // expected-warning{{TRUE}}
13 // check that we propagate info through compound literal regions
15 int *integers
= (int[]){1, 2, 3};
16 clang_analyzer_eval(integers
[0] == 1); // expected-warning{{TRUE}}
17 clang_analyzer_eval(integers
[1] == 2); // expected-warning{{TRUE}}
18 clang_analyzer_eval(integers
[2] == 3); // expected-warning{{TRUE}}
20 int **pointers
= (int *[]){&integers
[0], NULL
};
21 clang_analyzer_eval(pointers
[0] == NULL
); // expected-warning{{FALSE}}
22 clang_analyzer_eval(pointers
[1] == NULL
); // expected-warning{{TRUE}}