Implement C _FloatN, _FloatNx types.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr70724.c
blobd4cffb38ab1356ea8ee042d8564b67164174825d
1 /* { dg-do run } */
2 /* { dg-additional-options "-ftracer" } */
4 extern void abort (void);
6 typedef long int _PyTime_t;
7 typedef enum { _PyTime_ROUND_FLOOR = 0, _PyTime_ROUND_CEILING = 1 }
8 _PyTime_round_t;
10 static _PyTime_t
11 _PyTime_Divide(const _PyTime_t t, const _PyTime_t k,
12 const _PyTime_round_t round)
14 if (round == _PyTime_ROUND_CEILING) {
15 if (t >= 0)
16 return (t + k - 1) / k;
17 else
18 return t / k;
20 else {
21 if (t >= 0)
22 return t / k;
23 else
24 return (t - (k - 1)) / k;
28 _PyTime_t __attribute__((noinline,noclone))
29 _PyTime_AsMicroseconds(_PyTime_t t, _PyTime_round_t round)
31 return _PyTime_Divide(t, 1000, round);
34 int main()
36 if (_PyTime_AsMicroseconds (10000, _PyTime_ROUND_FLOOR) != 10)
37 abort ();
38 return 0;