Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/Walloc-size-larger-than-14.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
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 | |
5 typedef __SIZE_TYPE__ size_t; | |
6 | |
7 void 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 | |
14 void 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 } |