]> granicus.if.org Git - clang/commitdiff
Add test for path-sensitive uninit-val detection involving struct field.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 19 Nov 2008 11:10:42 +0000 (11:10 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 19 Nov 2008 11:10:42 +0000 (11:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59620 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/uninit-vals-ps.c

index 707f78a96bd40a6af7cc987680f43e27d4b7e054..c4c02af55da72cf072fab3f32c81205413b20ff4 100644 (file)
@@ -41,3 +41,21 @@ int f3(void) {
   else
     return 1;
 }
+
+// RUN: clang -checker-simple -analyzer-store-region -verify %s
+
+struct s {
+  int data;
+};
+
+struct s global;
+
+void g(int);
+
+void f4() {
+  int a;
+  if (global.data == 0)
+    a = 3;
+  if (global.data == 0)
+    g(a); // no-warning
+}