Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / divmod-6-simode.c
blob1107f760b429520335cbbec20657a3d19671cbf3
1 /* { dg-require-effective-target divmod_simode } */
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
4 typedef int SImode __attribute__((mode(SI)));
5 typedef unsigned USImode __attribute__((mode(SI)));
7 extern int cond;
8 void foo(void);
10 #define FOO(smalltype, bigtype, no) \
11 bigtype f_##no(smalltype x, bigtype y) \
12 { \
13 bigtype q = x / y; \
14 bigtype r1 = 0, r2 = 0; \
15 if (cond) \
16 r1 = x % y; \
17 else \
18 r2 = x % y; \
19 return q + r1 + r2; \
22 FOO(SImode, SImode, 1)
23 FOO(SImode, USImode, 2)
24 FOO(USImode, USImode, 3)
26 /* { dg-final { scan-tree-dump-times "DIVMOD" 3 "widening_mul" } } */