Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99054 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Driver/cc-print-options.c b/test/Driver/cc-print-options.c
new file mode 100644
index 0000000..7b798cb
--- /dev/null
+++ b/test/Driver/cc-print-options.c
@@ -0,0 +1,7 @@
+// RUN: env CC_PRINT_OPTIONS=1 \
+// RUN:     CC_PRINT_OPTIONS_FILE=%t.log \
+// RUN: %clang -S -o %t.s %s
+// RUN: FileCheck %s < %t.log
+
+// CHECK: [Logging clang options]{{.*}}clang{{.*}}"-S"
+