PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloc-size-larger-than-17.c
blob752371af2e751bdf62daa8655ac59b3ee04f4566
1 /* PR middle-end/82063 - issues with arguments enabled by -Wall
2 { dg-do compile }
3 { dg-options "-O -Wno-alloc-size-larger-than -ftrack-macro-expansion=0" } */
5 typedef __SIZE_TYPE__ size_t;
7 void sink (void*);
9 #define T(x) sink (x)
11 void f (void)
13 size_t n = 0;
14 T (__builtin_malloc (n));
16 n = __PTRDIFF_MAX__;
17 T (__builtin_malloc (n));
19 n += 1;
20 T (__builtin_malloc (n));
22 n = __SIZE_MAX__ - 1;
23 T (__builtin_malloc (n));
25 n = __SIZE_MAX__;
26 T (__builtin_malloc (n));