aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-07-24 21:02:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-07-24 21:02:14 +0000
commit56df4a9e0461d4dfb2a740cb6b0ce531d6c82538 (patch)
treeeeae98f192c70ed7048602921ff2813a3aee93b2 /test/Sema/uninit-variables.c
parent00c59f7ed2814f67d6d7e844479ea99eca9e55ef (diff)
When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before checking for the && / || special cases. Finally, fix some crashes in CFG printing in the presence of calls to destructors for array of array of class type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r--test/Sema/uninit-variables.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c
index 9257751e47..634ae0dc42 100644
--- a/test/Sema/uninit-variables.c
+++ b/test/Sema/uninit-variables.c
@@ -503,3 +503,8 @@ int compound_assign_3() {
x *= 0; // expected-warning {{variable 'x' is uninitialized}}
return x;
}
+
+int self_init_in_cond(int *p) {
+ int n = ((p && (0 || 1)) && (n = *p)) ? n : -1; // ok
+ return n;
+}