Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / divmod-6.c
blob495ebaff80514e89a9a7b438a2e659b880c3fc2a
1 /* { dg-require-effective-target divmod } */
2 /* { dg-options "-O2 -fdump-tree-widening_mul-details" } */
4 typedef int SImode __attribute__((mode(SI)));
5 typedef unsigned USImode __attribute__((mode(SI)));
7 typedef int DImode __attribute__((mode(DI)));
8 typedef unsigned UDImode __attribute__((mode(DI)));
10 extern int cond;
11 void foo(void);
13 #define FOO(smalltype, bigtype, no) \
14 bigtype f_##no(smalltype x, bigtype y) \
15 { \
16 bigtype q = x / y; \
17 bigtype r1 = 0, r2 = 0; \
18 if (cond) \
19 r1 = x % y; \
20 else \
21 r2 = x % y; \
22 return q + r1 + r2; \
25 FOO(SImode, DImode, 3)
26 FOO(SImode, UDImode, 4)
27 FOO(USImode, DImode, 6)
28 FOO(USImode, UDImode, 7)
29 FOO(DImode, DImode, 8)
30 FOO(DImode, UDImode, 9)
31 FOO(UDImode, UDImode, 10)
33 /* { dg-final { scan-tree-dump-times "DIVMOD" 7 "widening_mul" } } */