]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/gcc.dg/c90-const-expr-6.c
large-size-array-2.c: Fix target requirement.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c90-const-expr-6.c
index 50de3a9525f80f0b752e8b048c5e4dfd8a0bcc77..c432cca63434f0ab7964199734645fadac208906 100644 (file)
@@ -4,11 +4,13 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
 
+__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
 /* PR 29116.  */
 int n = 0, p[n * 0 + 1]; /* { dg-error "variabl|can't be evaluated" } */
 
 /* PR 31871.  */
-extern int c[1 + ((__PTRDIFF_TYPE__) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+extern int c[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
 
 /* Implicit conversions from floating-point constants are not OK,
    although explicit ones are.  */
@@ -32,7 +34,7 @@ struct s {
 };
 
 enum e {
-  E = (1 + ((__PTRDIFF_TYPE__) (void *) 0)), /* { dg-error "constant" } */
+  E = (1 + ((ptrdiff_t) (void *) 0)), /* { dg-error "constant" } */
   E2 = 0
 };
 
@@ -44,7 +46,7 @@ enum f {
 void
 f (int a)
 {
-  int v[1 + ((__PTRDIFF_TYPE__) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+  int v[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
   switch (a)
     {
     case (n * 0 + 1): /* { dg-error "constant" } */