summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/thread-specifier.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/thread-specifier.c')
-rw-r--r--clang/test/CodeGen/thread-specifier.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/thread-specifier.c b/clang/test/CodeGen/thread-specifier.c
new file mode 100644
index 0000000..a1f3e16
--- /dev/null
+++ b/clang/test/CodeGen/thread-specifier.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
+
+// CHECK: @b = external thread_local global
+// CHECK: @d.e = internal thread_local global
+// CHECK: @d.f = internal thread_local global
+// CHECK: @a = thread_local global
+__thread int a;
+extern __thread int b;
+int c() { return *&b; }
+int d() {
+ __thread static int e;
+ __thread static union {float a; int b;} f = {.b = 1};
+ return 0;
+}
+