]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Walloc-size-larger-than-14.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Walloc-size-larger-than-14.c
CommitLineData
d258f4aa
MS
1/* PR middle-end/82063 - issues with arguments enabled by -Wall
2 { dg-do compile }
3 { dg-options "-O -Walloc-size-larger-than=123456789123456789123456789123456789 -ftrack-macro-expansion=0" } */
4
5typedef __SIZE_TYPE__ size_t;
6
7void sink (void*);
8
9#define T(x) sink (x)
10
11/* Verify that an exceedingly large -Walloc-size-larger-than argument
12 with no suffix is accepted and treated as infinite. */
13
14void f (void)
15{
16 size_t n = 0;
17 T (__builtin_malloc (n));
18
19 n = __PTRDIFF_MAX__;
20 T (__builtin_malloc (n));
21
22 n += 1;
23 T (__builtin_malloc (n));
24
25 n = __SIZE_MAX__ - 1;
26 T (__builtin_malloc (n));
27
28 n = __SIZE_MAX__;
29 T (__builtin_malloc (n));
30}