Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloc-size-larger-than-7.c
blob5188203337d36f718f7049cbb85a3ae01b936ff4
1 /* PR middle-end/82063 - issues with arguments enabled by -Wall
2 { dg-do compile }
3 { dg-options "-O -Walloc-size-larger-than=1GB -ftrack-macro-expansion=0" } */
5 void sink (void*);
7 #define T(x) sink (x)
9 void f (void)
11 __SIZE_TYPE__ n = 0;
12 T (__builtin_malloc (n));
14 n = 1000 * 1000 * 1000; /* 1 gigabyte (GB) */
15 T (__builtin_malloc (n));
17 n += 1;
18 T (__builtin_malloc (n)); /* { dg-warning "argument 1 value .1000000001. exceeds maximum object size 1000000000" } */
20 n = __PTRDIFF_MAX__;
21 T (__builtin_malloc (n)); /* { dg-warning "exceeds maximum object size" } */
23 n = __SIZE_MAX__;
24 T (__builtin_malloc (n)); /* { dg-warning "exceeds maximum object size" } */