Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized" } */ + +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ uint32_t; +#else + typedef unsigned uint32_t; +#endif + +int f(uint32_t a){ + uint32_t b=5; + uint32_t c=a-b; + return c>a; +} +int g(uint32_t a){ + uint32_t b=32; + uint32_t c=a+b; + return c<a; +} + +/* { dg-final { scan-tree-dump "a_\[0-9\]+.D. <= 4;" "optimized" } } */ +/* { dg-final { scan-tree-dump "a_\[0-9\]+.D. > 4294967263;" "optimized" } } */