[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Analysis / loop-block-counts.c
blob9af67b1b632f517de102078accb8c6cdbf2e078f
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
3 void clang_analyzer_eval(int);
5 void callee(void **p) {
6 int x;
7 *p = &x;
8 // expected-warning@-1 {{Address of stack memory associated with local \
9 variable 'x' is still referred to by the stack variable 'arr' upon \
10 returning to the caller}}
13 void loop(void) {
14 void *arr[2];
15 for (int i = 0; i < 2; ++i)
16 callee(&arr[i]);
17 // FIXME: Should be UNKNOWN.
18 clang_analyzer_eval(arr[0] == arr[1]); // expected-warning{{FALSE}}
21 void loopWithCall(void) {
22 void *arr[2];
23 for (int i = 0; i < 2; ++i) {
24 int x;
25 arr[i] = &x;
27 // FIXME: Should be UNKNOWN.
28 clang_analyzer_eval(arr[0] == arr[1]); // expected-warning{{TRUE}}