diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-19 11:10:42 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-19 11:10:42 +0000 |
commit | 89e8a07af3e24ae0f843b80906422d711f73de0a (patch) | |
tree | 8dde1b0bb15de47910058eee86625cef729c25cb | |
parent | c3a0599bac9dabbae9481674313aa6e1a26159b6 (diff) |
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
-rw-r--r-- | test/Analysis/uninit-vals-ps.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 +} |