/* { dg-additional-options "-fanalyzer-call-summaries --param analyzer-min-snodes-for-call-summary=0" } */
+/* { dg-require-effective-target alloca } */
/* There need to be at least two calls to a function for the
call-summarization code to be used.
+/* { dg-require-effective-target alloca } */
+
#include <stdlib.h>
/* Tests warn on use of floating-point operands inside the calculation
+/* { dg-require-effective-target alloca } */
+
typedef __SIZE_TYPE__ size_t;
int test_alloca_1 (void)
+/* { dg-require-effective-target alloca } */
+
#include <stdlib.h>
typedef void *(*allocator_t) (size_t);
/* { dg-additional-options "-Wno-unused-but-set-variable" } */
+/* { dg-require-effective-target alloca } */
#include <string.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <alloca.h>
#include <stdint.h>
/* Tests with symbolic values. */
if (!buf) return;
buf[size] = '\0'; /* { dg-warning "heap-based buffer overflow" } */
- free (buf);
+ __builtin_free (buf);
}
void test2 (size_t size)
if (!buf) return;
buf[size + 1] = '\0'; /* { dg-warning "heap-based buffer overflow" } */
- free (buf);
+ __builtin_free (buf);
}
void test3 (size_t size, size_t op)
if (!buf) return;
buf[size + op] = '\0'; /* { dg-warning "heap-based buffer overflow" } */
- free (buf);
+ __builtin_free (buf);
}
void test4 (size_t size, unsigned short s)
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
+/* { dg-require-effective-target alloca } */
#include <stdio.h>
#include <stdlib.h>
notes) works. */
/* { dg-additional-options "-fanalyzer-show-duplicate-count" } */
+/* { dg-require-effective-target alloca } */
#include "analyzer-decls.h"