Driver: render arguments for the embedded bitcode correctly
When embedding bitcode, only a subset of the arguments should be recorded into
the bitcode compilation commandline. The frontend job is split into two jobs,
one which will generate the bitcode. Ensure that the arguments for the
compilation to bitcode is properly stripped so that the embedded arguments are
the permitted subset.
llvm-svn: 342929
diff --git a/clang/test/Driver/fembed-bitcode.c b/clang/test/Driver/fembed-bitcode.c
new file mode 100644
index 0000000..b0ec63f
--- /dev/null
+++ b/clang/test/Driver/fembed-bitcode.c
@@ -0,0 +1,28 @@
+// RUN: %clang -target x86_64-apple-macosx -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \
+// RUN: | FileCheck -check-prefix CHECK-X64 %s
+
+// CHECK-X64: "-cc1"
+
+// CHECK-X64: "-cc1"
+// CHECK-X64-NOT: "-fdebug-compilation-dir"
+
+// RUN: %clang -target armv7-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \
+// RUN: | FileCheck -check-prefix CHECK-ARM %s
+
+// CHECK-ARM: "-cc1"
+
+// CHECK-ARM: "-cc1"
+// CHECK-ARM: "-target-abi"
+// CHECK-ARM: "apcs-gnu"
+// CHECK-ARM-NOT: "-fdebug-compilation-dir"
+
+// RUN: %clang -target arm64-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \
+// RUN: | FileCheck -check-prefix CHECK-AARCH64 %s
+
+// CHECK-AARCH64: "-cc1"
+
+// CHECK-AARCH64: "-cc1"
+// CHECK-AARCH64: "-target-abi"
+// CHECK-AARCH64: "darwinpcs"
+// CHECK-AARCH64-NOT: "-fdebug-compilation-dir"
+