| 1 |
/* Copyright (C) 2006 Free Software Foundation, Inc. */ |
| 2 |
/* Contributed by Carlos O'Donell on 2006-01-30 */ |
| 3 |
|
| 4 |
/* Test a division corner case where the expression simplifies |
| 5 |
to a comparison, and the optab expansion is wrong. The optab |
| 6 |
expansion emits a function whose return is unbiased and needs |
| 7 |
adjustment. */ |
| 8 |
/* Origin: Carlos O'Donell <[email protected]> */ |
| 9 |
/* { dg-do run } */ |
| 10 |
/* { dg-options "" } */ |
| 11 |
#include <stdlib.h> |
| 12 |
|
| 13 |
#define BIG_CONSTANT 0xFFFFFFFF80000000ULL |
| 14 |
|
| 15 |
int main (void) |
| 16 |
{ |
| 17 |
unsigned long long OneULL = 1ULL; |
| 18 |
unsigned long long result; |
| 19 |
|
| 20 |
result = OneULL / BIG_CONSTANT; |
| 21 |
if (result) |
| 22 |
abort (); |
| 23 |
exit (0); |
| 24 |
} |