1/* { dg-do compile { target { ! x32 } } } */
2/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkpopt-details" } */
3/* { dg-final { scan-tree-dump "Moving creation of \[^ \]+ down to its use" "chkpopt" } } */
4/* { dg-final { cleanup-tree-dump "chkpopt" } } */
5
6extern int arr[];
7
8int test (int i)
9{
10  int res;
11  if (i >= 0)
12    res = arr[i];
13  else
14    res = -i;
15  return res;
16}
17