Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/divmod-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/divmod-1.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,32 @@ +/* { dg-require-effective-target divmod } */ +/* { dg-options "-O2 -fdump-tree-widening_mul-details" } */ +/* div dominates mod. */ + +typedef int SImode __attribute__((mode(SI))); +typedef unsigned USImode __attribute__((mode(SI))); + +typedef int DImode __attribute__((mode(DI))); +typedef unsigned UDImode __attribute__((mode(DI))); + +extern int cond; +void foo(void); + +#define FOO(smalltype, bigtype, no) \ +bigtype f_##no(smalltype x, bigtype y) \ +{ \ + bigtype q = x / y; \ + if (cond) \ + foo (); \ + bigtype r = x % y; \ + return q + r; \ +} + +FOO(SImode, DImode, 1) +FOO(SImode, UDImode, 2) +FOO(USImode, DImode, 3) +FOO(USImode, UDImode, 4) +FOO(DImode, DImode, 5) +FOO(DImode, UDImode, 6) +FOO(UDImode, UDImode, 7) + +/* { dg-final { scan-tree-dump-times "DIVMOD" 7 "widening_mul" } } */