summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/vla-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/analyzer/vla-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/vla-1.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/analyzer/vla-1.c b/gcc/testsuite/gcc.dg/analyzer/vla-1.c
index e5971c835fa..9561d742c3a 100644
--- a/gcc/testsuite/gcc.dg/analyzer/vla-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/vla-1.c
@@ -12,3 +12,12 @@ void test_1 (int n)
s.b = 17;
__analyzer_eval (s.b == 17); /* { dg-warning "TRUE" } */
}
+
+void test_2 (int n)
+{
+ int arr[n]; /* { dg-message "region created on stack here" } */
+ __builtin_free (arr); /* { dg-warning "'free' of '<unknown>' which points to memory on the stack" } */
+ // TODO: fix the "unknown" here
+}
+
+/* { dg-prune-output "\\\[-Wfree-nonheap-object" } */