1 /* Check that the div0s instruction is used for integer sign comparisons. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-final { scan-assembler-times "div0s" 2 } } */
6 typedef struct { unsigned int arg
[100]; } *FunctionCallInfo
;
7 typedef struct { int day
; int month
; } Interval
;
8 void* palloc (unsigned int);
13 interval_pl (FunctionCallInfo fcinfo
)
15 Interval
*span1
= ((Interval
*) ((char *) ((fcinfo
->arg
[0]))));
16 Interval
*span2
= ((Interval
*) ((char *) ((fcinfo
->arg
[1]))));
17 Interval
*result
= (Interval
*) palloc (sizeof (Interval
));
19 /* Should emit 2x div0s. */
20 if ((((span1
->month
) < 0) == ((span2
->month
) < 0))
21 && !(((result
->month
) < 0) == ((span1
->month
) < 0)))
26 result
->day
= span1
->day
+ span2
->day
;