Adjust scan string for PIE
[official-gcc.git] / gcc / testsuite / gcc.dg / setjmp-1.c
blobb5c84fc8792da3418bff517d5dc8aa7e112fc392
1 /* Test for bogus "variable `x' may be clobbered by longjmp" warnings.
2 Inspired by cse.c:simplify_relational_operation. */
4 /* { dg-do compile } */
5 /* { dg-options "-O -Wclobbered -Wextra -Wall" } */
7 #include <setjmp.h>
9 extern void set_float_handler (jmp_buf *);
11 #define EQ 0x01
12 #define LT 0x02
13 #define GT 0x04
15 int
16 compare_float (double a, double b) /* { dg-bogus "clobbered" "spurious clobbered warning" } */
18 jmp_buf handler;
19 int result;
21 a += 1.0;
23 if (setjmp (handler))
25 set_float_handler (0);
26 return 0;
29 set_float_handler (&handler);
30 if (a == b) result = EQ;
31 else if (a > b) result = LT;
32 else if (a < b) result = GT;
33 else result = 0;
34 set_float_handler (0);
35 return result;