From f0c829a6c9c116700257e53dc723d6497ecffb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Sat, 3 Jan 2015 02:10:51 +0100 Subject: [PATCH] Added a main() to atomic.c --- test/atomic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/atomic.c b/test/atomic.c index 6232ae0..ecec137 100644 --- a/test/atomic.c +++ b/test/atomic.c @@ -1,3 +1,5 @@ +#include + #include "ucore/atomic.h" UC_ATOMIC(unsigned int) i; @@ -48,3 +50,20 @@ unsigned int get_i_compbar() } +int main(int argc, char *argv[]) +{ + printf("i: %u\n", get_i()); + inc_i(); + printf("i: %u\n", get_i()); + inc_i(); + dec_i(); + printf("i: %u\n", get_i()); + add_i(100); + printf("i: %u\n", get_i()); + sub_i(50); + printf("i: %u\n", get_i_membar()); + + + return 0; +} +