Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/overlapping-buffers-pr113998.c

raw
1 /* Verify we don't ICE on -Wanalyzer-overlapping-buffers on
2 execution paths where the size is constant zero, but the
3 optimizer didn't see that. */
4
5 typedef __SIZE_TYPE__ size_t;
6
7 extern char a[];
8 size_t n;
9
10 size_t __attribute__((noinline))
11 get_hidden_zero ()
12 {
13 return 0;
14 }
15
16 void
17 test_pr113998 ()
18 {
19 size_t n = get_hidden_zero ();
20 __builtin_strncpy (a, a, n); /* { dg-warning "overlapping buffers passed as arguments to" } */
21 }