PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20120427-1.c
blob46ed76ae9430d4545426894f91fe287aa0a98b15
1 typedef struct sreal
3 unsigned sig; /* Significant. */
4 int exp; /* Exponent. */
5 } sreal;
7 sreal_compare (sreal *a, sreal *b)
9 if (a->exp > b->exp)
10 return 1;
11 if (a->exp < b->exp)
12 return -1;
13 if (a->sig > b->sig)
14 return 1;
15 return -(a->sig < b->sig);
18 sreal a[] = {
19 { 0, 0 },
20 { 1, 0 },
21 { 0, 1 },
22 { 1, 1 }
25 int main()
27 int i, j;
28 for (i = 0; i <= 3; i++) {
29 for (j = 0; j < 3; j++) {
30 if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort();
31 if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort();
32 if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort();
35 return 0;