diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 1932413..171a857 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -373,6 +373,7 @@ public:
   OpenBSDTargetInfo(const std::string &triple)
     : OSTargetInfo<Target>(triple) {
       this->UserLabelPrefix = "";
+      this->TLSSupported = false;
 
       llvm::Triple Triple(triple);
       switch (Triple.getArch()) {
diff --git a/test/Driver/tls.c b/test/Driver/tls.c
new file mode 100644
index 0000000..3f30f00
--- /dev/null
+++ b/test/Driver/tls.c
@@ -0,0 +1,21 @@
+// Test that TLS is correctly considered supported or unsupported for the
+// different targets.
+
+// Linux supports TLS.
+// RUN: %clang -c -target i686-pc-linux-gnu %s 2>&1
+// RUN: %clang -c -target i386-pc-linux-gnu %s 2>&1
+
+// Darwin supports TLS since 10.7. (FIXME: Is this correct?)
+// RUN: %clang -c -target x86_64-apple-darwin10 %s 2>&1 | FileCheck --check-prefix=DARWIN %s
+// RUN: %clang -c -target x86_64-apple-darwin10 -mmacosx-version-min=10.7 %s 2>&1
+
+// FIXME: I thought it was supported actually?
+// RUN: %clang -c -target i686-pc-win32 %s 2>&1 | FileCheck --check-prefix=WIN32 %s
+
+// OpenBSD does not suppport TLS.
+// RUN: %clang -c -target i686-pc-openbsd %s 2>&1 | FileCheck --check-prefix=OPENBSD %s
+// RUN: %clang -c -target i386-pc-openbsd %s 2>&1 | FileCheck --check-prefix=OPENBSD %s
+
+__thread int x; // OPENBSD: "error: thread-local storage is unsupported for the current target" \
+                // DARWIN: "error: thread-local storage is unsupported for the current target" \
+                // WIN32: "error: thread-local storage is unsupported for the current target"
