[ARM] Pass thumb as architecture to the underlying tools, when targeting windows

This makes sure that the thumb section flag gets set by the assembler.

Patch by Martin Storsjö.

llvm-svn: 276869
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 91b3641..e5e17a5 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -493,8 +493,10 @@
       ArchName = "arm";
 
     // Assembly files should start in ARM mode, unless arch is M-profile.
+    // Windows is always thumb.
     if ((InputType != types::TY_PP_Asm && Args.hasFlag(options::OPT_mthumb,
-         options::OPT_mno_thumb, ThumbDefault)) || IsMProfile) {
+         options::OPT_mno_thumb, ThumbDefault)) || IsMProfile ||
+         getTriple().isOSWindows()) {
       if (IsBigEndian)
         ArchName = "thumbeb";
       else
diff --git a/clang/test/Driver/windows-thumb.s b/clang/test/Driver/windows-thumb.s
new file mode 100644
index 0000000..afe5b2d
--- /dev/null
+++ b/clang/test/Driver/windows-thumb.s
@@ -0,0 +1,2 @@
+; RUN: %clang -target armv7-windows -c -### %s 2>&1 | FileCheck %s
+; CHECK: "-triple" "thumbv7-