Change-Id: Ib5c2a176e0108b1fa20cbd0d156fb1f29139b8fa
# tests
+INCLUDE(FindPkgConfig)
+
set(CMAKE_C_FLAGS "-g -O0 -fno-omit-frame-pointer")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
add_executable(test1-sleep test1.c)
add_executable(test1-ill test1.c)
+pkg_check_modules (GLIB2 glib-2.0)
+
+add_executable(test2 test2.c)
+target_include_directories(test2 SYSTEM PUBLIC ${GLIB2_INCLUDE_DIRS})
+target_link_libraries(test2 ${GLIB2_LDFLAGS})
--- /dev/null
+#include <glib.h>
+
+gboolean crasher(gpointer data)
+{
+ *(int*)data = 1;
+ return TRUE;
+}
+
+int main()
+{
+ GMainLoop *loop = g_main_loop_new(NULL, FALSE);
+
+ GSource *idle_source = g_idle_source_new();
+ g_source_set_callback(idle_source, crasher, NULL, NULL);
+ g_source_attach(idle_source, g_main_context_ref_thread_default());
+
+ g_main_loop_run(loop);
+
+ return 0;
+}