From f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:50:09 +0000 Subject: Vendor import of lldb release_39 branch r276489: https://llvm.org/svn/llvm-project/lldb/branches/release_39@276489 --- packages/Python/lldbsuite/test/lang/c/tls_globals/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'packages/Python/lldbsuite/test/lang/c/tls_globals/main.c') diff --git a/packages/Python/lldbsuite/test/lang/c/tls_globals/main.c b/packages/Python/lldbsuite/test/lang/c/tls_globals/main.c index cbe01b89b7ef..73e32ca39a58 100644 --- a/packages/Python/lldbsuite/test/lang/c/tls_globals/main.c +++ b/packages/Python/lldbsuite/test/lang/c/tls_globals/main.c @@ -11,6 +11,10 @@ #include void shared_check(); +// On some OS's (darwin) you must actually access a thread local variable +// before you can read it +int +touch_shared(); // Create some TLS storage within the static executable. __thread int var_static = 44; @@ -28,9 +32,11 @@ int main (int argc, char const *argv[]) { pthread_t handle; pthread_create(&handle, NULL, &fn_static, NULL); + touch_shared(); + for (; var_static;) + { + usleep(1); // main breakpoint + } - for(;;) - usleep(1); // main breakpoint - - return 0; + return 0; } -- cgit v1.2.3