2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr78973.c
blob6c53f896233c4b82dca7e5bec3e0018f15d46ce8
1 /* PR c/78973 - warning: ‘memcpy’: specified size exceeds maximum object size
3 Test case for what was initially thought to be a false positive but after
4 deeper investigation turned out to be a true positive.
6 { dg-do compile }
7 { dg-options "-O2 -Wall" } */
9 void f (void *p, int n)
11 if (n <= 4)
12 __builtin_memset (p, 0, n); /* { dg-warning "exceeds maximum object size" "pr79073" { xfail ilp32 } } */
15 void g (void *d, unsigned n)
17 if (n < 5)
18 n = 5;
19 f (d, n);