2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / divmod-2-simode.c
blobfa28beb3cef48c99841d0fb2b9157ed2c3ce26c9
1 /* { dg-require-effective-target divmod_simode } */
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
3 /* mod dominates div. */
5 typedef int SImode __attribute__((mode(SI)));
6 typedef unsigned USImode __attribute__((mode(SI)));
8 extern int cond;
9 void foo(void);
11 #define FOO(smalltype, bigtype, no) \
12 bigtype f_##no(smalltype x, bigtype y) \
13 { \
14 bigtype r = x % y; \
15 if (cond) \
16 foo (); \
17 bigtype q = x / y; \
18 return q + r; \
21 FOO(SImode, SImode, 1)
22 FOO(SImode, USImode, 2)
23 FOO(USImode, USImode, 3)
25 /* { dg-final { scan-tree-dump-times "DIVMOD" 3 "widening_mul" } } */