From: Zhongxing Xu Date: Wed, 19 Nov 2008 11:10:42 +0000 (+0000) Subject: Add test for path-sensitive uninit-val detection involving struct field. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89e8a07af3e24ae0f843b80906422d711f73de0a;p=clang Add test for path-sensitive uninit-val detection involving struct field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59620 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c index 707f78a96b..c4c02af55d 100644 --- a/test/Analysis/uninit-vals-ps.c +++ b/test/Analysis/uninit-vals-ps.c @@ -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 +}