mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
1368b914e9
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
35 lines
452 B
C
35 lines
452 B
C
/* Check that setjmp and longjmp stand a chance to work; that the used machine
|
|
primitives work in the simulator. */
|
|
|
|
#include <stdio.h>
|
|
#include <setjmp.h>
|
|
#include <stdlib.h>
|
|
|
|
extern void f (void);
|
|
|
|
int ok = 0;
|
|
jmp_buf b;
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int ret = setjmp (b);
|
|
|
|
if (ret == 42)
|
|
ok = 100;
|
|
else if (ret == 0)
|
|
f ();
|
|
|
|
if (ok == 100)
|
|
printf ("pass\n");
|
|
else
|
|
printf ("fail\n");
|
|
exit (0);
|
|
}
|
|
|
|
void
|
|
f (void)
|
|
{
|
|
longjmp (b, 42);
|
|
}
|