aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr70859-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr70859-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr70859-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr70859-2.c b/gcc/testsuite/gcc.dg/pr70859-2.c
new file mode 100644
index 00000000000..4817852a955
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70859-2.c
@@ -0,0 +1,18 @@
+/* PR c/70859 */
+/* { dg-do compile } */
+
+#include <stdint.h>
+#define MAX __SIZE_MAX__
+#define MAX2 SIZE_MAX
+#define FIVE 5
+
+static void *p;
+
+void
+fn0 (int n)
+{
+ p = __builtin_alloca_with_align (n, SIZE_MAX); /* { dg-error "39:must be a constant integer" } */
+ p = __builtin_alloca_with_align (n, MAX); /* { dg-error "39:must be a constant integer" } */
+ p = __builtin_alloca_with_align (n, MAX2); /* { dg-error "39:must be a constant integer" } */
+ p = __builtin_alloca_with_align (n, FIVE); /* { dg-error "39:must be a constant integer" } */
+}