Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/builtin-object-size-18.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
131 | 1 /* { dg-do compile } */ |
2 /* { dg-options "-O2 -fdump-tree-optimized" } */ | |
3 /* __stpncpy_chk could return buf up to buf + 64, so | |
4 the minimum object size might be far smaller than 64. */ | |
5 /* { dg-final { scan-tree-dump-not "return 64;" "optimized" } } */ | |
6 | |
7 typedef __SIZE_TYPE__ size_t; | |
8 | |
9 size_t | |
10 foo (const char *p, size_t s, size_t t) | |
11 { | |
12 char buf[64]; | |
13 char *q = __builtin___stpncpy_chk (buf, p, s, t); | |
14 return __builtin_object_size (q, 2); | |
15 } |