1 /* Copyright (C) 2004 Free Software Foundation.
4 Verify that -ftrapv doesn't produce bogus results
7 Written by Eric Botcazou */
10 /* { dg-options "-ftrapv" } */
11 /* { dg-require-effective-target trapping } */
13 extern void abort(void);
15 extern long labs(long);
17 int __attribute__((noinline
))
23 int __attribute__((noinline
))
29 int __attribute__((noinline
))
35 int __attribute__((noinline
))
41 int __attribute__((noinline
))
47 long __attribute__((noinline
))
53 long __attribute__((noinline
))
59 long __attribute__((noinline
))
65 long __attribute__((noinline
))
71 long __attribute__((noinline
))
82 if (iaddv (2,-3) != -1)
85 if (isubv (2,3) != -1)
88 if (imulv (-2,3) != -6)
94 if (labsv (-1L) != 1L)
97 if (laddv (2L,-3L) != -1L)
100 if (lsubv (2L,3L) != -1L)
103 if (lmulv (-2L,3L) != -6L)
106 if (lnegv (-1L) != 1L)