summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--setjmp.c21
2 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5a87be0..59f0da7 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ TESTOBJS=main.o \
limits.o \
locale.o \
math.o \
+ setjmp.o \
signal.o \
stdbool.o \
stddef.o \
diff --git a/setjmp.c b/setjmp.c
new file mode 100644
index 0000000..73f7efc
--- /dev/null
+++ b/setjmp.c
@@ -0,0 +1,21 @@
+#include <setjmp.h>
+#include "test.h"
+
+void test_setjmp_h(void)
+{
+ jmp_buf jb;
+ int r;
+ int expected = 0;
+
+ testing_header("setjmp.h");
+
+ r = setjmp(jb);
+ test_int_equals(r, expected);
+
+ if (r == 0) {
+ expected = 1;
+ longjmp(jb, 1);
+ }
+
+ testing_end();
+}