aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/malloc.c')
-rw-r--r--test/Analysis/malloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
index 32c6171f8c..1fc874349e 100644
--- a/test/Analysis/malloc.c
+++ b/test/Analysis/malloc.c
@@ -776,6 +776,13 @@ int rdar11269741(struct rdar11269741_b_t o)
return p->n.m; // expected-warning {{leak}}
}
+// Pointer arithmetic, returning an ElementRegion.
+void *radar11329382(unsigned bl) {
+ void *ptr = malloc (16);
+ ptr = ptr + (2 - bl);
+ return ptr; // no warning
+}
+
// ----------------------------------------------------------------------------
// Below are the known false positives.