diff options
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests/gcov-32.c')
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/gcov-32.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-32.c b/gcc/testsuite/gcc.misc-tests/gcov-32.c new file mode 100644 index 0000000..cb8da01 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-32.c @@ -0,0 +1,25 @@ +/* { dg-options "--coverage -fpath-coverage -g -O2" } */ +/* { dg-do compile } */ +/* { dg-require-effective-target sigsetjmp } */ + +#include <setjmp.h> + +extern sigjmp_buf jmpbuf; +typedef void (*sfun) (void); +extern sfun getfn (int); + +/* This distilled srunner setup/teardown functions in check-0.15.2. The + combination of setjmp, optimization, and debug statements causes a problem + if the gimple statement iterator is not positioned correctely before adding + instrumentation code. */ + +extern void +debug_after_labels (int *itr) +{ + for (; *itr; ++itr) + { + sfun fn = getfn (*itr); + if (setjmp (jmpbuf) == 0) + fn (); + } +} |