[cfe-commits] r59620 - /cfe/trunk/test/Analysis/uninit-vals-ps.c
Zhongxing Xu
xuzhongxing at gmail.com
Wed Nov 19 03:10:42 PST 2008
Author: zhongxingxu
Date: Wed Nov 19 05:10:42 2008
New Revision: 59620
URL: http://llvm.org/viewvc/llvm-project?rev=59620&view=rev
Log:
Add test for path-sensitive uninit-val detection involving struct field.
Modified:
cfe/trunk/test/Analysis/uninit-vals-ps.c
Modified: cfe/trunk/test/Analysis/uninit-vals-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps.c?rev=59620&r1=59619&r2=59620&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals-ps.c Wed Nov 19 05:10:42 2008
@@ -41,3 +41,21 @@
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
+}
More information about the cfe-commits
mailing list