diff gcc/testsuite/gcc.dg/pr70859-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/pr70859-2.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,21 @@
+/* PR c/70859 */
+/* { dg-do compile } */
+
+#ifdef _AIX
+#define _ISOC99_SOURCE
+#endif
+#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" } */
+}