Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/divmod-2.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-require-effective-target divmod } */ | |
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */ | |
3 /* mod dominates div. */ | |
4 | |
5 typedef int SImode __attribute__((mode(SI))); | |
6 typedef unsigned USImode __attribute__((mode(SI))); | |
7 | |
8 typedef int DImode __attribute__((mode(DI))); | |
9 typedef unsigned UDImode __attribute__((mode(DI))); | |
10 | |
11 extern int cond; | |
12 void foo(void); | |
13 | |
14 #define FOO(smalltype, bigtype, no) \ | |
15 bigtype f_##no(smalltype x, bigtype y) \ | |
16 { \ | |
17 bigtype r = x % y; \ | |
18 if (cond) \ | |
19 foo (); \ | |
20 bigtype q = x / y; \ | |
21 return q + r; \ | |
22 } | |
23 | |
24 FOO(SImode, DImode, 1) | |
25 FOO(SImode, UDImode, 2) | |
26 FOO(USImode, DImode, 3) | |
27 FOO(USImode, UDImode, 4) | |
28 FOO(DImode, DImode, 5) | |
29 FOO(DImode, UDImode, 6) | |
30 FOO(UDImode, UDImode, 7) | |
31 | |
32 /* { dg-final { scan-tree-dump-times "DIVMOD" 7 "widening_mul" } } */ |