PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / divmod-4.c
blob861ecbdec4b874c1277bbd54d7ffcc262c87b84b
1 /* { dg-require-effective-target divmod } */
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
3 /* mod comes before div in same bb. */
5 typedef int SImode __attribute__((mode(SI)));
6 typedef unsigned USImode __attribute__((mode(SI)));
8 typedef int DImode __attribute__((mode(DI)));
9 typedef unsigned UDImode __attribute__((mode(DI)));
11 extern int cond;
12 void foo(void);
14 #define FOO(smalltype, bigtype, no) \
15 bigtype f_##no(smalltype x, bigtype y) \
16 { \
17 bigtype r = x % y; \
18 bigtype q = x / y; \
19 return q + r; \
22 FOO(SImode, DImode, 3)
23 FOO(SImode, UDImode, 4)
24 FOO(USImode, DImode, 6)
25 FOO(USImode, UDImode, 7)
26 FOO(DImode, DImode, 8)
27 FOO(DImode, UDImode, 9)
28 FOO(UDImode, UDImode, 10)
30 /* { dg-final { scan-tree-dump-times "DIVMOD" 7 "widening_mul" } } */