Eric Christopher | 7b3982b | 2010-12-02 02:30:43 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s |
Eli Friedman | 56ebe50 | 2009-04-19 21:05:03 +0000 | [diff] [blame] | 2 | |
Eric Christopher | 7b3982b | 2010-12-02 02:30:43 +0000 | [diff] [blame] | 3 | // CHECK: @b = external thread_local global |
| 4 | // CHECK: @d.e = internal thread_local global |
| 5 | // CHECK: @d.f = internal thread_local global |
| 6 | // CHECK: @a = thread_local global |
Eli Friedman | 56ebe50 | 2009-04-19 21:05:03 +0000 | [diff] [blame] | 7 | __thread int a; |
| 8 | extern __thread int b; |
Eric Christopher | 7b3982b | 2010-12-02 02:30:43 +0000 | [diff] [blame] | 9 | int c() { return *&b; } |
Eli Friedman | 56ebe50 | 2009-04-19 21:05:03 +0000 | [diff] [blame] | 10 | int d() { |
| 11 | __thread static int e; |
| 12 | __thread static union {float a; int b;} f = {.b = 1}; |
Eric Christopher | 7b3982b | 2010-12-02 02:30:43 +0000 | [diff] [blame] | 13 | return 0; |
Eli Friedman | 56ebe50 | 2009-04-19 21:05:03 +0000 | [diff] [blame] | 14 | } |
| 15 | |