X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Ftest%2Fthread.c;h=f48f60adcf438e80bc53f29e1d2244a33faad4a2;hb=1872920c09708b361d06c0dc9f4c1fd0a03544f5;hp=33012f0804a885efa065c9cf1917aa7de9251252;hpb=e07cafb892eb97773bd9b4b9c0210700515cab4d;p=libfirm diff --git a/ir/be/test/thread.c b/ir/be/test/thread.c index 33012f080..f48f60adc 100644 --- a/ir/be/test/thread.c +++ b/ir/be/test/thread.c @@ -1,6 +1,18 @@ +#ifdef _WIN32 #define __thread __declspec( thread ) -__thread int tls_i = 1; +#endif -int test(void) { - return tls_i; -} \ No newline at end of file +__thread int tls_i[10]; +__thread int tls_j = 5; + +int test(int i) { + tls_j = i; + return tls_i[i]; +} + +int main() +{ + printf("tls_i: %d\n", test(3)); + printf("tls_j: %d\n", tls_j); + return 0; +}