summaryrefslogtreecommitdiffstats
path: root/test/Analysis
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-04 19:58:03 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-04 19:58:03 +0000
commitbb811cab1bfa91074f1992b154fcb0c288e6eda3 (patch)
tree725a0b848635d5aff398fd909f4f4796dbcbedc4 /test/Analysis
parente982cc0ea3e9255b8aacf8f0bff559e9b1cfd72e (diff)
Look through chains of 'x = y = z' when employing silencing heuristics in the DeadStoresChecker.
Fixes <rdar://problem/11185138>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/dead-stores.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index 4c0c1bc130..b8d195d05a 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -526,3 +526,25 @@ void rdar8405222() {
rdar8405222_aux(i);
}
+// Look through chains of assignements, e.g.: int x = y = 0, when employing
+// silencing heuristics.
+int radar11185138_foo() {
+ int x, y;
+ x = y = 0; // expected-warning {{never read}}
+ return y;
+}
+
+int rdar11185138_bar() {
+ int y;
+ int x = y = 0; // no-warning
+ x = 2;
+ y = 2;
+ return x + y;
+}
+
+int *radar11185138_baz() {
+ int *x, *y;
+ x = y = 0; // no-warning
+ return y;
+}
+