clang-cl: implement /fallback mode

When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

Differential Revision: http://llvm-reviews.chandlerc.com/D1711

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191034 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Driver/cl-fallback.c b/test/Driver/cl-fallback.c
new file mode 100644
index 0000000..ce7e245
--- /dev/null
+++ b/test/Driver/cl-fallback.c
@@ -0,0 +1,22 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /LD /LDd \
+// RUN:     /MD /MDd /MTd /MT -### -- %s 2>&1 | FileCheck %s
+// CHECK: ||
+// CHECK: cl.exe
+// CHECK: "/c"
+// CHECK: "/W0"
+// CHECK: "-D" "foo=bar"
+// CHECK: "-U" "baz"
+// CHECK: "-I" "foo"
+// CHECK: "-O3"
+// CHECK: "/GR-"
+// CHECK: "/LD"
+// CHECK: "/LDd"
+// CHECK: "/MT"
+// CHECK: "/Tc" "{{.*cl-fallback.c}}"
+// CHECK: "/Fo{{.*cl-fallback.*.obj}}"