Skip to content

Commit ac5eba9

Browse files
committed
add test case for PR3135 which was already fixed
llvm-svn: 86273
1 parent d91a796 commit ac5eba9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

clang/test/Analysis/PR3135.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
2+
// PR3135
3+
4+
typedef struct {
5+
int *a;
6+
} structure;
7+
8+
int bar(structure *x);
9+
10+
int foo()
11+
{
12+
int x;
13+
structure y = {&x};
14+
15+
// the call to bar may initialize x
16+
if (bar(&y) && x) // no-warning
17+
return 1;
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)