summaryrefslogtreecommitdiffstats
path: root/test/Analysis/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/malloc.c')
-rw-r--r--test/Analysis/malloc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
index 6a17cba..0c5142b 100644
--- a/test/Analysis/malloc.c
+++ b/test/Analysis/malloc.c
@@ -1,7 +1,9 @@
-// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
+// RUN: clang -cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
void free(void *);
+void *realloc(void *ptr, size_t size);
+void *calloc(size_t nmemb, size_t size);
void f1() {
int *p = malloc(10);
@@ -35,3 +37,9 @@ int *f4() {
p_f4 = malloc(10);
return p_f4; // no-warning
}
+
+int *f5() {
+ int *q = malloc(10);
+ q = realloc(q, 20);
+ return q; // no-warning
+}
OpenPOWER on IntegriCloud