+
+static void thread_result(void)
+{
+ tap_result(1, "thread runs");
+}
+DEFINE_SIMPLE_THREAD_TEST(check_thread_create, thread_result);
+
+static void err_in_thread(void)
+{
+ const struct cdecl_error *err;
+
+ cdecl__errmsg(CDECL__ENOTYPE);
+ err = cdecl_get_error();
+
+ /*
+ * Ensure that the error returned in this new thread is distinct from
+ * the error returned in the main thread.
+ */
+ tap_diag("thread[2] err: %p", (void *)err);
+ tap_result(thread1_err != err, "thread[2] new state");
+
+ check_simple_err(err, 2, CDECL_ENOPARSE, CDECL__ENOTYPE);
+
+ tap_diag("thread[2] exit");
+}
+DEFINE_SIMPLE_THREAD_TEST(check_err_in_thread, err_in_thread);
+