]> granicus.if.org Git - clang/commitdiff
add test case for PR3135 which was already fixed
authorNuno Lopes <nunoplopes@sapo.pt>
Fri, 6 Nov 2009 18:42:13 +0000 (18:42 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Fri, 6 Nov 2009 18:42:13 +0000 (18:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86273 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/PR3135.c [new file with mode: 0644]

diff --git a/test/Analysis/PR3135.c b/test/Analysis/PR3135.c
new file mode 100644 (file)
index 0000000..1fca57b
--- /dev/null
@@ -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;
+}