aboutsummaryrefslogtreecommitdiff
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
commitafb32f721a416e7a96f0fa3f05a9a363a67507dc (patch)
treeef5098a5962b2e49904ac393837f98b5d68fcf93
parentbfe69955a2efb969839b6d87d7e118044ea3cbb4 (diff)
add test case for PR3135 which was already fixed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86273 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/PR3135.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Analysis/PR3135.c b/test/Analysis/PR3135.c
new file mode 100644
index 0000000000..1fca57b47b
--- /dev/null
+++ b/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;
+}