for check gcc version.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mzta
Date:
Thu Oct 22 10:34:44 2015 +0000
Parent:
1:74efec1a152d
Commit message:
Add test code for __sync_synchronize() compiling

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 74efec1a152d -r 50d77aa2ab58 main.cpp
--- a/main.cpp	Thu Oct 22 10:14:15 2015 +0000
+++ b/main.cpp	Thu Oct 22 10:34:44 2015 +0000
@@ -2,6 +2,20 @@
 
 Serial pc(USBTX, USBRX);
 
+int global;
+bool complete;
+
+void worker_do_something(int i) {
+    global = i;
+    __sync_synchronize();
+    complete = true;
+}
+
+void wait_complete() {
+    while(!complete) {}
+    printf("%d\n", global);
+}
+
 int main() {
     pc.printf("ARMCC_VERSION=%d\n", __ARMCC_VERSION);
 #if defined(__GNUC__)