1 /* { dg-do compile } */ 2 /* { dg-options "-O -fdump-tree-ccp1" } */ 3 4 static const int x; 5 test1(void)6int test1 (void) 7 { 8 char *p = "hello"; 9 int i = x; 10 i = i + 5; 11 return p[i]; 12 } 13 test2(void)14int test2 (void) 15 { 16 int i = x; 17 i = i + 5; 18 return "hello"[i]; 19 } 20 21 /* { dg-final { scan-tree-dump-times "return 0;" 2 "ccp1" } } */ 22