summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-11-06 18:42:13 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-11-06 18:42:13 +0000
commitac5eba93ca9cefd9618cde047a3ec45d15f39d14 (patch)
tree70190b55e3ee320f7ac9bb2067c4d07c2d982165 /clang
parentd91a7960bfc8ed39e3d8377fa209832fb73c5d53 (diff)
downloadbcm5719-llvm-ac5eba93ca9cefd9618cde047a3ec45d15f39d14.tar.gz
bcm5719-llvm-ac5eba93ca9cefd9618cde047a3ec45d15f39d14.zip
add test case for PR3135 which was already fixed
llvm-svn: 86273
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/PR3135.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Analysis/PR3135.c b/clang/test/Analysis/PR3135.c
new file mode 100644
index 00000000000..1fca57b47b5
--- /dev/null
+++ b/clang/test/Analysis/PR3135.c
@@ -0,0 +1,20 @@
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
+// PR3135
+
+typedef struct {
+ int *a;
+} structure;
+
+int bar(structure *x);
+
+int foo()
+{
+ int x;
+ structure y = {&x};
+
+ // the call to bar may initialize x
+ if (bar(&y) && x) // no-warning
+ return 1;
+
+ return 0;
+}
OpenPOWER on IntegriCloud