summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-03-01 21:49:01 -0500
committerJakob Kaivo <jkk@ung.org>2019-03-01 21:49:01 -0500
commit6d9ef3245dfc8cbcc2e1d3f28e05090f1ed766a8 (patch)
tree3676d601081ce2b43224c9c2d0bb3d2d5825ef3f
parent306613c5a17842fc6967f9a9a3722a63767c3b75 (diff)
skeletons for C11/C18 functions
-rw-r--r--Makefile5
-rw-r--r--main.c10
-rw-r--r--stdalign.c22
-rw-r--r--stdatomic.c18
-rw-r--r--stdnoreturn.c23
-rw-r--r--threads.c18
-rw-r--r--uchar.c23
7 files changed, 114 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 9d75446..8b06b28 100644
--- a/Makefile
+++ b/Makefile
@@ -20,15 +20,20 @@ TESTOBJS=main.o \
math.o \
setjmp.o \
signal.o \
+ stdalign.o \
stdarg.o \
+ stdatomic.o \
stdbool.o \
stddef.o \
stdint.o \
stdio.o \
stdlib.o \
+ stdnoreturn.o \
string.o \
tgmath.o \
+ threads.o \
time.o \
+ uchar.o \
wchar.o \
wctype.o \
test.o
diff --git a/main.c b/main.c
index a7444d9..8c6de36 100644
--- a/main.c
+++ b/main.c
@@ -52,20 +52,20 @@ int main(int argc, char *argv[])
test_math_h();
/* test_setjmp_h(); */
test_signal_h();
- /* test_stdalign_h(); */
+ test_stdalign_h();
test_stdarg_h();
- /* test_stdatomic_h(); */
+ test_stdatomic_h();
test_stdbool_h();
test_stddef_h();
test_stdint_h();
test_stdio_h();
test_stdlib_h();
- /* test_stdnoreturn_h(); */
+ test_stdnoreturn_h();
test_string_h();
test_tgmath_h();
- /* test_threads_h(); */
+ test_threads_h();
test_time_h();
- /* test_uchar_h(); */
+ test_uchar_h();
test_wchar_h();
test_wctype_h();
diff --git a/stdalign.c b/stdalign.c
new file mode 100644
index 0000000..9fd58bc
--- /dev/null
+++ b/stdalign.c
@@ -0,0 +1,22 @@
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__
+#include <stdalign.h>
+#include "test.h"
+
+void test_stdalign_h(void)
+{
+ testing_header("stdalign.h");
+
+ /* alignas() */
+ /* alignof() */
+
+ test_defined(__alignas_is_defined);
+ test_defined(__alignof_is_defined);
+
+ testing_end();
+}
+
+#else
+void test_stdalign_h(void)
+{
+}
+#endif
diff --git a/stdatomic.c b/stdatomic.c
new file mode 100644
index 0000000..932b8b5
--- /dev/null
+++ b/stdatomic.c
@@ -0,0 +1,18 @@
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__ && ! defined __STDC_NO_ATOMICS__
+#include <stdatomic.h>
+#include "test.h"
+
+void test_stdatomic_h(void)
+{
+ testing_header("stdatomic.h");
+
+ /* TODO */
+
+ testing_end();
+}
+
+#else
+void test_stdatomic_h(void)
+{
+}
+#endif
diff --git a/stdnoreturn.c b/stdnoreturn.c
new file mode 100644
index 0000000..1b73017
--- /dev/null
+++ b/stdnoreturn.c
@@ -0,0 +1,23 @@
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__
+#include <stdnoreturn.h>
+#include "test.h"
+
+noreturn void foo(void)
+{
+ for (;;);
+}
+
+void test_stdnoreturn_h(void)
+{
+ testing_header(".h");
+
+ /* tested by the fact that this compiles */
+
+ testing_end();
+}
+
+#else
+void test_stdnoreturn_h(void)
+{
+}
+#endif
diff --git a/threads.c b/threads.c
new file mode 100644
index 0000000..abc2629
--- /dev/null
+++ b/threads.c
@@ -0,0 +1,18 @@
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__ && ! defined __STDC_NO_THREADS__
+#include <threads.h>
+#include "test.h"
+
+void test_threads_h(void)
+{
+ testing_header("threads.h");
+
+ /* TODO */
+
+ testing_end();
+}
+
+#else
+void test_threads_h(void)
+{
+}
+#endif
diff --git a/uchar.c b/uchar.c
new file mode 100644
index 0000000..80e9234
--- /dev/null
+++ b/uchar.c
@@ -0,0 +1,23 @@
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__
+#include <uchar.h>
+#include "test.h"
+
+void test_uchar_h(void)
+{
+ mbstate_t mbstate;
+ size_t size;
+ char16_t char16;
+ char32_t char32;
+
+ testing_header("uchar.h");
+
+ /* TODO */
+
+ testing_end();
+}
+
+#else
+void test_uchar_h(void)
+{
+}
+#endif