tests: use signed printf format
[model-checker.git] / test / userprog.c
index 645dc30..b75947e 100644 (file)
@@ -1,8 +1,8 @@
 #include <stdio.h>
+#include <threads.h>
+#include <stdatomic.h>
 
-#include "libthreads.h"
 #include "librace.h"
-#include "stdatomic.h"
 
 atomic_int x;
 atomic_int y;
@@ -11,17 +11,17 @@ static void a(void *obj)
 {
        int r1=atomic_load_explicit(&y, memory_order_relaxed);
        atomic_store_explicit(&x, r1, memory_order_relaxed);
-       printf("r1=%u\n",r1);
+       printf("r1=%d\n",r1);
 }
 
 static void b(void *obj)
 {
        int r2=atomic_load_explicit(&x, memory_order_relaxed);
        atomic_store_explicit(&y, 42, memory_order_relaxed);
-       printf("r2=%u\n",r2);
+       printf("r2=%d\n",r2);
 }
 
-void user_main()
+int user_main(int argc, char **argv)
 {
        thrd_t t1, t2;
 
@@ -35,4 +35,6 @@ void user_main()
        thrd_join(t1);
        thrd_join(t2);
        printf("Thread %d is finished\n", thrd_current());
+
+       return 0;
 }