2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr81908.c
blobb1e316a527c3eea3f88c5ed06064b2b8eab863ac
1 /* PR 81908 - FAIL: gfortran.dg/alloc_comp_auto_array_2.f90 -O3 -g -m32
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
5 #define SIZE_MAX __SIZE_MAX__
6 typedef __SIZE_TYPE__ size_t;
8 void f0 (char *d, const char *s, size_t n)
10 if (n > 0 && n <= SIZE_MAX / 2 - 1)
11 n = 0;
13 __builtin_memcpy (d, s, n);
16 void f1 (char *d, const char *s, size_t n)
18 if (n > 0 && n <= SIZE_MAX / 2)
19 n = 0;
21 __builtin_memcpy (d, s, n); /* { dg-bogus "\\\[-Wstringop-overflow=]" } */
24 void f2 (char *d, const char *s, size_t n)
26 if (n > 0 && n <= SIZE_MAX / 2 + 1)
27 n = 0;
29 __builtin_memcpy (d, s, n);
32 void f3 (char *d, const char *s, size_t n)
34 if (n > 0 && n <= SIZE_MAX - 1)
35 n = 0;
37 __builtin_memcpy (d, s, n); /* { dg-bogus "\\\[-Wstringop-overflow=]" } */
40 void f4 (char *d, const char *s, size_t n)
42 if (n > 0 && n <= SIZE_MAX)
43 n = 0;
45 __builtin_memcpy (d, s, n);