]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Warray-bounds-42.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-42.c
1 /* PR tree-optimization/89720 - Spurious -Warray-bounds warning on a range
2 with max < min
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6 void f (char*, int);
7
8 #if __SIZEOF_POINTER__ == 8
9
10 void g (__INT64_TYPE__ i)
11 {
12 char a[65536] = "";
13 char *p = a + (i & (__INT64_TYPE__)0xffffffff3fffffffLL);
14 f (p, *(p - 6)); /* { dg-bogus "\\\[-Warray-bounds" } */
15 }
16
17 #elif __SIZEOF_POINTER__ == 4
18
19 void h (__INT32_TYPE__ i)
20 {
21 char a[65536] = "";
22 char *p = a + (i & (__INT32_TYPE__)0x8fffffffLL);
23 f (p, *(p - 6)); /* { dg-bogus "\\\[-Warray-bounds" } */
24 }
25
26 #endif