Index: test/Sema/wchar.c
===================================================================
--- test/Sema/wchar.c	(revision 85809)
+++ test/Sema/wchar.c	(working copy)
@@ -1,12 +1,12 @@
-// RUN: clang-cc %s -fsyntax-only -verify 
+// RUN: clang-cc %s -fshort-wchar -fsyntax-only -verify 
 #include <wchar.h>
 
 int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];
 
 void foo() {
-  int t1[] = L"x";
+  unsigned short t1[] = L"x";
   wchar_t tab[] = L"x";
 
-  int t2[] = "x";     // expected-error {{initialization}}
+  unsigned short t2[] = "x";     // expected-error {{initialization}}
   char t3[] = L"x";   // expected-error {{initialization}}
 }
Index: include/clang/Basic/TargetInfo.h
===================================================================
--- include/clang/Basic/TargetInfo.h	(revision 85809)
+++ include/clang/Basic/TargetInfo.h	(working copy)
@@ -346,6 +346,11 @@
   /// options.
   virtual void getDefaultLangOptions(LangOptions &Opts) {}
 
+  /// setForcedLangOptions - Set forced language options.
+  /// Apply changes to the target information with respect to certain
+  /// language options which change the target configuration.
+  virtual void setForcedLangOptions(LangOptions &Opts);
+
   /// getDefaultFeatures - Get the default set of target features for
   /// the \args CPU; this should include all legal feature strings on
   /// the target.
Index: include/clang/Basic/LangOptions.h
===================================================================
--- include/clang/Basic/LangOptions.h	(revision 85809)
+++ include/clang/Basic/LangOptions.h	(working copy)
@@ -83,6 +83,7 @@
   unsigned AccessControl     : 1; // Whether C++ access control should
                                   // be enabled.
   unsigned CharIsSigned      : 1; // Whether char is a signed or unsigned type
+  unsigned ShortWChar        : 1; // Force wchar_t to be unsigned short int.
 
   unsigned OpenCL            : 1; // OpenCL C99 language extensions.
 
@@ -159,6 +160,7 @@
     NoInline = 0;
 
     CharIsSigned = 1;
+	ShortWChar = 0;
 
     MainFileName = 0;
   }
Index: tools/clang-cc/clang-cc.cpp
===================================================================
--- tools/clang-cc/clang-cc.cpp	(revision 85809)
+++ tools/clang-cc/clang-cc.cpp	(working copy)
@@ -615,7 +615,11 @@
 CharIsSigned("fsigned-char",
     llvm::cl::desc("Force char to be a signed/unsigned type"));
 
+static llvm::cl::opt<bool>
+ShortWChar("fshort-wchar",
+    llvm::cl::desc("Force wchar_t to be a short unsigned int"));
 
+
 static llvm::cl::opt<bool>
 Trigraphs("trigraphs", llvm::cl::desc("Process trigraph sequences"));
 
@@ -813,6 +817,8 @@
     Options.Blocks = EnableBlocks;
   if (CharIsSigned.getPosition())
     Options.CharIsSigned = CharIsSigned;
+	if (ShortWChar.getPosition())
+		Options.ShortWChar = ShortWChar;
 
   if (!AllowBuiltins)
     Options.NoBuiltin = 1;
@@ -877,6 +883,8 @@
 
   if (MainFileName.getPosition())
     Options.setMainFileName(MainFileName.c_str());
+
+	Target->setForcedLangOptions(Options);
 }
 
 //===----------------------------------------------------------------------===//
Index: lib/Basic/TargetInfo.cpp
===================================================================
--- lib/Basic/TargetInfo.cpp	(revision 85809)
+++ lib/Basic/TargetInfo.cpp	(working copy)
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Basic/LangOptions.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/STLExtras.h"
 #include <cstdlib>
@@ -124,6 +125,15 @@
   };
 }
 
+/// setForcedLangOptions - Set forced language options.
+/// Apply changes to the target information with respect to certain
+/// language options which change the target configuration.
+void TargetInfo::setForcedLangOptions(LangOptions &Opts) {
+	if (Opts.ShortWChar) {
+    WCharType = UnsignedShort;
+    WCharWidth = WCharAlign = 16;
+	}
+}
 
 //===----------------------------------------------------------------------===//
 
