Debian Codegraph @

gcc/testsuite/gcc.dg/fixed-point/loop-index.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-std=gnu99" } */
3
4 /* C99 6.8.5.2: The for statement.
5 Based on the test from ../dfp/. */
6
7 extern void abort (void);
8
9 #define FUNC(TYPE,NAME,PF) \
10 void \
11 NAME (void) \
12 { \
13 TYPE d; \
14 int i; \
15 for (d = 0.1 ## PF, i = 0; d <= 0.8 ## PF; d += 0.1 ## PF) \
16 i++; \
17 if (i != 8) \
18 abort(); \
19 }
20
21 FUNC (short _Fract, sf, hr)
22 FUNC (_Fract, f, r)
23 FUNC (long _Fract, lf, lr)
24 FUNC (long long _Fract, llf, llr)
25 FUNC (unsigned short _Fract, usf, uhr)
26 FUNC (unsigned _Fract, uf, ur)
27 FUNC (unsigned long _Fract, ulf, ulr)
28 FUNC (unsigned long long _Fract, ullf, ullr)
29 FUNC (_Sat short _Fract, Ssf, hr)
30 FUNC (_Sat _Fract, Sf, r)
31 FUNC (_Sat long _Fract, Slf, lr)
32 FUNC (_Sat long long _Fract, Sllf, llr)
33 FUNC (_Sat unsigned short _Fract, Susf, uhr)
34 FUNC (_Sat unsigned _Fract, Suf, ur)
35 FUNC (_Sat unsigned long _Fract, Sulf, ulr)
36 FUNC (_Sat unsigned long long _Fract, Sullf, ullr)
37 FUNC (short _Accum, sa, hk)
38 FUNC (_Accum, a, k)
39 FUNC (long _Accum, la, lk)
40 FUNC (long long _Accum, lla, llk)
41 FUNC (unsigned short _Accum, usa, uhk)
42 FUNC (unsigned _Accum, ua, uk)
43 FUNC (unsigned long _Accum, ula, ulk)
44 FUNC (unsigned long long _Accum, ulla, ullk)
45 FUNC (_Sat short _Accum, Ssa, hk)
46 FUNC (_Sat _Accum, Sa, k)
47 FUNC (_Sat long _Accum, Sla, lk)
48 FUNC (_Sat long long _Accum, Slla, llk)
49 FUNC (_Sat unsigned short _Accum, Susa, uhk)
50 FUNC (_Sat unsigned _Accum, Sua, uk)
51 FUNC (_Sat unsigned long _Accum, Sula, ulk)
52 FUNC (_Sat unsigned long long _Accum, Sulla, ullk)
53
54 int
55 main ()
56 {
57 sf ();
58 f ();
59 lf ();
60 llf ();
61 usf ();
62 uf ();
63 ulf ();
64 ullf ();
65 Ssf ();
66 Sf ();
67 Slf ();
68 Sllf ();
69 Susf ();
70 Suf ();
71 Sulf ();
72 Sullf ();
73 sa ();
74 a ();
75 la ();
76 lla ();
77 usa ();
78 ua ();
79 ula ();
80 ulla ();
81 Ssa ();
82 Sa ();
83 Sla ();
84 Slla ();
85 Susa ();
86 Sua ();
87 Sula ();
88 Sulla ();
89
90 return 0;
91 }