]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
test that the &-operator works with __thread
authorAntti Kantee <pooka@iki.fi>
Tue, 5 May 2015 14:07:41 +0000 (14:07 +0000)
committerAntti Kantee <pooka@iki.fi>
Tue, 5 May 2015 14:07:41 +0000 (14:07 +0000)
tests/basic/tls_test.c

index b36f8712bdf5142112820047c4adf1cc5c572e10..e1538992a0190433052709379778ee2e8bba8c5c 100644 (file)
@@ -19,6 +19,7 @@ static __thread unsigned long i = IINITIAL;
 static void *
 wrkthread(void *arg)
 {
+       unsigned long *ip = &i;
 
        printf("Thread %d starting\n", (int)(uintptr_t)arg);
        if (i != IINITIAL) {
@@ -26,6 +27,11 @@ wrkthread(void *arg)
                return NULL;
        }
        i++;
+       if (*ip != IINITIAL+1) {
+               printf("initial *ip incorrect: %lu vs. %d\n", i, IINITIAL+1);
+               return NULL;
+       }
+       i++;
 
        while (c < LOOPCNT) {
                c++;