Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr19807.C
blobcbe06b4ce62f1d958433af5acb231a86a9853a10
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
4 int a[4];
5 int *x, *y, *z;
7 void foo(void)
9         x = &a[3] - 1;
10         y = &a[1] + 1;
11         z = 1 + &a[1];
14 /* { dg-final { scan-tree-dump-times "&MEM\\\[\\\(void .\\\)&a \\\+ 8B\\\]" 3 "optimized" } } */
17 void bar(int i)
19         x = &a[i] - 1;
20         y = &a[i] + 1;
21         z = 1 + &a[i];
24 /* We can't get &a[i +- 1] in the final code and it is not clear we
25    want this.  Instead we get to see &a[i] and pointer offsetting
26    by 4 and -4U.  */