Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/pr29801.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* We used to crash in ccp here, because the initial constant value of 2 was changed to 5. */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ static const int a = 2; int test (int param) { int *p = (int *) &a; if (param) *p = 5; return a; } /* Check that we return the correct (unchanged) value. */ /* { dg-final { scan-tree-dump-times "return 2" 1 "optimized" } } */ /* { dg-final { scan-tree-dump-times "return 5" 0 "optimized" } } */