LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloc-size-larger-than-15.c
blobb699cc09c22a29ff6f64e86f22f8d213ac9b254f
1 /* PR middle-end/82063 - issues with arguments enabled by -Wall
2 { dg-do compile }
3 { dg-options "-O -Walloc-size-larger-than=123456789123456789123456789123456789gb -ftrack-macro-expansion=0" } */
5 typedef __SIZE_TYPE__ size_t;
7 void sink (void*);
9 #define T(x) sink (x)
11 /* Verify that an exceeingly large -Walloc-size-larger-than argument
12 with a valid suffic is accepted and treated as infinite. */
14 void f (void)
16 size_t n = 0;
17 T (__builtin_malloc (n));
19 n = __PTRDIFF_MAX__;
20 T (__builtin_malloc (n));
22 n += 1;
23 T (__builtin_malloc (n));
25 n = __SIZE_MAX__ - 1;
26 T (__builtin_malloc (n));
28 n = __SIZE_MAX__;
29 T (__builtin_malloc (n));