Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/ftrapv-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Copyright (C) 2004 Free Software Foundation. |
2 | |
3 PR other/15526 | |
4 Verify correct overflow checking with -ftrapv. | |
5 | |
6 Written by Falk Hueffner, 20th May 2004. */ | |
7 | |
8 /* { dg-do run } */ | |
9 /* { dg-options "-ftrapv" } */ | |
10 /* { dg-require-effective-target trapping } */ | |
11 | |
12 __attribute__((noinline)) int | |
13 mulv(int a, int b) | |
14 { | |
15 return a * b; | |
16 } | |
17 | |
18 int | |
19 main() | |
20 { | |
21 mulv( 0, 0); | |
22 mulv( 0, -1); | |
23 mulv(-1, 0); | |
24 mulv(-1, -1); | |
25 return 0; | |
26 } |