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-skip-if "no HI mode trapping arith funcs" { xstormy16-*-* } { "*" } { "" } } */
13 extern void abort(void);
14 extern long labs(long);
16 int __attribute__((noinline))
22 int __attribute__((noinline))
28 int __attribute__((noinline))
34 int __attribute__((noinline))
40 int __attribute__((noinline))
46 long __attribute__((noinline))
52 long __attribute__((noinline))
58 long __attribute__((noinline))
64 long __attribute__((noinline))
70 long __attribute__((noinline))
81 if (iaddv (2,-3) != -1)
84 if (isubv (2,3) != -1)
87 if (imulv (-2,3) != -6)
93 if (labsv (-1L) != 1L)
96 if (laddv (2L,-3L) != -1L)
99 if (lsubv (2L,3L) != -1L)
102 if (lmulv (-2L,3L) != -6L)
105 if (lnegv (-1L) != 1L)