aboutsummaryrefslogtreecommitdiff
path: root/test/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'test/Driver')
-rw-r--r--test/Driver/B-opt.c8
-rwxr-xr-xtest/Driver/Inputs/Windows/ARM/8.1/usr/bin/armv7-windows-itanium-ld0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/eabihf/crti.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/powerpc/crti.o0
-rw-r--r--test/Driver/Inputs/cc1-response.txt4
-rw-r--r--test/Driver/Inputs/gen-response.c8
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/nan2008/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/soft-float/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/nan2008/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/soft-float/el/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/lib/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crtn.o0
-rw-r--r--test/Driver/aarch64-cpus.c27
-rw-r--r--test/Driver/aarch64-fix-cortex-a53-835769.c13
-rw-r--r--test/Driver/arm-abi.c53
-rw-r--r--test/Driver/arm-alignment.c12
-rw-r--r--test/Driver/arm-cortex-cpus.c14
-rw-r--r--test/Driver/arm-fixed-r9.c2
-rw-r--r--test/Driver/arm-mfpu.c45
-rw-r--r--test/Driver/ast.c7
-rw-r--r--test/Driver/biarch.c41
-rw-r--r--test/Driver/cc1-response-files.c2
-rw-r--r--test/Driver/cl-inputs.c10
-rw-r--r--test/Driver/cl-link-at-file.c22
-rw-r--r--test/Driver/cl-link.c9
-rw-r--r--test/Driver/cl-options.c26
-rw-r--r--test/Driver/cl-outputs.c168
-rw-r--r--test/Driver/cl-zc.cpp59
-rw-r--r--test/Driver/clang-g-opts.c2
-rw-r--r--test/Driver/clang-s-opts.s4
-rw-r--r--test/Driver/clang_f_opts.c150
-rw-r--r--test/Driver/constructors.c10
-rw-r--r--test/Driver/coverage_no_integrated_as.c23
-rw-r--r--test/Driver/crash report spaces.c18
-rw-r--r--test/Driver/crash-report-modules.m10
-rw-r--r--test/Driver/crash-report-null.test7
-rw-r--r--test/Driver/crash-report.c36
-rw-r--r--test/Driver/cross-linux.c28
-rw-r--r--test/Driver/darwin-arch-default.c40
-rw-r--r--test/Driver/darwin-debug-flags.c8
-rw-r--r--test/Driver/darwin-dsymutil.c15
-rw-r--r--test/Driver/darwin-ld-demangle.c8
-rw-r--r--test/Driver/darwin-ld.c18
-rw-r--r--test/Driver/darwin-max-type-align.c15
-rw-r--r--test/Driver/darwin-sanitizer-ld.c8
-rw-r--r--test/Driver/darwin-sdkroot.c7
-rw-r--r--test/Driver/darwin-verify-debug.c5
-rw-r--r--test/Driver/debug-options.c4
-rw-r--r--test/Driver/default-image-name.c7
-rw-r--r--test/Driver/env.c28
-rw-r--r--test/Driver/fatal-warnings.c8
-rw-r--r--test/Driver/fortran.f959
-rw-r--r--test/Driver/freebsd.c12
-rw-r--r--test/Driver/freebsd.cpp (renamed from test/Driver/freebsd.cc)0
-rw-r--r--test/Driver/fsanitize.c87
-rw-r--r--test/Driver/gcc-version-debug.c1
-rw-r--r--test/Driver/gcc_forward.c4
-rw-r--r--test/Driver/hexagon-toolchain-elf.c137
-rw-r--r--test/Driver/hexagon-toolchain.c137
-rw-r--r--test/Driver/ident_md.c2
-rw-r--r--test/Driver/instrprof-ld.c6
-rw-r--r--test/Driver/le32-unknown-nacl.cpp6
-rw-r--r--test/Driver/le64-unknown-unknown.cpp137
-rw-r--r--test/Driver/linux-header-search.cpp18
-rw-r--r--test/Driver/linux-ld.c190
-rw-r--r--test/Driver/lto.c13
-rw-r--r--test/Driver/mips-as.c20
-rw-r--r--test/Driver/mips-cs.cpp174
-rw-r--r--test/Driver/mips-features.c10
-rw-r--r--test/Driver/mips-fsf.cpp162
-rw-r--r--test/Driver/mips-integrated-as.s10
-rw-r--r--test/Driver/mips-reduced-toolchain.cpp2
-rw-r--r--test/Driver/modules.m24
-rw-r--r--test/Driver/modules.mm6
-rw-r--r--test/Driver/msvc_forward.c4
-rw-r--r--test/Driver/netbsd.c141
-rw-r--r--test/Driver/netbsd.cpp96
-rw-r--r--test/Driver/no-canonical-prefixes.c10
-rw-r--r--test/Driver/openbsd.c17
-rw-r--r--test/Driver/parse-progname.c58
-rw-r--r--test/Driver/phases.c66
-rw-r--r--test/Driver/pic.c5
-rw-r--r--test/Driver/ppc-abi.c19
-rw-r--r--test/Driver/ppc-features.cpp16
-rw-r--r--test/Driver/prefixed-tools.c8
-rw-r--r--test/Driver/r600-mcpu.cl18
-rw-r--r--test/Driver/response-file.c23
-rw-r--r--test/Driver/rewrite-legacy-objc.m6
-rw-r--r--test/Driver/rewrite-map-in-diagnostics.c12
-rw-r--r--test/Driver/rewrite-objc.m2
-rw-r--r--test/Driver/sanitizer-ld.c63
-rw-r--r--test/Driver/save-temps.c11
-rw-r--r--test/Driver/sparc-float.c4
-rw-r--r--test/Driver/split-debug.c1
-rw-r--r--test/Driver/split-debug.s1
-rw-r--r--test/Driver/std.c16
-rw-r--r--test/Driver/symbol-rewriter.c21
-rw-r--r--test/Driver/systemz-as.s14
-rw-r--r--test/Driver/thread-model.c15
-rw-r--r--test/Driver/unknown-gcc-arch.c20
-rw-r--r--test/Driver/warning-options.cpp5
-rw-r--r--test/Driver/windows-cross.c40
-rw-r--r--test/Driver/x86-march.c105
189 files changed, 2506 insertions, 467 deletions
diff --git a/test/Driver/B-opt.c b/test/Driver/B-opt.c
index 6759353174d0..318009413b1c 100644
--- a/test/Driver/B-opt.c
+++ b/test/Driver/B-opt.c
@@ -3,20 +3,20 @@
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir1 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-TRIPLE %s
-// CHECK-B-OPT-TRIPLE: "{{.*}}/Inputs/B_opt_tree/dir1{{/|\\}}i386-unknown-linux-ld"
+// CHECK-B-OPT-TRIPLE: "{{.*}}/Inputs/B_opt_tree/dir1{{/|\\\\}}i386-unknown-linux-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-DIR %s
-// CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2{{/|\\}}ld"
+// CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2{{/|\\\\}}ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-PREFIX %s
-// CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\}}prefix-ld"
+// CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
-// CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\}}prefix-ld"
+// CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld"
diff --git a/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/armv7-windows-itanium-ld b/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/armv7-windows-itanium-ld
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/Windows/ARM/8.1/usr/bin/armv7-windows-itanium-ld
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/eabihf/crti.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/eabihf/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/eabihf/crti.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/powerpc/crti.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/powerpc/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/powerpc/crti.o
diff --git a/test/Driver/Inputs/cc1-response.txt b/test/Driver/Inputs/cc1-response.txt
new file mode 100644
index 000000000000..0236fdc6aa31
--- /dev/null
+++ b/test/Driver/Inputs/cc1-response.txt
@@ -0,0 +1,4 @@
+
+
+-cc1
+-triple i686-pc-windows-msvc
diff --git a/test/Driver/Inputs/gen-response.c b/test/Driver/Inputs/gen-response.c
new file mode 100644
index 000000000000..84ffb40dbece
--- /dev/null
+++ b/test/Driver/Inputs/gen-response.c
@@ -0,0 +1,8 @@
+#define M -DTEST
+#define M1 M M M M M M M M M M
+#define M2 M1 M1 M1 M1 M1 M1 M1 M1 M1 M1
+#define M3 M2 M2 M2 M2 M2 M2 M2 M2 M2 M2
+#define M4 M3 M3 M3 M3 M3 M3 M3 M3 M3 M3
+#define M5 M4 M4 M4 M4 M4 M4 M4 M4 M4 M4
+#define TEXT M5 M5 M5
+TEXT
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/el/.keep b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/nan2008/el/.keep b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/nan2008/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/nan2008/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/soft-float/el/.keep b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/soft-float/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/uclibc/soft-float/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/el/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/nan2008/el/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/uclibc/soft-float/el/crtend.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/el/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/nan2008/el/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/nan2008/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/nan2008/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/soft-float/el/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/soft-float/el/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/uclibc/soft-float/el/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/lib/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/soft-float/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/include/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/include/.keep
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/uclibc/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/uclibc/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/uclibc/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/uclibc/usr/lib/crtn.o
diff --git a/test/Driver/aarch64-cpus.c b/test/Driver/aarch64-cpus.c
index 68ad326d5edf..1627660d8130 100644
--- a/test/Driver/aarch64-cpus.c
+++ b/test/Driver/aarch64-cpus.c
@@ -7,7 +7,7 @@
// RUN: %clang -target arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
// RUN: %clang -target arm64 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
-// RUN: %clang -target arm64_be -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
+
// ARM64-GENERIC: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
// RUN: %clang -target arm64-apple-darwin -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s
@@ -22,10 +22,8 @@
// RUN: %clang -target arm64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
// RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
-// RUN: %clang -target arm64_be -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
// RUN: %clang -target arm64 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
// RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
-// RUN: %clang -target arm64_be -mlittle-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s
// ARM64-CA53: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a53"
// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s
@@ -38,10 +36,8 @@
// RUN: %clang -target arm64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
// RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
-// RUN: %clang -target arm64_be -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
// RUN: %clang -target arm64 -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
// RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
-// RUN: %clang -target arm64_be -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s
// ARM64-CA57: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a57"
// RUN: %clang -target aarch64_be -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC-BE %s
@@ -49,11 +45,6 @@
// RUN: %clang -target aarch64_be -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC-BE %s
// GENERIC-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic"
-// RUN: %clang -target arm64_be -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC-BE %s
-// RUN: %clang -target arm64 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC-BE %s
-// RUN: %clang -target arm64_be -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC-BE %s
-// ARM64-GENERIC-BE: "-cc1"{{.*}} "-triple" "arm64_be{{.*}}" "-target-cpu" "generic"
-
// RUN: %clang -target aarch64_be -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s
// RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s
// RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s
@@ -62,14 +53,6 @@
// RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s
// CA53-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a53"
-// RUN: %clang -target arm64_be -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// RUN: %clang -target arm64 -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// RUN: %clang -target arm64_be -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// RUN: %clang -target arm64_be -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// RUN: %clang -target arm64 -mbig-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// RUN: %clang -target arm64_be -mbig-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-BE %s
-// ARM64-CA53-BE: "-cc1"{{.*}} "-triple" "arm64_be{{.*}}" "-target-cpu" "cortex-a53"
-
// RUN: %clang -target aarch64_be -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s
// RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s
// RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s
@@ -78,14 +61,6 @@
// RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s
// CA57-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a57"
-// RUN: %clang -target arm64_be -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// RUN: %clang -target arm64 -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// RUN: %clang -target arm64_be -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// RUN: %clang -target arm64_be -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// RUN: %clang -target arm64 -mbig-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// RUN: %clang -target arm64_be -mbig-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-BE %s
-// ARM64-CA57-BE: "-cc1"{{.*}} "-triple" "arm64_be{{.*}}" "-target-cpu" "cortex-a57"
-
// RUN: %clang -target aarch64 -mcpu=cortex-a57 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE %s
// RUN: %clang -target aarch64 -mtune=cortex-a53 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE %s
// MCPU-MTUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53"
diff --git a/test/Driver/aarch64-fix-cortex-a53-835769.c b/test/Driver/aarch64-fix-cortex-a53-835769.c
new file mode 100644
index 000000000000..3fe918adec45
--- /dev/null
+++ b/test/Driver/aarch64-fix-cortex-a53-835769.c
@@ -0,0 +1,13 @@
+// RUN: %clang -target aarch64-linux-eabi %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-DEF %s
+// RUN: %clang -target aarch64-linux-eabi -mfix-cortex-a53-835769 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-YES %s
+// RUN: %clang -target aarch64-linux-eabi -mno-fix-cortex-a53-835769 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO %s
+
+// RUN: %clang -target aarch64-android-eabi %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-YES %s
+
+// CHECK-DEF-NOT: "-backend-option" "-aarch64-fix-cortex-a53-835769"
+// CHECK-YES: "-backend-option" "-aarch64-fix-cortex-a53-835769=1"
+// CHECK-NO: "-backend-option" "-aarch64-fix-cortex-a53-835769=0"
diff --git a/test/Driver/arm-abi.c b/test/Driver/arm-abi.c
new file mode 100644
index 000000000000..812a849110ec
--- /dev/null
+++ b/test/Driver/arm-abi.c
@@ -0,0 +1,53 @@
+// The default ABI is aapcs
+// RUN: %clang -target arm--- %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target armeb--- %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target thumb--- %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target thumbeb--- %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+
+// MachO targets default to apcs-gnu, except for m-class processors
+// RUN: %clang -target arm--darwin- -arch armv7s %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
+// RUN: %clang -target thumb--darwin- -arch armv7s %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
+// RUN: %clang -target thumb--darwin- -arch armv7m %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+
+// Windows targets default to AAPCS, regardless of environment
+// RUN: %clang -target arm--windows-gnueabi %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+
+// NetBSD defaults to apcs-gnu, but can also use aapcs
+// RUN: %clang -target arm--netbsd- %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
+// RUN: %clang -target arm--netbsd-eabi %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target arm--netbsd-eabihf %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+
+// Otherwise, ABI is celected based on environment
+// RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
+// RUN: %clang -target arm---gnueabi %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
+// RUN: %clang -target arm---gnueabihf %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
+// RUN: %clang -target arm---eabi %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target arm---eabihf %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+
+// ABI can be overridden by the -mabi= option
+// RUN: %clang -target arm---eabi -mabi=apcs-gnu %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
+// RUN: %clang -target arm---gnueabi -mabi=aapcs %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target arm---eabi -mabi=aapcs-linux %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
+
+// CHECK-APCS-GNU: "-target-abi" "apcs-gnu"
+// CHECK-AAPCS: "-target-abi" "aapcs"
+// CHECK-AAPCS-LINUX: "-target-abi" "aapcs-linux"
diff --git a/test/Driver/arm-alignment.c b/test/Driver/arm-alignment.c
index 98046d7edf1d..3fe595143f7d 100644
--- a/test/Driver/arm-alignment.c
+++ b/test/Driver/arm-alignment.c
@@ -44,5 +44,17 @@
// RUN: %clang -target aarch64-none-gnueabi -munaligned-access -mstrict-align -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
+// RUN: %clang -target aarch64-none-gnueabi -mkernel -mno-unaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
+
// CHECK-ALIGNED-ARM: "-backend-option" "-arm-strict-align"
// CHECK-ALIGNED-AARCH64: "-backend-option" "-aarch64-strict-align"
+
+// Make sure that v6M cores always trigger the unsupported aligned accesses error
+// for all supported architecture triples.
+// RUN: not %clang -c -target thumbv6m-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \
+// RUN: FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s
+// RUN: not %clang -c -target thumb-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \
+// RUN: FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s
+
+// CHECK-UNALIGN-NOT-SUPPORTED: error: the v6m sub-architecture does not support unaligned accesses
diff --git a/test/Driver/arm-cortex-cpus.c b/test/Driver/arm-cortex-cpus.c
index 224ba575dddd..b1f253341ef4 100644
--- a/test/Driver/arm-cortex-cpus.c
+++ b/test/Driver/arm-cortex-cpus.c
@@ -14,7 +14,7 @@
// CHECK-V5: "-cc1"{{.*}} "-triple" "armv5-{{.*}} "-target-cpu" "arm10tdmi"
// RUN: %clang -target armv5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V5-THUMB %s
-// RUN: %clang -target armv -march=armv5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V5-THUMB %s
+// RUN: %clang -target arm -march=armv5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V5-THUMB %s
// RUN: %clang -target armv5t -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V5-THUMB %s
// RUN: %clang -target arm -march=armv5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V5-THUMB %s
// CHECK-V5-THUMB: "-cc1"{{.*}} "-triple" "thumbv5-{{.*}} "-target-cpu" "arm10tdmi"
@@ -169,12 +169,14 @@
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
// CHECK-CPUV7A: "-cc1"{{.*}} "-triple" "armv7-{{.*}}
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
@@ -183,12 +185,14 @@
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a9 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a12 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a15 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
+// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a17 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s
// CHECK-BE-CPUV7A: "-cc1"{{.*}} "-triple" "armebv7-{{.*}}
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
@@ -197,12 +201,14 @@
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s
// CHECK-CPUV7A-THUMB: "-cc1"{{.*}} "-triple" "thumbv7-{{.*}}
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
@@ -211,12 +217,14 @@
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a9 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a12 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a15 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
+// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a17 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a17 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s
// CHECK-BE-CPUV7A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv7-{{.*}}
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m0 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV6M %s
@@ -231,11 +239,15 @@
// CHECK-BE-CPUV7M: "-cc1"{{.*}} "-triple" "thumbebv7m-{{.*}}
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m7 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s
// CHECK-CPUV7EM: "-cc1"{{.*}} "-triple" "thumbv7em-{{.*}}
// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7EM %s
+// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-m7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7EM %s
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7EM %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m7 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7EM %s
// CHECK-BE-CPUV7EM: "-cc1"{{.*}} "-triple" "thumbebv7em-{{.*}}
// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R %s
diff --git a/test/Driver/arm-fixed-r9.c b/test/Driver/arm-fixed-r9.c
index 0a95d8779780..2cec8b4c4fc8 100644
--- a/test/Driver/arm-fixed-r9.c
+++ b/test/Driver/arm-fixed-r9.c
@@ -1,4 +1,4 @@
-// RUN: %clang -target arm-none-gnueeabi -ffixed-r9 -### %s 2> %t
+// RUN: %clang -target arm-none-gnueabi -ffixed-r9 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-FIXED-R9 < %t %s
// CHECK-FIXED-R9: "-backend-option" "-arm-reserve-r9"
diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c
index 89c203542259..64d7d0bb630f 100644
--- a/test/Driver/arm-mfpu.c
+++ b/test/Driver/arm-mfpu.c
@@ -19,14 +19,6 @@
// CHECK-FPA: "-target-feature" "-vfp3"
// CHECK-FPA: "-target-feature" "-neon"
-// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
-// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
-// CHECK-VFP3-D16: "-target-feature" "+vfp3"
-// CHECK-VFP3-D16: "-target-feature" "+d16"
-// CHECK-VFP3-D16: "-target-feature" "-neon"
-
// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP %s
// CHECK-VFP: "-target-feature" "+vfp2"
@@ -39,6 +31,14 @@
// CHECK-VFP3: "-target-feature" "+vfp3"
// CHECK-VFP3: "-target-feature" "-neon"
+// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
+// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
+// CHECK-VFP3-D16: "-target-feature" "+vfp3"
+// CHECK-VFP3-D16: "-target-feature" "+d16"
+// CHECK-VFP3-D16: "-target-feature" "-neon"
+
// RUN: %clang -target arm-linux-eabi -mfpu=vfp4 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
// RUN: %clang -target arm-linux-eabi -mfpu=vfpv4 %s -### -o %t.o 2>&1 \
@@ -63,10 +63,39 @@
// CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
// CHECK-FP4-SP-D16: "-target-feature" "-neon"
+// RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
+// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-sp-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP5-SP-D16 %s
+// CHECK-FP5-SP-D16: "-target-feature" "+fp-armv8"
+// CHECK-FP5-SP-D16: "-target-feature" "+fp-only-sp"
+// CHECK-FP5-SP-D16: "-target-feature" "+d16"
+// CHECK-FP5-SP-D16: "-target-feature" "-neon"
+// CHECK-FP5-SP-D16: "-target-feature" "-crypto"
+
+// RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
+// RUN: %clang -target arm-linux-eabi -mfpu=fpv5-dp-d16 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP5-DP-D16 %s
+// CHECK-FP5-DP-D16: "-target-feature" "+fp-armv8"
+// CHECK-FP5-DP-D16: "-target-feature" "+d16"
+// CHECK-FP5-DP-D16: "-target-feature" "-neon"
+// CHECK-FP5-DP-D16: "-target-feature" "-crypto"
+
// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NEON %s
// CHECK-NEON: "-target-feature" "+neon"
+// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv3 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV3 %s
+// CHECK-NEON-VFPV3: "-target-feature" "+vfp3"
+// CHECK-NEON-VFPV3: "-target-feature" "+neon"
+
+// RUN: %clang -target arm-linux-eabi -mfpu=neon-vfpv4 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON-VFPV4 %s
+// CHECK-NEON-VFPV4: "-target-feature" "+neon"
+// CHECK-NEON-VFPV4: "-target-feature" "+vfp4"
+
// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
diff --git a/test/Driver/ast.c b/test/Driver/ast.c
index 83dfcc37a9c8..c1d7b1a6d7b0 100644
--- a/test/Driver/ast.c
+++ b/test/Driver/ast.c
@@ -16,9 +16,10 @@
// COMPILE-AST-PHASES: 0: input,
// COMPILE-AST-PHASES: , ast
-// COMPILE-AST-PHASES: 1: compiler, {0}, assembler
-// COMPILE-AST-PHASES: 2: assembler, {1}, object
-// COMPILE-AST-PHASES-NOT: 3:
+// COMPILE-AST-PHASES: 1: compiler, {0}, ir
+// COMPILE-AST-PHASES: 2: backend, {1}, assembler
+// COMPILE-AST-PHASES: 3: assembler, {2}, object
+// COMPILE-AST-PHASES-NOT: 4:
// COMPILE-AST-PHASES: END
// FIXME: There is a problem with compiling AST's in that the input language is
diff --git a/test/Driver/biarch.c b/test/Driver/biarch.c
new file mode 100644
index 000000000000..1f0982e3c5d2
--- /dev/null
+++ b/test/Driver/biarch.c
@@ -0,0 +1,41 @@
+// RUN: %clang -target i386--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+
+// RUN: %clang -target i386--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
+
+// RUN: %clang -target x86_64--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
+
+// RUN: %clang -target x86_64--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
+
+// RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "armv6--netbsd-eabihf"' %t
+
+// RUN: %clang -target sparcv9--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
+
+// RUN: %clang -target sparcv9--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
+
+// RUN: %clang -target sparc64--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "sparc64--netbsd"' %t
+
+// RUN: %clang -target sparc--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
+
+// RUN: %clang -target sparc--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
+
+// RUN: %clang -target mips64--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
+
+// RUN: %clang -target mips64--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
+
+// RUN: %clang -target mips--netbsd -m32 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
+
+// RUN: %clang -target mips--netbsd -m64 %s -### 2> %t
+// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
diff --git a/test/Driver/cc1-response-files.c b/test/Driver/cc1-response-files.c
new file mode 100644
index 000000000000..f47e6448a6ca
--- /dev/null
+++ b/test/Driver/cc1-response-files.c
@@ -0,0 +1,2 @@
+// RUN: %clang @%S/Inputs/cc1-response.txt -fsyntax-only -disable-llvm-optzns
+int main() {}
diff --git a/test/Driver/cl-inputs.c b/test/Driver/cl-inputs.c
index 029aeadaec42..b0265df52f05 100644
--- a/test/Driver/cl-inputs.c
+++ b/test/Driver/cl-inputs.c
@@ -34,6 +34,16 @@
// WARN: note: The last /TC or /TP option takes precedence over earlier instances
// WARN-NOT: note
+// RUN: env LIB=%S/Inputs/cl-libs %clang_cl /c /TP cl-test.lib -### 2>&1 | FileCheck -check-prefix=TPlib %s
+// TPlib: warning: cl-test.lib: 'linker' input unused
+// TPlib: warning: argument unused during compilation: '/TP'
+// TPlib-NOT: cl-test.lib
+
+// RUN: env LIB=%S/Inputs/cl-libs %clang_cl /c /TC cl-test.lib -### 2>&1 | FileCheck -check-prefix=TClib %s
+// TClib: warning: cl-test.lib: 'linker' input unused
+// TClib: warning: argument unused during compilation: '/TC'
+// TClib-NOT: cl-test.lib
+
// RUN: not %clang_cl - 2>&1 | FileCheck -check-prefix=STDIN %s
// STDIN: error: use /Tc or /Tp
diff --git a/test/Driver/cl-link-at-file.c b/test/Driver/cl-link-at-file.c
new file mode 100644
index 000000000000..f817ce523ad7
--- /dev/null
+++ b/test/Driver/cl-link-at-file.c
@@ -0,0 +1,22 @@
+// PR17239 - The /link option, when inside a response file, should only extend
+// until the end of the response file (and not the entire command line)
+
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by -- or bound to another option, otherwise it may
+// be interpreted as a command-line option, e.g. on Mac where %s is commonly
+// under /Users.
+
+// RUN: echo /link bar.lib baz.lib > %t.args
+// RUN: touch %t.obj
+// RUN: %clang_cl -### @%t.args -- %t.obj 2>&1 | FileCheck %s -check-prefix=ARGS
+// If the "/link" option captures all remaining args beyond its response file,
+// it will also capture "--" and our input argument. In this case, Clang will
+// be clueless and will emit "argument unused" warnings. If PR17239 is properly
+// fixed, this should not happen because the "/link" option is restricted to
+// consume only remaining args in its response file.
+// ARGS-NOT: warning
+// ARGS-NOT: argument unused during compilation
+// Identify the linker command
+// ARGS: link.exe
diff --git a/test/Driver/cl-link.c b/test/Driver/cl-link.c
index f4717465d3ec..5bd200117967 100644
--- a/test/Driver/cl-link.c
+++ b/test/Driver/cl-link.c
@@ -19,6 +19,15 @@
// ASAN: "{{.*}}clang_rt.asan_cxx-i386.lib"
// ASAN: "{{.*}}cl-link{{.*}}.obj"
+// RUN: %clang_cl /MD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-MD %s
+// ASAN-MD: link.exe
+// ASAN-MD: "-debug"
+// ASAN-MD: "-incremental:no"
+// ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
+// ASAN-MD: "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
+// ASAN-MD: "-include:___asan_seh_interceptor"
+// ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
+
// RUN: %clang_cl /LD -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
// RUN: %clang_cl /LDd -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
// DLL: link.exe
diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c
index 26cd7e9eb4c6..d9fcaf46692e 100644
--- a/test/Driver/cl-options.c
+++ b/test/Driver/cl-options.c
@@ -135,6 +135,12 @@
// RUN: %clang_cl /w -### -- %s 2>&1 | FileCheck -check-prefix=w %s
// w: -w
+// RUN: %clang_cl /Zp -### -- %s 2>&1 | FileCheck -check-prefix=ZP %s
+// ZP: -fpack-struct=1
+
+// RUN: %clang_cl /Zp2 -### -- %s 2>&1 | FileCheck -check-prefix=ZP2 %s
+// ZP2: -fpack-struct=2
+
// RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s
// Zs: -fsyntax-only
@@ -166,8 +172,12 @@
// (/Zs is for syntax-only)
// RUN: %clang_cl /Zs \
// RUN: /analyze- \
+// RUN: /cgthreads4 \
+// RUN: /cgthreads8 \
+// RUN: /d2Zi+ \
// RUN: /errorReport:foo \
// RUN: /FS \
+// RUN: /Gd \
// RUN: /GF \
// RUN: /GS- \
// RUN: /kernel- \
@@ -178,14 +188,14 @@
// RUN: /sdl \
// RUN: /sdl- \
// RUN: /vmg \
+// RUN: /volatile:iso \
// RUN: /w12345 \
// RUN: /wd1234 \
-// RUN: /Zc:forScope \
-// RUN: /Zc:wchar_t \
-// RUN: /Zc:inline \
-// RUN: /Zc:rvalueCast \
+// RUN: /Zo \
+// RUN: /Zo- \
// RUN: -### -- %s 2>&1 | FileCheck -check-prefix=IGNORED %s
// IGNORED-NOT: argument unused during compilation
+// IGNORED-NOT: no such file or directory
// Ignored options and compile-only options are ignored for link jobs.
// RUN: touch %t.obj
@@ -204,7 +214,6 @@
// RUN: /AIfoo \
// RUN: /clr:pure \
// RUN: /docname \
-// RUN: /d2Zi+ \
// RUN: /EHsc \
// RUN: /F \
// RUN: /FA \
@@ -239,6 +248,7 @@
// RUN: /Gs1000 \
// RUN: /GT \
// RUN: /GX \
+// RUN: /Gv \
// RUN: /Gz \
// RUN: /GZ \
// RUN: /H \
@@ -257,7 +267,7 @@
// RUN: /Qvec-report:2 \
// RUN: /u \
// RUN: /V \
-// RUN: /volatile \
+// RUN: /volatile:ms \
// RUN: /wfoo \
// RUN: /WL \
// RUN: /Wp64 \
@@ -271,15 +281,11 @@
// RUN: /Yustdafx.h \
// RUN: /Z7 \
// RUN: /Za \
-// RUN: /Zc:auto \
-// RUN: /Zc:wchar_t- \
// RUN: /Ze \
// RUN: /Zg \
// RUN: /Zi \
// RUN: /ZI \
// RUN: /Zl \
-// RUN: /Zp \
-// RUN: /Zp1 \
// RUN: /ZW:nostdlib \
// RUN: -- %s 2>&1
diff --git a/test/Driver/cl-outputs.c b/test/Driver/cl-outputs.c
index 46502f6427d6..be1172f30fce 100644
--- a/test/Driver/cl-outputs.c
+++ b/test/Driver/cl-outputs.c
@@ -7,6 +7,9 @@
// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
// DEFAULT: "-o" "cl-outputs.obj"
+// RUN: %clang_cl /Fo -### -- %s 2>&1 | FileCheck -check-prefix=FoEMPTY %s
+// FoEMPTY: "-o" "cl-outputs.obj"
+
// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
// FoNAME: "-o" "a.obj"
@@ -25,15 +28,68 @@
// RUN: %clang_cl /Fo.. -### -- %s 2>&1 | FileCheck -check-prefix=FoCRAZY %s
// FoCRAZY: "-o" "..obj"
-// RUN: %clang_cl /Fo -### 2>&1 | FileCheck -check-prefix=FoMISSINGARG %s
-// FoMISSINGARG: error: argument to '/Fo' is missing (expected 1 value)
-
// RUN: %clang_cl /Foa.obj -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEERROR %s
// CHECK-MULTIPLESOURCEERROR: error: cannot specify '/Foa.obj' when compiling multiple source files
// RUN: %clang_cl /Fomydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK %s
// CHECK-MULTIPLESOURCEOK: "-o" "mydir{{[/\\]+}}cl-outputs.obj"
+// RUN: %clang_cl /Fo -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK2 %s
+// CHECK-MULTIPLESOURCEOK2: "-o" "cl-outputs.obj"
+// CHECK-MULTIPLESOURCEOK2: "-o" "cl-outputs.obj"
+
+// RUN: %clang_cl /c /oa -### -- %s 2>&1 | FileCheck -check-prefix=oNAME1 %s
+// oNAME1: "-o" "a.obj"
+
+// RUN: %clang_cl /c /o a -### -- %s 2>&1 | FileCheck -check-prefix=oNAME2 %s
+// oNAME2: "-o" "a.obj"
+
+// RUN: %clang_cl /c /oa.ext /ob.ext -### -- %s 2>&1 | FileCheck -check-prefix=oNAMEEXT1 %s
+// oNAMEEXT1: "-o" "b.ext"
+
+// RUN: %clang_cl /c /o a.ext /ob.ext -### -- %s 2>&1 | FileCheck -check-prefix=oNAMEEXT2 %s
+// oNAMEEXT2: "-o" "b.ext"
+
+// RUN: %clang_cl /c /ofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=oDIR1 %s
+// oDIR1: "-o" "foo.dir{{[/\\]+}}cl-outputs.obj"
+
+// RUN: %clang_cl /c /o foo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=oDIR2 %s
+// oDIR2: "-o" "foo.dir{{[/\\]+}}cl-outputs.obj"
+
+// RUN: %clang_cl /c /ofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=oDIRNAME1 %s
+// oDIRNAME1: "-o" "foo.dir{{[/\\]+}}a.obj"
+
+// RUN: %clang_cl /c /o foo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=oDIRNAME2 %s
+// oDIRNAME2: "-o" "foo.dir{{[/\\]+}}a.obj"
+
+// RUN: %clang_cl /c /ofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=oDIRNAMEEXT1 %s
+// oDIRNAMEEXT1: "-o" "foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /c /o foo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=oDIRNAMEEXT2 %s
+// oDIRNAMEEXT2: "-o" "foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /c /o.. -### -- %s 2>&1 | FileCheck -check-prefix=oCRAZY1 %s
+// oCRAZY1: "-o" "..obj"
+
+// RUN: %clang_cl /c /o .. -### -- %s 2>&1 | FileCheck -check-prefix=oCRAZY2 %s
+// oCRAZY2: "-o" "..obj"
+
+// RUN: %clang_cl /c %s -### /o 2>&1 | FileCheck -check-prefix=oMISSINGARG %s
+// oMISSINGARG: error: argument to '/o' is missing (expected 1 value)
+
+// RUN: %clang_cl /c /omydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-oMULTIPLESOURCEOK1 %s
+// CHECK-oMULTIPLESOURCEOK1: "-o" "mydir{{[/\\]+}}cl-outputs.obj"
+
+// RUN: %clang_cl /c /o mydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-oMULTIPLESOURCEOK2 %s
+// CHECK-oMULTIPLESOURCEOK2: "-o" "mydir{{[/\\]+}}cl-outputs.obj"
+
+
+// RUN: %clang_cl /c /obar /Fofoo -### -- %s 2>&1 | FileCheck -check-prefix=FooRACE1 %s
+// FooRACE1: "-o" "foo.obj"
+
+// RUN: %clang_cl /c /Fofoo /obar -### -- %s 2>&1 | FileCheck -check-prefix=FooRACE2 %s
+// FooRACE2: "-o" "bar.obj"
+
// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTEXE %s
// DEFAULTEXE: cl-outputs.exe
@@ -46,6 +102,10 @@
// RUN: %clang_cl /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXT %s
// FeNOEXT: "-out:foo.exe"
+// RUN: %clang_cl /Fe -### -- %s 2>&1 | FileCheck -check-prefix=FeEMPTY %s
+// FeEMPTY-NOT: argument to '/Fe' is missing
+// FeEMPTY: "-out:cl-outputs.exe"
+
// RUN: %clang_cl /Fefoo /LD -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXTDLL %s
// RUN: %clang_cl /Fefoo /LDd -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXTDLL %s
// FeNOEXTDLL: "-out:foo.dll"
@@ -83,15 +143,83 @@
// FeDIRNAMEEXTDLL: "-out:foo.dir{{[/\\]+}}a.ext"
// FeDIRNAMEEXTDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
-// RUN: %clang_cl /Fe -### 2>&1 | FileCheck -check-prefix=FeMISSINGARG %s
-// FeMISSINGARG: error: argument to '/Fe' is missing (expected 1 value)
-
// RUN: %clang_cl /Fefoo /Febar -### -- %s 2>&1 | FileCheck -check-prefix=FeOVERRIDE %s
// FeOVERRIDE: "-out:bar.exe"
+// RUN: %clang_cl /obar /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeoRACE1 %s
+// FeoRACE1: "-out:foo.exe"
+
+// RUN: %clang_cl /Fefoo /obar -### -- %s 2>&1 | FileCheck -check-prefix=FeoRACE2 %s
+// FeoRACE2: "-out:bar.exe"
+
+
+// RUN: %clang_cl /ofoo -### -- %s 2>&1 | FileCheck -check-prefix=FeoNOEXT1 %s
+// FeoNOEXT1: "-out:foo.exe"
+
+// RUN: %clang_cl /o foo -### -- %s 2>&1 | FileCheck -check-prefix=FeoNOEXT2 %s
+// FeoNOEXT2: "-out:foo.exe"
+
+// RUN: %clang_cl /o foo /LD -### -- %s 2>&1 | FileCheck -check-prefix=FeoNOEXTDLL %s
+// RUN: %clang_cl /ofoo /LDd -### -- %s 2>&1 | FileCheck -check-prefix=FeoNOEXTDLL %s
+// FeoNOEXTDLL: "-out:foo.dll"
+// FeoNOEXTDLL: "-implib:foo.lib"
+
+// RUN: %clang_cl /ofoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoEXT1 %s
+// FeoEXT1: "-out:foo.ext"
+
+// RUN: %clang_cl /o foo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoEXT2 %s
+// FeoEXT2: "-out:foo.ext"
+
+// RUN: %clang_cl /LD /o foo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoEXTDLL %s
+// RUN: %clang_cl /LDd /ofoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoEXTDLL %s
+// FeoEXTDLL: "-out:foo.ext"
+// FeoEXTDLL: "-implib:foo.lib"
+
+// RUN: %clang_cl /ofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIR1 %s
+// FeoDIR1: "-out:foo.dir{{[/\\]+}}cl-outputs.exe"
+
+// RUN: %clang_cl /o foo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIR2 %s
+// FeoDIR2: "-out:foo.dir{{[/\\]+}}cl-outputs.exe"
+
+// RUN: %clang_cl /LD /o foo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRDLL %s
+// RUN: %clang_cl /LDd /ofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRDLL %s
+// FeoDIRDLL: "-out:foo.dir{{[/\\]+}}cl-outputs.dll"
+// FeoDIRDLL: "-implib:foo.dir{{[/\\]+}}cl-outputs.lib"
+
+// RUN: %clang_cl /ofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAME1 %s
+// FeoDIRNAME1: "-out:foo.dir{{[/\\]+}}a.exe"
+
+// RUN: %clang_cl /o foo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAME2 %s
+// FeoDIRNAME2: "-out:foo.dir{{[/\\]+}}a.exe"
+
+// RUN: %clang_cl /LD /o foo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEDLL %s
+// RUN: %clang_cl /LDd /ofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEDLL %s
+// FeoDIRNAMEDLL: "-out:foo.dir{{[/\\]+}}a.dll"
+// FeoDIRNAMEDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
+
+// RUN: %clang_cl /ofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEEXT1 %s
+// FeoDIRNAMEEXT1: "-out:foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /o foo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEEXT2 %s
+// FeoDIRNAMEEXT2: "-out:foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /LD /o foo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEEXTDLL %s
+// RUN: %clang_cl /LDd /ofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeoDIRNAMEEXTDLL %s
+// FeoDIRNAMEEXTDLL: "-out:foo.dir{{[/\\]+}}a.ext"
+// FeoDIRNAMEEXTDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
+
+// RUN: %clang_cl -### /o 2>&1 | FileCheck -check-prefix=FeoMISSINGARG %s
+// FeoMISSINGARG: error: argument to '/o' is missing (expected 1 value)
+
+// RUN: %clang_cl /ofoo /o bar -### -- %s 2>&1 | FileCheck -check-prefix=FeoOVERRIDE %s
+// FeoOVERRIDE: "-out:bar.exe"
+
+
// RUN: %clang_cl /FA -### -- %s 2>&1 | FileCheck -check-prefix=FA %s
// FA: "-o" "cl-outputs.asm"
+// RUN: %clang_cl /FA /Fa -### -- %s 2>&1 | FileCheck -check-prefix=FaEMPTY %s
+// FaEMPTY: "-o" "cl-outputs.asm"
// RUN: %clang_cl /FA /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FaNAME %s
// RUN: %clang_cl /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FaNAME %s
// FaNAME: "-o" "foo.asm"
@@ -105,6 +233,9 @@
// FaDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext"
// RUN: %clang_cl /Faa.asm -### -- %s %s 2>&1 | FileCheck -check-prefix=FaMULTIPLESOURCE %s
// FaMULTIPLESOURCE: error: cannot specify '/Faa.asm' when compiling multiple source files
+// RUN: %clang_cl /Fa -### -- %s %s 2>&1 | FileCheck -check-prefix=FaMULTIPLESOURCEOK %s
+// FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
+// FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
// RUN: %clang_cl /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
// P: "-E"
@@ -117,3 +248,28 @@
// RUN: %clang_cl /P /Fifoo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fi2 %s
// Fi2: "-E"
// Fi2: "-o" "foo.x"
+
+// RUN: %clang_cl /P /ofoo -### -- %s 2>&1 | FileCheck -check-prefix=Fio1 %s
+// Fio1: "-E"
+// Fio1: "-o" "foo.i"
+
+// RUN: %clang_cl /P /o foo -### -- %s 2>&1 | FileCheck -check-prefix=Fio2 %s
+// Fio2: "-E"
+// Fio2: "-o" "foo.i"
+
+// RUN: %clang_cl /P /ofoo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio3 %s
+// Fio3: "-E"
+// Fio3: "-o" "foo.x"
+
+// RUN: %clang_cl /P /o foo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio4 %s
+// Fio4: "-E"
+// Fio4: "-o" "foo.x"
+
+
+// RUN: %clang_cl /P /obar.x /Fifoo.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE1 %s
+// FioRACE1: "-E"
+// FioRACE1: "-o" "foo.x"
+
+// RUN: %clang_cl /P /Fifoo.x /obar.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE2 %s
+// FioRACE2: "-E"
+// FioRACE2: "-o" "bar.x"
diff --git a/test/Driver/cl-zc.cpp b/test/Driver/cl-zc.cpp
new file mode 100644
index 000000000000..639095fded80
--- /dev/null
+++ b/test/Driver/cl-zc.cpp
@@ -0,0 +1,59 @@
+// 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 /c -### -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-DEFAULT %s
+// cc1 will disable trigraphs for -fms-compatibility as long as -ftrigraphs
+// isn't explicitly passed.
+// TRIGRAPHS-DEFAULT-NOT: "-ftrigraphs"
+
+// RUN: %clang_cl /c -### /Zc:trigraphs -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-ON %s
+// TRIGRAPHS-ON: "-ftrigraphs"
+
+// RUN: %clang_cl /c -### /Zc:trigraphs- -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-OFF %s
+// TRIGRAPHS-OFF: "-fno-trigraphs"
+
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-DEFAULT %s
+// STRICTSTRINGS-DEFAULT-NOT: -Werror=c++11-compat-deprecated-writable-strings
+// RUN: %clang_cl /c -### /Zc:strictStrings -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-ON %s
+// STRICTSTRINGS-ON: -Werror=c++11-compat-deprecated-writable-strings
+// RUN: %clang_cl /c -### /Zc:strictStrings- -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-OFF %s
+// STRICTSTRINGS-OFF: argument unused during compilation
+
+
+// RUN: %clang_cl /c -### /Zc:foobar -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s
+// FOOBAR-ON: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:foobar- -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s
+// FOOBAR-OFF: argument unused during compilation
+
+// These are ignored if enabled, and warn if disabled.
+
+// RUN: %clang_cl /c -### /Zc:forScope -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-ON %s
+// FORSCOPE-ON-NOT: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:forScope- -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-OFF %s
+// FORSCOPE-OFF: argument unused during compilation
+
+// RUN: %clang_cl /c -### /Zc:wchar_t -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-ON %s
+// WCHAR_T-ON-NOT: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:wchar_t- -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-OFF %s
+// WCHAR_T-OFF: argument unused during compilation
+
+// RUN: %clang_cl /c -### /Zc:auto -- %s 2>&1 | FileCheck -check-prefix=AUTO-ON %s
+// AUTO-ON-NOT: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:auto- -- %s 2>&1 | FileCheck -check-prefix=AUTO-OFF %s
+// AUTO-OFF: argument unused during compilation
+
+// RUN: %clang_cl /c -### /Zc:inline -- %s 2>&1 | FileCheck -check-prefix=INLINE-ON %s
+// INLINE-ON-NOT: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:inline- -- %s 2>&1 | FileCheck -check-prefix=INLINE-OFF %s
+// INLINE-OFF: argument unused during compilation
+
+
+// These never warn, but don't have an effect yet.
+
+// RUN: %clang_cl /c -### /Zc:rvalueCast -- %s 2>&1 | FileCheck -check-prefix=RVALUECAST-ON %s
+// RVALUECAST-ON-NOT: argument unused during compilation
+// RUN: %clang_cl /c -### /Zc:rvalueCast- -- %s 2>&1 | FileCheck -check-prefix=RVALUECAST-OFF %s
+// RVALUECAST-OFF: argument unused during compilation
diff --git a/test/Driver/clang-g-opts.c b/test/Driver/clang-g-opts.c
index a9566b7ee1d5..4a1e71908b9c 100644
--- a/test/Driver/clang-g-opts.c
+++ b/test/Driver/clang-g-opts.c
@@ -17,6 +17,8 @@
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
// RUN: %clang -### -S %s -g0 -g -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
+// RUN: %clang -### -S %s -g0 -g -target i386-pc-solaris 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
// CHECK-WITHOUT-G-NOT: "-g"
// CHECK-WITH-G: "-g"
diff --git a/test/Driver/clang-s-opts.s b/test/Driver/clang-s-opts.s
new file mode 100644
index 000000000000..f29270882f0a
--- /dev/null
+++ b/test/Driver/clang-s-opts.s
@@ -0,0 +1,4 @@
+// RUN: %clang -### -c -flto -fno-lto %s 2>&1 | FileCheck %s
+// RUN: %clang -### -c -flto -fno-lto -fno-integrated-as %s 2>&1 | FileCheck %s
+
+// CHECK-NOT: argument unused during compilation
diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c
index 796da768769e..3ca9f2847523 100644
--- a/test/Driver/clang_f_opts.c
+++ b/test/Driver/clang_f_opts.c
@@ -59,6 +59,13 @@
// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
+// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
+// RUN: %clang -### -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
+// RUN: %clang -### -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
+// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
+// CHECK-PROFILE-ARCS: "-femit-coverage-data"
+// CHECK-NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
+
// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
@@ -132,6 +139,9 @@
// RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s
// CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'
+// RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s
+// CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'
+
// Test that we don't error on these.
// RUN: %clang -### -S -Werror \
// RUN: -falign-functions -falign-functions=2 -fno-align-functions \
@@ -144,6 +154,7 @@
// RUN: -fident -fno-ident \
// RUN: -fimplicit-templates -fno-implicit-templates \
// RUN: -finput-charset=UTF-8 \
+// RUN: -fexec-charset=UTF-8 \
// RUN: -fivopts -fno-ivopts \
// RUN: -fnon-call-exceptions -fno-non-call-exceptions \
// RUN: -fpermissive -fno-permissive \
@@ -166,6 +177,56 @@
// RUN: -fstrength-reduce -fno-strength-reduce \
// RUN: -finline-limit=1000 \
// RUN: -finline-limit \
+// RUN: -flto=1 \
+// RUN: -falign-labels \
+// RUN: -falign-labels=100 \
+// RUN: -falign-loops \
+// RUN: -falign-loops=100 \
+// RUN: -falign-jumps \
+// RUN: -falign-jumps=100 \
+// RUN: -fexcess-precision=100 \
+// RUN: -fbranch-count-reg \
+// RUN: -fcaller-saves \
+// RUN: -fno-default-inline -fdefault-inline \
+// RUN: -fgcse-after-reload \
+// RUN: -fgcse-las \
+// RUN: -fgcse-sm \
+// RUN: -fipa-cp \
+// RUN: -finline-functions-called-once \
+// RUN: -fmodulo-sched \
+// RUN: -fmodulo-sched-allow-regmoves \
+// RUN: -fpeel-loops \
+// RUN: -frename-registers \
+// RUN: -fschedule-insns2 \
+// RUN: -fsingle-precision-constant \
+// RUN: -ftree_loop_im \
+// RUN: -ftree_loop_ivcanon \
+// RUN: -ftree_loop_linear \
+// RUN: -funsafe-loop-optimizations \
+// RUN: -fuse-linker-plugin \
+// RUN: -fvect-cost-model \
+// RUN: -fvariable-expansion-in-unroller \
+// RUN: -fweb \
+// RUN: -fwhole-program \
+// RUN: -fno-tree-dce -ftree-dce \
+// RUN: -fno-tree-ter -ftree-ter \
+// RUN: -fno-tree-vrp -ftree-vrp \
+// RUN: -fno-delete-null-pointer-checks -fdelete-null-pointer-checks \
+// RUN: -fno-inline-small-functions -finline-small-functions \
+// RUN: -fno-fat-lto-objects -ffat-lto-objects \
+// RUN: -fno-merge-constants -fmerge-constants \
+// RUN: -fno-caller-saves -fcaller-saves \
+// RUN: -fno-reorder-blocks -freorder-blocks \
+// RUN: -fno-schedule-insns2 -fschedule-insns2 \
+// RUN: -fno-stack-check \
+// RUN: -fno-check-new -fcheck-new \
+// RUN: -ffriend-injection \
+// RUN: -fno-implement-inlines -fimplement-inlines \
+// RUN: -fstack-check \
+// RUN: -fforce-addr \
+// RUN: -malign-functions=100 \
+// RUN: -malign-loops=100 \
+// RUN: -malign-jumps=100 \
// RUN: %s 2>&1 | FileCheck --check-prefix=IGNORE %s
// IGNORE-NOT: error: unknown argument
@@ -177,6 +238,7 @@
// RUN: -fno-expensive-optimizations \
// RUN: -fno-defer-pop \
// RUN: -finline-functions \
+// RUN: -fkeep-inline-functions \
// RUN: -fno-keep-inline-functions \
// RUN: -freorder-blocks \
// RUN: -fprofile-dir=/rand/dir \
@@ -197,6 +259,48 @@
// RUN: -ftracer \
// RUN: -funroll-all-loops \
// RUN: -funswitch-loops \
+// RUN: -flto=1 \
+// RUN: -falign-labels \
+// RUN: -falign-labels=100 \
+// RUN: -falign-loops \
+// RUN: -falign-loops=100 \
+// RUN: -falign-jumps \
+// RUN: -falign-jumps=100 \
+// RUN: -fexcess-precision=100 \
+// RUN: -fbranch-count-reg \
+// RUN: -fcaller-saves \
+// RUN: -fno-default-inline \
+// RUN: -fgcse-after-reload \
+// RUN: -fgcse-las \
+// RUN: -fgcse-sm \
+// RUN: -fipa-cp \
+// RUN: -finline-functions-called-once \
+// RUN: -fmodulo-sched \
+// RUN: -fmodulo-sched-allow-regmoves \
+// RUN: -fpeel-loops \
+// RUN: -frename-registers \
+// RUN: -fschedule-insns2 \
+// RUN: -fsingle-precision-constant \
+// RUN: -ftree_loop_im \
+// RUN: -ftree_loop_ivcanon \
+// RUN: -ftree_loop_linear \
+// RUN: -funsafe-loop-optimizations \
+// RUN: -fuse-linker-plugin \
+// RUN: -fvect-cost-model \
+// RUN: -fvariable-expansion-in-unroller \
+// RUN: -fweb \
+// RUN: -fwhole-program \
+// RUN: -fcaller-saves \
+// RUN: -freorder-blocks \
+// RUN: -fdelete-null-pointer-checks \
+// RUN: -ffat-lto-objects \
+// RUN: -fmerge-constants \
+// RUN: -finline-small-functions \
+// RUN: -ftree-dce \
+// RUN: -ftree-ter \
+// RUN: -ftree-vrp \
+// RUN: -fno-devirtualize \
+// RUN: -fno-devirtualize-speculatively \
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
@@ -204,6 +308,7 @@
// CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported
// CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported
// CHECK-WARNING-DAG: optimization flag '-finline-functions' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported
// CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported
// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
// CHECK-WARNING-DAG: optimization flag '-fprofile-dir=/rand/dir' is not supported
@@ -224,12 +329,57 @@
// CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported
// CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported
// CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported
+// CHECK-WARNING-DAG: optimization flag '-flto=1' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-labels' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-labels=100' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-loops' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-loops=100' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-jumps' is not supported
+// CHECK-WARNING-DAG: optimization flag '-falign-jumps=100' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fexcess-precision=100' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fbranch-count-reg' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fno-default-inline' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fgcse-after-reload' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fgcse-las' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fgcse-sm' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fipa-cp' is not supported
+// CHECK-WARNING-DAG: optimization flag '-finline-functions-called-once' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched-allow-regmoves' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fpeel-loops' is not supported
+// CHECK-WARNING-DAG: optimization flag '-frename-registers' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fschedule-insns2' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fsingle-precision-constant' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree_loop_im' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree_loop_ivcanon' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree_loop_linear' is not supported
+// CHECK-WARNING-DAG: optimization flag '-funsafe-loop-optimizations' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fuse-linker-plugin' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fvect-cost-model' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fvariable-expansion-in-unroller' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fweb' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fwhole-program' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
+// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fdelete-null-pointer-checks' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ffat-lto-objects' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fmerge-constants' is not supported
+// CHECK-WARNING-DAG: optimization flag '-finline-small-functions' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree-dce' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree-ter' is not supported
+// CHECK-WARNING-DAG: optimization flag '-ftree-vrp' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize' is not supported
+// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
// Test that we mute the warning on these
// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s
// RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument \
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
+// RUN: %clang -### -finline-limit \
+// RUN: -Winvalid-command-line-argument -Wno-ignored-optimization-argument \
+// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
// CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported
// CHECK-NO-WARNING2-NOT: optimization flag '-finline-limit' is not supported
diff --git a/test/Driver/constructors.c b/test/Driver/constructors.c
index a8b0942f01f4..cd14ed736a28 100644
--- a/test/Driver/constructors.c
+++ b/test/Driver/constructors.c
@@ -7,49 +7,58 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -fno-use-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -fno-use-init-array -fuse-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/fake_install_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -fuse-init-array \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm-unknown-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target mipsel-unknown-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target aarch64-none-linux-gnu \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
@@ -59,6 +68,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm64-none-linux-gnu \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
diff --git a/test/Driver/coverage_no_integrated_as.c b/test/Driver/coverage_no_integrated_as.c
new file mode 100644
index 000000000000..6f85b422d994
--- /dev/null
+++ b/test/Driver/coverage_no_integrated_as.c
@@ -0,0 +1,23 @@
+// REQUIRES: clang-driver
+// XFAIL: win32,win64
+
+// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+
+// RUN: %clang -### -S -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+
+// RUN: %clang -### -S -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// RUN: %clang -### -c -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+
+
+// CHECK-GCNO-DEFAULT-LOCATION: "-coverage-file" "{{.*}}/coverage_no_integrated_as.c"
+// CHECK-GCNO-DEFAULT-LOCATION-NOT: "-coverage-file" "/tmp/{{.*}}/coverage_no_integrated_as.c"
+// CHECK-GCNO-LOCATION: "-coverage-file" "/foo/bar.o"
+// CHECK-GCNO-LOCATION-REL-PATH: "-coverage-file" "{{.*}}/foo/bar.o"
diff --git a/test/Driver/crash report spaces.c b/test/Driver/crash report spaces.c
new file mode 100644
index 000000000000..9bc4626b48b8
--- /dev/null
+++ b/test/Driver/crash report spaces.c
@@ -0,0 +1,18 @@
+// RUN: rm -rf "%t"
+// RUN: mkdir "%t"
+// RUN: not env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTIONS=1 %clang -fsyntax-only "%s" 2>&1 | FileCheck "%s"
+// RUN: cat "%t/crash report spaces"-*.c | FileCheck --check-prefix=CHECKSRC "%s"
+// RUN: cat "%t/crash report spaces"-*.sh | FileCheck --check-prefix=CHECKSH "%s"
+// REQUIRES: crash-recovery
+
+// because of the glob (*.c, *.sh)
+// REQUIRES: shell
+
+#pragma clang __debug parser_crash
+// CHECK: Preprocessed source(s) and associated run script(s) are located at:
+// CHECK-NEXT: note: diagnostic msg: {{.*}}.c
+FOO
+// CHECKSRC: FOO
+// CHECKSH: "-cc1"
+// CHECKSH: "-main-file-name" "crash report spaces.c"
+// CHECKSH: "crash report spaces-{{[^ ]*}}.c"
diff --git a/test/Driver/crash-report-modules.m b/test/Driver/crash-report-modules.m
index d1c7832019cf..84b16044486b 100644
--- a/test/Driver/crash-report-modules.m
+++ b/test/Driver/crash-report-modules.m
@@ -25,8 +25,8 @@ const int x = MODULE_MACRO;
// CHECKSRC: @import simple;
// CHECKSRC: const int x = 10;
-// CHECKSH: -cc1
-// CHECKSH: -D "FOO=BAR"
-// CHECKSH-NOT: -fmodules-cache-path=/tmp/
-// CHECKSH: crash-report-modules-{{[^ ]*}}.m
-// CHECKSH: -ivfsoverlay crash-report-modules-{{[^ ]*}}.cache/vfs/vfs.yaml
+// CHECKSH: "-cc1"
+// CHECKSH: "-D" "FOO=BAR"
+// CHECKSH-NOT: "-fmodules-cache-path=/tmp/"
+// CHECKSH: "crash-report-modules-{{[^ ]*}}.m"
+// CHECKSH: "-ivfsoverlay" "crash-report-modules-{{[^ ]*}}.cache/vfs/vfs.yaml"
diff --git a/test/Driver/crash-report-null.test b/test/Driver/crash-report-null.test
new file mode 100644
index 000000000000..477dd28df3ed
--- /dev/null
+++ b/test/Driver/crash-report-null.test
@@ -0,0 +1,7 @@
+// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s
+
+// FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed"
+// XFAIL: mingw32
+
+// CHECK: Preprocessed source(s) and associated run script(s) are located at:
+// CHECK-NEXT: note: diagnostic msg: {{.*}}null-{{.*}}.c
diff --git a/test/Driver/crash-report.c b/test/Driver/crash-report.c
index da1ff950fb9a..3370da88692f 100644
--- a/test/Driver/crash-report.c
+++ b/test/Driver/crash-report.c
@@ -13,27 +13,23 @@
// because of the glob (*.c, *.sh)
// REQUIRES: shell
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s
-
-// FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed"
-// XFAIL: mingw32
-
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
-// CHECK-NEXT: note: diagnostic msg: {{.*}}.c
+// CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-{{.*}}.c
FOO
// CHECKSRC: FOO
-// CHECKSH: -cc1
-// CHECKSH: -D "FOO=BAR"
-// CHECKSH-NOT: -F/tmp/
-// CHECKSH-NOT: -I /tmp/
-// CHECKSH-NOT: -idirafter /tmp/
-// CHECKSH-NOT: -iquote /tmp/
-// CHECKSH-NOT: -isystem /tmp/
-// CHECKSH-NOT: -iprefix /the/prefix
-// CHECKSH-NOT: -iwithprefix /tmp/
-// CHECKSH-NOT: -iwithprefixbefore /tmp/
-// CHECKSH-NOT: -internal-isystem /tmp/
-// CHECKSH-NOT: -internal-externc-isystem /tmp/
-// CHECKSH-NOT: -dwarf-debug-flags
-// CHECKSH: crash-report-{{[^ ]*}}.c
+// CHECKSH: "-cc1"
+// CHECKSH: "-main-file-name" "crash-report.c"
+// CHECKSH: "-D" "FOO=BAR"
+// CHECKSH-NOT: "-F/tmp/"
+// CHECKSH-NOT: "-I" "/tmp/"
+// CHECKSH-NOT: "-idirafter" "/tmp/"
+// CHECKSH-NOT: "-iquote" "/tmp/"
+// CHECKSH-NOT: "-isystem" "/tmp/"
+// CHECKSH-NOT: "-iprefix" "/the/prefix"
+// CHECKSH-NOT: "-iwithprefix" "/tmp/"
+// CHECKSH-NOT: "-iwithprefixbefore" "/tmp/"
+// CHECKSH-NOT: "-internal-isystem" "/tmp/"
+// CHECKSH-NOT: "-internal-externc-isystem" "/tmp/"
+// CHECKSH-NOT: "-dwarf-debug-flags"
+// CHECKSH: "crash-report-{{[^ ]*}}.c"
diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c
index ade8d8f62f33..3b1350489294 100644
--- a/test/Driver/cross-linux.c
+++ b/test/Driver/cross-linux.c
@@ -3,24 +3,24 @@
// RUN: --target=i386-unknown-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-I386 %s
// CHECK-I386: "-cc1" "-triple" "i386-unknown-linux-gnu"
-// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\}}as" "--32"
-// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\}}ld" {{.*}} "-m" "elf_i386"
+// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}as" "--32"
+// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf_i386"
//
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
// RUN: --target=x86_64-unknown-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-X86-64 %s
// CHECK-X86-64: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}as" "--64"
-// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}ld" {{.*}} "-m" "elf_x86_64"
+// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}as" "--64"
+// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf_x86_64"
//
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
// RUN: --target=x86_64-unknown-linux-gnux32 \
// RUN: | FileCheck --check-prefix=CHECK-X32 %s
// CHECK-X32: "-cc1" "-triple" "x86_64-unknown-linux-gnux32"
-// CHECK-X32: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}as" "--x32"
-// CHECK-X32: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}ld" {{.*}} "-m" "elf32_x86_64"
+// CHECK-X32: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}as" "--x32"
+// CHECK-X32: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf32_x86_64"
//
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
@@ -38,8 +38,8 @@
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-MULTI32-I386 %s
// CHECK-MULTI32-I386: "-cc1" "-triple" "i386-unknown-linux"
-// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}as" "--32"
-// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}as" "--32"
+// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld"
// CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
// CHECK-MULTI32-I386: "-m" "elf_i386"
// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
@@ -55,8 +55,8 @@
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-MULTI32-X86-64 %s
// CHECK-MULTI32-X86-64: "-cc1" "-triple" "x86_64-unknown-linux"
-// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}as" "--64"
-// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}as" "--64"
+// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld"
// CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
// CHECK-MULTI32-X86-64: "-m" "elf_x86_64"
// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o"
@@ -73,8 +73,8 @@
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-MULTI64-I386 %s
// CHECK-MULTI64-I386: "-cc1" "-triple" "i386-unknown-linux"
-// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}as" "--32"
-// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}as" "--32"
+// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld"
// CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
// CHECK-MULTI64-I386: "-m" "elf_i386"
// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o"
@@ -91,8 +91,8 @@
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-MULTI64-X86-64 %s
// CHECK-MULTI64-X86-64: "-cc1" "-triple" "x86_64-unknown-linux"
-// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}as" "--64"
-// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}as" "--64"
+// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld"
// CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
// CHECK-MULTI64-X86-64: "-m" "elf_x86_64"
// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
diff --git a/test/Driver/darwin-arch-default.c b/test/Driver/darwin-arch-default.c
index 60bf61de8a34..e7e5e89ed085 100644
--- a/test/Driver/darwin-arch-default.c
+++ b/test/Driver/darwin-arch-default.c
@@ -2,6 +2,42 @@
//
// RUN: %clang -target powerpc-apple-darwin8 -### \
// RUN: -ccc-print-phases %s 2> %t
-// RUN: FileCheck --check-prefix=CHECK-POWERPC < %t %s
+// RUN: FileCheck --check-prefix=CHECK-BIND-PPC < %t %s
//
-// CHECK-POWERPC: bind-arch, "ppc"
+// CHECK-BIND-PPC: bind-arch, "ppc"
+//
+// RUN: %clang -target powerpc64-apple-darwin8 -### \
+// RUN: -ccc-print-phases %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-BIND-PPC64 < %t %s
+//
+// CHECK-BIND-PPC64: bind-arch, "ppc64"
+
+// Check that the correct arch name is passed to the external assembler
+//
+// RUN: %clang -target powerpc-apple-darwin8 -### \
+// RUN: -no-integrated-as -c %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-AS-PPC < %t %s
+//
+// CHECK-AS-PPC: {{as(.exe)?"}}
+// CHECK-AS-PPC: "-arch" "ppc"
+//
+// RUN: %clang -target powerpc64-apple-darwin8 -### \
+// RUN: -no-integrated-as -c %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-AS-PPC64 < %t %s
+//
+// CHECK-AS-PPC64: {{as(.exe)?"}}
+// CHECK-AS-PPC64: "-arch" "ppc64"
+
+// Check that the correct arch name is passed to the external linker
+//
+// RUN: %clang -target powerpc-apple-darwin8 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-LD-PPC < %t %s
+//
+// CHECK-LD-PPC: {{ld(.exe)?"}}
+// CHECK-LD-PPC: "-arch" "ppc"
+//
+// RUN: %clang -target powerpc64-apple-darwin8 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-LD-PPC64 < %t %s
+//
+// CHECK-LD-PPC64: {{ld(.exe)?"}}
+// CHECK-LD-PPC64: "-arch" "ppc64"
diff --git a/test/Driver/darwin-debug-flags.c b/test/Driver/darwin-debug-flags.c
index f98e9ce7bd8c..abe3f6953e32 100644
--- a/test/Driver/darwin-debug-flags.c
+++ b/test/Driver/darwin-debug-flags.c
@@ -1,11 +1,12 @@
-// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s
+// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin9 -I "path with \spaces" -g -Os %s -emit-llvm -S -o - | FileCheck %s
// <rdar://problem/7256886>
// RUN: touch %t.s
// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s
// <rdar://problem/12955296>
// RUN: %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=P %s
-// CHECK: !0 = metadata !{
+// CHECK: !0 = !{
+// CHECK: -I path\5C with\5C \5C\5Cspaces
// CHECK: -g -Os
// CHECK: -mmacosx-version-min=10.5.0
// CHECK: [ DW_TAG_compile_unit ]
@@ -15,3 +16,6 @@ int x;
// S: "-dwarf-debug-flags"
// P: "-dwarf-debug-producer"
+
+// This depends on shell quoting.
+// REQUIRES: shell
diff --git a/test/Driver/darwin-dsymutil.c b/test/Driver/darwin-dsymutil.c
index 59084a2c85ed..0e2c4907104e 100644
--- a/test/Driver/darwin-dsymutil.c
+++ b/test/Driver/darwin-dsymutil.c
@@ -6,13 +6,14 @@
//
// CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-dsymutil.c", c
// CHECK-MULTIARCH-ACTIONS: 1: preprocessor, {0}, cpp-output
-// CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, assembler
-// CHECK-MULTIARCH-ACTIONS: 3: assembler, {2}, object
-// CHECK-MULTIARCH-ACTIONS: 4: linker, {3}, image
-// CHECK-MULTIARCH-ACTIONS: 5: bind-arch, "i386", {4}, image
-// CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "x86_64", {4}, image
-// CHECK-MULTIARCH-ACTIONS: 7: lipo, {5, 6}, image
-// CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM
+// CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, ir
+// CHECK-MULTIARCH-ACTIONS: 3: backend, {2}, assembler
+// CHECK-MULTIARCH-ACTIONS: 4: assembler, {3}, object
+// CHECK-MULTIARCH-ACTIONS: 5: linker, {4}, image
+// CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "i386", {5}, image
+// CHECK-MULTIARCH-ACTIONS: 7: bind-arch, "x86_64", {5}, image
+// CHECK-MULTIARCH-ACTIONS: 8: lipo, {6, 7}, image
+// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
//
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -arch i386 -arch x86_64 %s -g 2> %t
diff --git a/test/Driver/darwin-ld-demangle.c b/test/Driver/darwin-ld-demangle.c
new file mode 100644
index 000000000000..1eef3c70322f
--- /dev/null
+++ b/test/Driver/darwin-ld-demangle.c
@@ -0,0 +1,8 @@
+// REQUIRES: system-darwin
+
+// On Darwin, -demangle is passed to the linker of HOST_LINK_VERSION
+// is high enough. It is assumed to be high enough on systems where
+// this test gets run.
+
+// RUN: %clang -### %s 2>&1 | FileCheck %s
+// CHECK: -demangle
diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c
index 2da0d30b5008..d3d0f1da197b 100644
--- a/test/Driver/darwin-ld.c
+++ b/test/Driver/darwin-ld.c
@@ -17,6 +17,8 @@
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
+// LINK_IPHONE_3_0: -iphoneos_version_min
+// LINK_IPHONE_3_0: 3.0.0
// LINK_IPHONE_3_0-NOT: -lcrt1.3.1.o
// LINK_IPHONE_3_0: -lcrt1.o
// LINK_IPHONE_3_0: -lSystem
@@ -34,6 +36,8 @@
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
+// LINK_IPHONE_3_1: -iphoneos_version_min
+// LINK_IPHONE_3_1: 3.1.0
// LINK_IPHONE_3_1-NOT: -lcrt1.o
// LINK_IPHONE_3_1: -lcrt1.3.1.o
// LINK_IPHONE_3_1: -lSystem
@@ -51,6 +55,8 @@
// RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
+// LINK_IOSSIM_3_0: -ios_simulator_version_min
+// LINK_IOSSIM_3_0: 3.0.0
// LINK_IOSSIM_3_0-NOT: -lcrt1.o
// LINK_IOSSIM_3_0: -lSystem
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
@@ -187,10 +193,14 @@
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
// LINK_X86_64H_MULTIARCH: "x86_64h"
-// Check that clang passes -iphoneos_version_min to the linker when building
-// for the iOS simulator but when -mios-simulator-version-min is not
-// explicitly specified (<rdar://problem/15959009>).
+// Check for the linker options to specify the iOS version when the
+// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
+// deployment target options.
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-darwin -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
+// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
+// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
+// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
diff --git a/test/Driver/darwin-max-type-align.c b/test/Driver/darwin-max-type-align.c
new file mode 100644
index 000000000000..6532f4aeeb91
--- /dev/null
+++ b/test/Driver/darwin-max-type-align.c
@@ -0,0 +1,15 @@
+// Check the -fmax-type-align=N flag
+// rdar://16254558
+//
+// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST0 %s
+// TEST0: -fmax-type-align=16
+// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST1 %s
+// TEST1: -fmax-type-align=32
+// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST2 %s
+// TEST2-NOT: -fmax-type-align
+// RUN: %clang -no-canonical-prefixes -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST3 %s
+// TEST3-NOT: -fmax-type-align
diff --git a/test/Driver/darwin-sanitizer-ld.c b/test/Driver/darwin-sanitizer-ld.c
index 85cfb73c4a34..500fec4b2fcf 100644
--- a/test/Driver/darwin-sanitizer-ld.c
+++ b/test/Driver/darwin-sanitizer-ld.c
@@ -7,6 +7,8 @@
// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN: stdc++
// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
+// CHECK-ASAN: "-rpath" "@executable_path"
+// CHECK-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -fsanitize=address -mios-simulator-version-min=7.0 %s -o %t.o 2>&1 \
@@ -15,6 +17,8 @@
// CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
// CHECK-ASAN-IOSSIM: lc++
// CHECK-ASAN-IOSSIM: libclang_rt.asan_iossim_dynamic.dylib"
+// CHECK-ASAN-IOSSIM: "-rpath" "@executable_path"
+// CHECK-ASAN-IOSSIM: "-rpath" "{{.*}}lib{{.*}}darwin"
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
@@ -22,7 +26,9 @@
// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
// CHECK-DYN-ASAN: "-dylib"
-// CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib
+// CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib"
+// CHECK-DYN-ASAN: "-rpath" "@executable_path"
+// CHECK-DYN-ASAN: "-rpath" "{{.*}}lib{{.*}}darwin"
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -fsanitize=undefined %s -o %t.o 2>&1 \
diff --git a/test/Driver/darwin-sdkroot.c b/test/Driver/darwin-sdkroot.c
index b727fa6bb0ce..58bc683320ff 100644
--- a/test/Driver/darwin-sdkroot.c
+++ b/test/Driver/darwin-sdkroot.c
@@ -33,3 +33,10 @@
//
// It doesn't make sense on msys bash.
// REQUIRES: shell-preserves-root
+//
+// This test will fail with MSYS env.exe, since it does not preserve root,
+// expanding / into C:/MINGW/MSYS/1.0. To see the problem, from cmd.exe run:
+//
+// env SDKROOT=/ cmd //c echo %SDKROOT%
+//
+// This test passes using env.exe from GnuWin32.
diff --git a/test/Driver/darwin-verify-debug.c b/test/Driver/darwin-verify-debug.c
index 4878c746e07e..ebbf89a4d636 100644
--- a/test/Driver/darwin-verify-debug.c
+++ b/test/Driver/darwin-verify-debug.c
@@ -1,13 +1,12 @@
// Check that we verify debug output properly with multiple -arch options.
//
-// REQUIRES: asserts
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
// RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
//
// CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-verify-debug.c", c
-// CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM
-// CHECK-MULTIARCH-ACTIONS: 9: verify-debug-info, {8}, none
+// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
+// CHECK-MULTIARCH-ACTIONS: 10: verify-debug-info, {9}, none
//
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t
diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c
index a8fadb36e74b..50461798efd0 100644
--- a/test/Driver/debug-options.c
+++ b/test/Driver/debug-options.c
@@ -33,6 +33,8 @@
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
//
+// RUN: %clang -### -c -g1 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -gmlt %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
@@ -51,6 +53,8 @@
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
+// RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \
+// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_NO %s
//
diff --git a/test/Driver/default-image-name.c b/test/Driver/default-image-name.c
new file mode 100644
index 000000000000..00cf7dfbd95d
--- /dev/null
+++ b/test/Driver/default-image-name.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target i386-unknown-linux-gnu %s -### 2>&1 | FileCheck -check-prefix=LINUX %s
+// LINUX: a.out
+
+// RUN: %clang -target i686-pc-windows-msvc %s -### 2>&1 | FileCheck -check-prefix=WIN %s
+// RUN: %clang -target i686-pc-windows-gnu %s -### 2>&1 | FileCheck -check-prefix=WIN %s
+// RUN: %clang -target i686-windows-gnu %s -### 2>&1 | FileCheck -check-prefix=WIN %s
+// WIN: a.exe
diff --git a/test/Driver/env.c b/test/Driver/env.c
new file mode 100644
index 000000000000..f243fa641c76
--- /dev/null
+++ b/test/Driver/env.c
@@ -0,0 +1,28 @@
+// These tests try to ensure that the driver operates reasonably when run with
+// a strange environment. Unfortunately, it requires a normal shell and the
+// 'env' command.
+//
+// REQUIRES: shell
+// The PATH variable is heavily used when trying to find a linker.
+// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
+//
+// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
+//
+// CHECK-LD-32-NOT: warning:
+// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
+// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
+// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
+// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
+// CHECK-LD-32: "-L[[SYSROOT]]/lib"
+// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
diff --git a/test/Driver/fatal-warnings.c b/test/Driver/fatal-warnings.c
new file mode 100644
index 000000000000..6239b25e8917
--- /dev/null
+++ b/test/Driver/fatal-warnings.c
@@ -0,0 +1,8 @@
+// RUN: %clang -### %s -c -o tmp.o -target i686-pc-linux-gnu -integrated-as -Wa,--fatal-warnings 2>&1 | FileCheck %s
+// RUN: not %clang %s -c -o %t.o -target i686-pc-linux-gnu -integrated-as -Wa,--fatal-warnings 2>&1 %t.log
+// FileCheck --check-prefix=CHECK-AS %s -input-file %t.log
+
+// CHECK: "-cc1" {{.*}} "-massembler-fatal-warnings"
+// CHECK-AS: error: .warning argument must be a string
+
+__asm(".warning 1");
diff --git a/test/Driver/fortran.f95 b/test/Driver/fortran.f95
new file mode 100644
index 000000000000..9334cbec442a
--- /dev/null
+++ b/test/Driver/fortran.f95
@@ -0,0 +1,9 @@
+// Check that the clang driver can invoke gcc to compile Fortran.
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -c %s -### 2>&1 \
+// RUN: | FileCheck %s
+// CHECK: gcc
+// CHECK: "-S"
+// CHECK: "-x" "f95"
+// CHECK: clang
+// CHECK: "-cc1as"
diff --git a/test/Driver/freebsd.c b/test/Driver/freebsd.c
index f0275d0156f7..a7448c11bfe6 100644
--- a/test/Driver/freebsd.c
+++ b/test/Driver/freebsd.c
@@ -1,4 +1,12 @@
// RUN: %clang -no-canonical-prefixes \
+// RUN: -target aarch64-pc-freebsd11 %s \
+// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ARM64 %s
+// CHECK-ARM64: "-cc1" "-triple" "aarch64-pc-freebsd11"
+// CHECK-ARM64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-ARM64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
+//
+// RUN: %clang -no-canonical-prefixes \
// RUN: -target powerpc-pc-freebsd8 %s \
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PPC %s
@@ -120,11 +128,11 @@
// RUN: | FileCheck --check-prefix=CHECK-LTO %s
// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so
-// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic 2>&1 \
+// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s
// CHECK-SPARC-PIE: as{{.*}}" "-KPIC
-// RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### 2>&1 \
+// RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SPARC-CPU %s
// CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc"
// CHECK-SPARC-CPU: as{{.*}}" "-Av9a
diff --git a/test/Driver/freebsd.cc b/test/Driver/freebsd.cpp
index dea3267233cc..dea3267233cc 100644
--- a/test/Driver/freebsd.cc
+++ b/test/Driver/freebsd.cpp
diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c
index 57ea5a243fe4..1988503f677c 100644
--- a/test/Driver/fsanitize.c
+++ b/test/Driver/fsanitize.c
@@ -1,13 +1,13 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
-// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool),?){14}"}}
+// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){16}"}}
// CHECK-UNDEFINED-TRAP: "-fsanitize-undefined-trap-on-error"
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED
-// CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool),?){16}"}}
+// CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){18}"}}
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN
-// CHECK-UNDEFINED-DARWIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool),?){15}"}}
+// CHECK-UNDEFINED-DARWIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER
// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift),?){4}"}}
@@ -15,8 +15,14 @@
// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS
// CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}}
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=all %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-ALL
+// CHECK-FSANITIZE-ALL: error: unsupported argument 'all' to option 'fsanitize='
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,undefined -fno-sanitize=all -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FNO-SANITIZE-ALL
+// CHECK-FNO-SANITIZE-ALL: "-fsanitize=thread"
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED
-// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds),?){12}"}}
+// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds|returns-nonnull-attribute|nonnull-attribute),?){14}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP-ON-ERROR-UNDEF
// CHECK-UNDEFINED-TRAP-ON-ERROR-UNDEF: '-fsanitize=undefined' not allowed with '-fsanitize-undefined-trap-on-error'
@@ -80,12 +86,40 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=3 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-3
// CHECK-TRACK-ORIGINS-3: error: invalid value '3' in '-fsanitize-memory-track-origins=3'
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-0
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-0
+// CHECK-SANITIZE-COVERAGE-0-NOT: fsanitize-coverage
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=bool -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
+// CHECK-SANITIZE-COVERAGE-1: fsanitize-coverage=1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-4
+// CHECK-SANITIZE-COVERAGE-4: fsanitize-coverage=4
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=5 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-5
+// CHECK-SANITIZE-COVERAGE-5: error: invalid value '5' in '-fsanitize-coverage=5'
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-UNUSED
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=dataflow -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-UNUSED
+// RUN: %clang -target x86_64-linux-gnu -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-UNUSED
+// CHECK-SANITIZE-COVERAGE-UNUSED: argument unused during compilation: '-fsanitize-coverage=1'
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-0
+// CHECK-ASAN-FIELD-PADDING-0-NOT: -fsanitize-address-field-padding
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-1
+// CHECK-ASAN-FIELD-PADDING-1: -fsanitize-address-field-padding=1
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-2
+// CHECK-ASAN-FIELD-PADDING-2: -fsanitize-address-field-padding=2
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=3 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-3
+// CHECK-ASAN-FIELD-PADDING-3: error: invalid value '3' in '-fsanitize-address-field-padding=3'
+// RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-NO-ASAN
+// CHECK-ASAN-FIELD-PADDING-NO-ASAN: warning: argument unused during compilation: '-fsanitize-address-field-padding=2'
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
// OK
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE
-// CHECK-TSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
-// CHECK-TSAN-NO-PIE: "-pie"
+// CHECK-TSAN-NO-PIE: "-mrelocation-model" "static"
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NO-PIE
// CHECK-MSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
@@ -98,13 +132,22 @@
// RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic"
-// RUN: %clang -target x86_64-linux-gnu %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
-// RUN: %clang -target x86_64-linux-gnu %s -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
-// RUN: %clang -target x86_64-linux-gnu %s -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
-// RUN: %clang -target x86_64-linux-gnu %s -fno-sanitize-recover -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
-// RUN: %clang -target x86_64-linux-gnu %s -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
-// CHECK-RECOVER-NOT: sanitize-recover
-// CHECK-NO-RECOVER: "-fno-sanitize-recover"
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=thread -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover -fsanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=object-size -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-RECOVER
+
+// CHECK-RECOVER: "-fsanitize-recover={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){16}"}}
+// CHECK-NO-RECOVER-NOT: sanitize-recover
+// CHECK-PARTIAL-RECOVER: "-fsanitize-recover=object-size"
+
+// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=address,foobar,object-size,unreachable -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG-RECOVER
+// CHECK-DIAG-RECOVER: unsupported argument 'foobar' to option 'fsanitize-recover='
+// CHECK-DIAG-RECOVER: unsupported argument 'address,unreachable' to option 'fsanitize-recover='
// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL
// CHECK-SANL: "-fsanitize=leak"
@@ -142,3 +185,21 @@
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN
// CHECK-FSAN-UBSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10'
+
+// RUN: %clang_cl -fsanitize=address -c -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// RUN: %clang_cl -fsanitize=address -c -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// RUN: %clang_cl -fsanitize=address -c -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// RUN: %clang_cl -fsanitize=address -c -MD -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// RUN: %clang_cl -fsanitize=address -c -MT -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// RUN: %clang_cl -fsanitize=address -c -LD -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL
+// CHECK-ASAN-DEBUGRTL: error: invalid argument
+// CHECK-ASAN-DEBUGRTL: not allowed with '-fsanitize=address'
+// CHECK-ASAN-DEBUGRTL: note: AddressSanitizer doesn't support linking with debug runtime libraries yet
+
+// RUN: %clang_cl -fsanitize=address -c -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// RUN: %clang_cl -fsanitize=address -c -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// RUN: %clang_cl -fsanitize=address -c -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// RUN: %clang_cl -fsanitize=address -c -MTd -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// RUN: %clang_cl -fsanitize=address -c -MDd -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// RUN: %clang_cl -fsanitize=address -c -LDd -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL
+// CHECK-ASAN-RELEASERTL-NOT: error: invalid argument
diff --git a/test/Driver/gcc-version-debug.c b/test/Driver/gcc-version-debug.c
index ff38c2805238..daa9606ef7a5 100644
--- a/test/Driver/gcc-version-debug.c
+++ b/test/Driver/gcc-version-debug.c
@@ -1,4 +1,5 @@
// RUN: %clang -v --target=i386-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree 2>&1 | FileCheck %s
// CHECK: Found candidate GCC installation: {{.*}}Inputs{{.}}debian_multiarch_tree{{.}}usr{{.}}lib{{.}}gcc{{.}}i686-linux-gnu{{.}}4.5
diff --git a/test/Driver/gcc_forward.c b/test/Driver/gcc_forward.c
index 3bc413193f16..4892bd92ac69 100644
--- a/test/Driver/gcc_forward.c
+++ b/test/Driver/gcc_forward.c
@@ -11,10 +11,6 @@
//
// clang-cc1
// CHECK: "-Wall" "-Wdocumentation"
-// CHECK: "-o" "{{[^"]+}}.s"
-//
-// gnu-as
-// CHECK: as{{[^"]*}}"
// CHECK: "-o" "{{[^"]+}}.o"
//
// gcc-ld
diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c
index 87c33c755fc7..984dc0439ddb 100644
--- a/test/Driver/hexagon-toolchain-elf.c
+++ b/test/Driver/hexagon-toolchain-elf.c
@@ -4,22 +4,24 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK001 %s
// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK002 %s
// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -nostdinc, -nostdlibinc, -nostdinc++
@@ -27,6 +29,7 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK003 %s
@@ -34,10 +37,11 @@
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK004 %s
@@ -45,10 +49,11 @@
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK005 %s
@@ -57,54 +62,59 @@
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdinc++ \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK006 %s
// CHECK006: "-cc1"
// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -march=<archname> -mcpu=<archname> -mv<number>
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -march=hexagonv3 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK007 %s
// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv3"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -mcpu=hexagonv5 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK008 %s
// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv5"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -mv2 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK009 %s
// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv2"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK010 %s
// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv4"
// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
@@ -131,11 +141,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK011 %s
// CHECK011: "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK011-NOT: "-static"
// CHECK011-NOT: "-shared"
// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -155,11 +166,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK012 %s
// CHECK012: "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK012-NOT: "-static"
// CHECK012-NOT: "-shared"
// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -180,12 +192,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -Lone -L two -L three \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK013 %s
// CHECK013: "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
@@ -204,12 +217,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -static \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK014 %s
// CHECK014: "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK014: "-static"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
@@ -225,12 +239,13 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -shared \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK015 %s
// CHECK015: "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK015: "-shared" "-call_shared"
// CHECK015-NOT: crt0_standalone.o
// CHECK015-NOT: crt0.o
@@ -254,13 +269,14 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -shared \
// RUN: -static \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK016 %s
// CHECK016: "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK016: "-shared" "-call_shared" "-static"
// CHECK016-NOT: crt0_standalone.o
// CHECK016-NOT: crt0.o
@@ -287,12 +303,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlib \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK017 %s
// CHECK017: "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK017-NOT: crt0_standalone.o
// CHECK017-NOT: crt0.o
// CHECK017-NOT: init.o
@@ -313,12 +330,13 @@
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostartfiles \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK018 %s
// CHECK018: "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK018-NOT: crt0_standalone.o
// CHECK018-NOT: crt0.o
// CHECK018-NOT: init.o
@@ -339,12 +357,13 @@
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nodefaultlibs \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK019 %s
// CHECK019: "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
@@ -368,12 +387,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -moslib=first -moslib=second \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK020 %s
// CHECK020: "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK020-NOT: "-static"
// CHECK020-NOT: "-shared"
// CHECK020-NOT: crt0_standalone.o
@@ -393,12 +413,13 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -moslib=first -moslib=second -moslib=standalone\
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK021 %s
// CHECK021: "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK021-NOT: "-static"
// CHECK021-NOT: "-shared"
// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -421,6 +442,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -s \
// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
// RUN: -t \
@@ -429,8 +451,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK022 %s
// CHECK022: "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
@@ -453,27 +475,31 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK023 %s
// CHECK023: "-cc1"
// CHECK023: "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK023-NOT: "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK023-NOT: "-G{{[0-9]+}}"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fpic \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fPIC \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fPIC \
// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
@@ -482,32 +508,35 @@
// CHECK024-NOT: "-mrelocation-model" "static"
// CHECK024: "-pic-level" "{{[12]}}"
// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK024: "-G0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK024: "-G0"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -G=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -G 8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// CHECK025: "-cc1"
// CHECK025: "-mrelocation-model" "static"
// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK025: "-G8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK025: "-G8"
// -----------------------------------------------------------------------------
@@ -515,22 +544,24 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -pie \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK026 %s
// CHECK026: "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK026: "-pie"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -pie -shared \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK027 %s
// CHECK027: "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK027-NOT: "-pie"
// -----------------------------------------------------------------------------
@@ -538,25 +569,27 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK028 %s
// CHECK028: "-cc1"
// CHECK028: "-mqdsp6-compat"
// CHECK028: "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// -----------------------------------------------------------------------------
// Test Assembler related args
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -gdwarf-2 \
// RUN: -Wa,--noexecstack,--trap \
// RUN: -Xassembler --keep-locals \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK029 %s
// CHECK029: "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK029: "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
diff --git a/test/Driver/hexagon-toolchain.c b/test/Driver/hexagon-toolchain.c
index 88440f8d9d9b..391b78a13ea6 100644
--- a/test/Driver/hexagon-toolchain.c
+++ b/test/Driver/hexagon-toolchain.c
@@ -4,22 +4,24 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK001 %s
// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK002 %s
// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -nostdinc, -nostdlibinc, -nostdinc++
@@ -27,6 +29,7 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK003 %s
@@ -34,10 +37,11 @@
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK004 %s
@@ -45,10 +49,11 @@
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK005 %s
@@ -57,54 +62,59 @@
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdinc++ \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK006 %s
// CHECK006: "-cc1"
// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
+// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -march=<archname> -mcpu=<archname> -mv<number>
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -march=hexagonv3 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK007 %s
// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv3"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -mcpu=hexagonv5 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK008 %s
// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv5"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -mv2 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK009 %s
// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv2"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK010 %s
// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv4"
// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
@@ -131,11 +141,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK011 %s
// CHECK011: "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK011-NOT: "-static"
// CHECK011-NOT: "-shared"
// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -155,11 +166,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK012 %s
// CHECK012: "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK012-NOT: "-static"
// CHECK012-NOT: "-shared"
// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -180,12 +192,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -Lone -L two -L three \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK013 %s
// CHECK013: "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
@@ -204,12 +217,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -static \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK014 %s
// CHECK014: "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK014: "-static"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
@@ -225,12 +239,13 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -shared \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK015 %s
// CHECK015: "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK015: "-shared" "-call_shared"
// CHECK015-NOT: crt0_standalone.o
// CHECK015-NOT: crt0.o
@@ -254,13 +269,14 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -shared \
// RUN: -static \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK016 %s
// CHECK016: "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK016: "-shared" "-call_shared" "-static"
// CHECK016-NOT: crt0_standalone.o
// CHECK016-NOT: crt0.o
@@ -287,12 +303,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostdlib \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK017 %s
// CHECK017: "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK017-NOT: crt0_standalone.o
// CHECK017-NOT: crt0.o
// CHECK017-NOT: init.o
@@ -313,12 +330,13 @@
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nostartfiles \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK018 %s
// CHECK018: "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK018-NOT: crt0_standalone.o
// CHECK018-NOT: crt0.o
// CHECK018-NOT: init.o
@@ -339,12 +357,13 @@
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -nodefaultlibs \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK019 %s
// CHECK019: "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
@@ -368,12 +387,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -moslib=first -moslib=second \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK020 %s
// CHECK020: "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK020-NOT: "-static"
// CHECK020-NOT: "-shared"
// CHECK020-NOT: crt0_standalone.o
@@ -393,12 +413,13 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -moslib=first -moslib=second -moslib=standalone\
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK021 %s
// CHECK021: "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK021-NOT: "-static"
// CHECK021-NOT: "-shared"
// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -421,6 +442,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -s \
// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
// RUN: -t \
@@ -429,8 +451,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK022 %s
// CHECK022: "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
@@ -453,27 +475,31 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK023 %s
// CHECK023: "-cc1"
// CHECK023: "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK023-NOT: "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK023-NOT: "-G{{[0-9]+}}"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fpic \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fPIC \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -fPIC \
// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
@@ -482,32 +508,35 @@
// CHECK024-NOT: "-mrelocation-model" "static"
// CHECK024: "-pic-level" "{{[12]}}"
// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK024: "-G0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK024: "-G0"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -G=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -G 8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK025 %s
// CHECK025: "-cc1"
// CHECK025: "-mrelocation-model" "static"
// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK025: "-G8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK025: "-G8"
// -----------------------------------------------------------------------------
@@ -515,22 +544,24 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -pie \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK026 %s
// CHECK026: "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK026: "-pie"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -pie -shared \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK027 %s
// CHECK027: "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// CHECK027-NOT: "-pie"
// -----------------------------------------------------------------------------
@@ -538,25 +569,27 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK028 %s
// CHECK028: "-cc1"
// CHECK028: "-mqdsp6-compat"
// CHECK028: "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
// -----------------------------------------------------------------------------
// Test Assembler related args
// -----------------------------------------------------------------------------
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN: --gcc-toolchain="" \
// RUN: -gdwarf-2 \
// RUN: -Wa,--noexecstack,--trap \
// RUN: -Xassembler --keep-locals \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK029 %s
// CHECK029: "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
// CHECK029: "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
diff --git a/test/Driver/ident_md.c b/test/Driver/ident_md.c
index 7b2b2f6a7dee..0e664c2e1ea6 100644
--- a/test/Driver/ident_md.c
+++ b/test/Driver/ident_md.c
@@ -2,5 +2,5 @@
// Verify that clang version appears in the llvm.ident metadata.
// CHECK: !llvm.ident = !{{{.*}}}
-// CHECK: !{{[0-9]+}} = metadata !{metadata !{{.*}}
+// CHECK: !{{[0-9]+}} = !{!{{.*}}
diff --git a/test/Driver/instrprof-ld.c b/test/Driver/instrprof-ld.c
index f70ae474d0db..f16fa8f0ed34 100644
--- a/test/Driver/instrprof-ld.c
+++ b/test/Driver/instrprof-ld.c
@@ -35,7 +35,7 @@
// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386-SHARED %s
//
// CHECK-LINUX-I386-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
-// CHECK-LINUX-I386-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-pic-i386.a" {{.*}} "-lc"
+// CHECK-LINUX-I386-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -shared \
@@ -45,7 +45,7 @@
// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64-SHARED %s
//
// CHECK-LINUX-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
-// CHECK-LINUX-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-pic-x86_64.a" {{.*}} "-lc"
+// CHECK-LINUX-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -shared \
@@ -55,4 +55,4 @@
// RUN: | FileCheck --check-prefix=CHECK-FREEBSD-X86-64-SHARED %s
//
// CHECK-FREEBSD-X86-64-SHARED: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
-// CHECK-FREEBSD-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-pic-x86_64.a"
+// CHECK-FREEBSD-X86-64-SHARED: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}freebsd{{/|\\\\}}libclang_rt.profile-x86_64.a"
diff --git a/test/Driver/le32-unknown-nacl.cpp b/test/Driver/le32-unknown-nacl.cpp
index e029f667a192..379ddb6c63d8 100644
--- a/test/Driver/le32-unknown-nacl.cpp
+++ b/test/Driver/le32-unknown-nacl.cpp
@@ -4,9 +4,9 @@
// ECHO: {{.*}} "-cc1" {{.*}}le32-unknown-nacl.c
-// Check platform defines
-#include <stdarg.h>
-#include <stddef.h>
+typedef __builtin_va_list va_list;
+typedef __SIZE_TYPE__ size_t;
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
extern "C" {
diff --git a/test/Driver/le64-unknown-unknown.cpp b/test/Driver/le64-unknown-unknown.cpp
new file mode 100644
index 000000000000..d0a58598ffe7
--- /dev/null
+++ b/test/Driver/le64-unknown-unknown.cpp
@@ -0,0 +1,137 @@
+// RUN: %clang -target le64-unknown-unknown -### %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target le64-unknown-unknown %s -emit-llvm -S -c -o - | FileCheck %s
+
+// ECHO: {{.*}} "-cc1" {{.*}}le64-unknown-unknown.c
+
+typedef __builtin_va_list va_list;
+typedef __SIZE_TYPE__ size_t;
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
+extern "C" {
+
+// CHECK: @align_c = global i32 1
+int align_c = __alignof(char);
+
+// CHECK: @align_s = global i32 2
+int align_s = __alignof(short);
+
+// CHECK: @align_i = global i32 4
+int align_i = __alignof(int);
+
+// CHECK: @align_l = global i32 8
+int align_l = __alignof(long);
+
+// CHECK: @align_ll = global i32 8
+int align_ll = __alignof(long long);
+
+// CHECK: @align_p = global i32 8
+int align_p = __alignof(void*);
+
+// CHECK: @align_f = global i32 4
+int align_f = __alignof(float);
+
+// CHECK: @align_d = global i32 8
+int align_d = __alignof(double);
+
+// CHECK: @align_ld = global i32 8
+int align_ld = __alignof(long double);
+
+// CHECK: @align_vl = global i32 4
+int align_vl = __alignof(va_list);
+
+// CHECK: __LITTLE_ENDIAN__defined
+#ifdef __LITTLE_ENDIAN__
+void __LITTLE_ENDIAN__defined() {}
+#endif
+
+// CHECK: __le64defined
+#ifdef __le64
+void __le64defined() {}
+#endif
+
+// CHECK: __le64__defined
+#ifdef __le64__
+void __le64__defined() {}
+#endif
+
+// CHECK: unixdefined
+#ifdef unix
+void unixdefined() {}
+#endif
+
+// CHECK: __unixdefined
+#ifdef __unix
+void __unixdefined() {}
+#endif
+
+// CHECK: __unix__defined
+#ifdef __unix__
+void __unix__defined() {}
+#endif
+
+// CHECK: __ELF__defined
+#ifdef __ELF__
+void __ELF__defined() {}
+#endif
+
+// Check types
+
+// CHECK: signext i8 @check_char()
+char check_char() { return 0; }
+
+// CHECK: signext i16 @check_short()
+short check_short() { return 0; }
+
+// CHECK: i32 @check_int()
+int check_int() { return 0; }
+
+// CHECK: i64 @check_long()
+long check_long() { return 0; }
+
+// CHECK: i64 @check_longlong()
+long long check_longlong() { return 0; }
+
+// CHECK: zeroext i8 @check_uchar()
+unsigned char check_uchar() { return 0; }
+
+// CHECK: zeroext i16 @check_ushort()
+unsigned short check_ushort() { return 0; }
+
+// CHECK: i32 @check_uint()
+unsigned int check_uint() { return 0; }
+
+// CHECK: i64 @check_ulong()
+unsigned long check_ulong() { return 0; }
+
+// CHECK: i64 @check_ulonglong()
+unsigned long long check_ulonglong() { return 0; }
+
+// CHECK: i64 @check_size_t()
+size_t check_size_t() { return 0; }
+
+// CHECK: i64 @check_ptrdiff_t()
+ptrdiff_t check_ptrdiff_t() { return 0; }
+
+// CHECK: float @check_float()
+float check_float() { return 0; }
+
+// CHECK: double @check_double()
+double check_double() { return 0; }
+
+// CHECK: double @check_longdouble()
+long double check_longdouble() { return 0; }
+
+}
+
+template<int> void Switch();
+template<> void Switch<4>();
+template<> void Switch<8>();
+template<> void Switch<16>();
+
+void check_pointer_size() {
+ // CHECK: SwitchILi8
+ Switch<sizeof(void*)>();
+
+ // CHECK: SwitchILi16
+ Switch<sizeof(va_list)>();
+}
diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp
index 309ece28db77..c62c4941f5ec 100644
--- a/test/Driver/linux-header-search.cpp
+++ b/test/Driver/linux-header-search.cpp
@@ -8,6 +8,7 @@
// RUN: -stdlib=libc++ \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
// CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -18,6 +19,7 @@
// RUN: -stdlib=libc++ \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
// CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -28,6 +30,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
// CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1"
// CHECK-UBUNTU-11-04: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -42,6 +45,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu \
// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04 %s
// CHECK-UBUNTU-13-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-13-04: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -57,6 +61,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnux32 \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04 %s
// CHECK-UBUNTU-14-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-14-04: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -72,6 +77,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target arm-linux-gnueabihf \
// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-CROSS %s
// CHECK-UBUNTU-13-04-CROSS: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-13-04-CROSS: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -87,6 +93,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu -m32 \
// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-M32 %s
// CHECK-UBUNTU-13-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-13-04-M32: "-triple" "i386-unknown-linux-gnu"
@@ -100,6 +107,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu -m32 \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-M32 %s
// CHECK-UBUNTU-14-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-14-04-M32: "-triple" "i386-unknown-linux-gnu"
@@ -114,6 +122,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu -m32 \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree2 \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-I686 %s
// CHECK-UBUNTU-14-04-I686: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-14-04-I686: "-triple" "i386-unknown-linux-gnu"
@@ -126,6 +135,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target powerpc64le-unknown-linux-gnu -m32 \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
// CHECK-UBUNTU-14-04-PPC64LE: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-UBUNTU-14-04-PPC64LE: "-triple" "powerpc64le-unknown-linux-gnu"
@@ -141,6 +151,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i686-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
// CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -155,6 +166,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
// CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -169,6 +181,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target powerpc-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
// CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -183,6 +196,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target powerpc64-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
// CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -200,6 +214,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu \
// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.2_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-2 %s
// CHECK-GENTOO-4-6-2: "{{.*}}clang{{.*}}" "-cc1"
// CHECK-GENTOO-4-6-2: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -213,6 +228,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu \
// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.4_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-4 %s
// CHECK-GENTOO-4-6-4: "{{.*}}clang{{.*}}" "-cc1"
// CHECK-GENTOO-4-6-4: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -228,6 +244,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target mips64-unknown-linux-gnuabi64 \
// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64-GNUABI %s
// CHECK-MIPS64-GNUABI: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-MIPS64-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
@@ -244,6 +261,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target mips64el-unknown-linux-gnuabi64 \
// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI %s
// CHECK-MIPS64EL-GNUABI: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-MIPS64EL-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
index 6a47d08274d2..1ce923b61ac3 100644
--- a/test/Driver/linux-ld.c
+++ b/test/Driver/linux-ld.c
@@ -3,6 +3,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// CHECK-LD-32-NOT: warning:
@@ -16,6 +17,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
// CHECK-LD-64-NOT: warning:
@@ -35,6 +37,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux-gnux32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s
// CHECK-LD-X32-NOT: warning:
@@ -48,6 +51,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=compiler-rt \
// RUN: | FileCheck --check-prefix=CHECK-LD-RT %s
@@ -68,6 +72,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --rtlib=libgcc \
// RUN: | FileCheck --check-prefix=CHECK-LD-GCC %s
@@ -89,6 +94,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
// RUN: -static-libgcc \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
// CHECK-LD-64-STATIC-LIBGCC-NOT: warning:
@@ -109,6 +115,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
// RUN: -static \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
// CHECK-LD-64-STATIC-NOT: warning:
@@ -129,11 +136,13 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux \
// RUN: -static-libgcc -static \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s
// CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -150,6 +159,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m64 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s
// CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -167,6 +177,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -m64 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s
// CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -183,6 +194,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -m32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s
// CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -200,6 +212,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux-gnux32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-X32 %s
// CHECK-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -217,6 +230,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -mx32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-X32 %s
// CHECK-64-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -234,6 +248,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -mx32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-X32 %s
// CHECK-32-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -250,6 +265,41 @@
// CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnux32 -m64 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-X32-TO-64 %s
+// CHECK-X32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-X32-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/lib"
+// CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnux32 -m32 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-X32-TO-32 %s
+// CHECK-X32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-X32-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/lib"
+// CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -m32 \
// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
@@ -266,6 +316,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s
// CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -277,6 +328,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -m64 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s
// CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -288,6 +340,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
// CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -296,6 +349,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s
// CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -304,6 +358,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s
// CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -312,6 +367,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s
// CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -324,6 +380,7 @@
// RUN: -target x86_64-unknown-linux-gnu \
// RUN: -stdlib=libc++ \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
// RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
// CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
@@ -335,6 +392,7 @@
// RUN: -target x86_64-unknown-linux-gnu \
// RUN: -stdlib=libc++ \
// RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
// RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
// CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
@@ -347,6 +405,7 @@
// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i386-unknown-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
// CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -361,6 +420,7 @@
// Check multi arch support on Ubuntu 12.04 LTS.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-unknown-linux-gnueabihf \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -378,6 +438,7 @@
// Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-gnueabihf \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
// RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -396,6 +457,7 @@
// Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-gnueabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
// RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -414,6 +476,7 @@
// Check Ubuntu 14.04 on powerpc64le.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc64le-unknown-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
// CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -432,6 +495,7 @@
// "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux-gnux32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s
// CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -451,6 +515,7 @@
// Check fedora 18 on arm.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=armv7-unknown-linux-gnueabihf \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/fedora_18_tree \
// RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
// CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -465,10 +530,12 @@
// Check Fedora 21 on AArch64.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-unknown-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/fedora_21_tree \
// RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-unknown-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/fedora_21_tree \
// RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
// CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -482,6 +549,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-unknown-linux-gnueabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
// CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -499,6 +567,7 @@
// Test the setup that shipped in SUSE 10.3 on ppc64.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc64-suse-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
// RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
// CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -524,12 +593,47 @@
// CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
//
// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-PPC64 %s
+// CHECK-PPC64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-PPC64: "-m" "elf64ppc"
+// CHECK-PPC64: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64-linux-gnu -mabi=elfv1 \
+// RUN: | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
+// CHECK-PPC64-ELFv1: "{{.*}}ld{{(.exe)?}}"
+// CHECK-PPC64-ELFv1: "-m" "elf64ppc"
+// CHECK-PPC64-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64-linux-gnu -mabi=elfv2 \
+// RUN: | FileCheck --check-prefix=CHECK-PPC64-ELFv2 %s
+// CHECK-PPC64-ELFv2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-PPC64-ELFv2: "-m" "elf64ppc"
+// CHECK-PPC64-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc64le-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-PPC64LE %s
// CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}"
// CHECK-PPC64LE: "-m" "elf64lppc"
// CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
//
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64le-linux-gnu -mabi=elfv1 \
+// RUN: | FileCheck --check-prefix=CHECK-PPC64LE-ELFv1 %s
+// CHECK-PPC64LE-ELFv1: "{{.*}}ld{{(.exe)?}}"
+// CHECK-PPC64LE-ELFv1: "-m" "elf64lppc"
+// CHECK-PPC64LE-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc64le-linux-gnu -mabi=elfv2 \
+// RUN: | FileCheck --check-prefix=CHECK-PPC64LE-ELFv2 %s
+// CHECK-PPC64LE-ELFv2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
+// CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
+//
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
// and provide correct path to the dynamic linker and emulation mode when build
// for MIPS platforms.
@@ -633,6 +737,7 @@
// Thoroughly exercise the Debian multiarch environment.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
// CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -645,6 +750,7 @@
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
// CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -657,6 +763,7 @@
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
// CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -669,6 +776,7 @@
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc64-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
// CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -681,6 +789,7 @@
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
// CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -693,6 +802,7 @@
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
// CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -705,6 +815,7 @@
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
// CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -716,6 +827,7 @@
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
// CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -727,6 +839,7 @@
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-linux-gnu -mabi=n32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s
// CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -738,6 +851,7 @@
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-gnu -mabi=n32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s
// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -751,34 +865,42 @@
// Test linker invocation on Android.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -791,16 +913,19 @@
// CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
@@ -811,21 +936,25 @@
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
@@ -840,6 +969,7 @@
// CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
@@ -850,6 +980,7 @@
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
@@ -860,21 +991,25 @@
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: --target=x86-linux-android \
+// RUN: --target=x86_64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
@@ -888,41 +1023,49 @@
// CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
@@ -935,34 +1078,42 @@
// CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
// CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker"
@@ -971,18 +1122,22 @@
// Test that -pthread does not add -lpthread on Android.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
@@ -991,53 +1146,64 @@
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=aarch64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=i686-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-linux-android -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
@@ -1045,6 +1211,7 @@
//
// RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \
// RUN: --target=arm-linux-androideabi -pthread \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
// CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
@@ -1052,6 +1219,7 @@
// Check linker invocation on Debian 6 MIPS 32/64-bit.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1068,6 +1236,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-gnu \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1084,6 +1253,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-gnu -mabi=n32 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1100,6 +1270,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-linux-gnuabi64 -mabi=n64 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
// CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1119,6 +1290,7 @@
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64el-linux-gnuabi64 -mabi=n64 \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
// CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1139,6 +1311,7 @@
// Test linker invocation for Freescale SDK (OpenEmbedded).
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc-fsl-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/freescale_ppc_tree \
// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s
// CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1148,6 +1321,7 @@
// CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=powerpc64-fsl-linux \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \
// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
// CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -1158,41 +1332,53 @@
//
// Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
// RUN: %clang --target=x86_64-unknown-linux -### %s \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// We don't have crtfastmath.o in the i386 tree, use it to check that file
// detection works.
// RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o
@@ -1200,12 +1386,14 @@
// Check that we link in gcrt1.o when compiling with -pg
// RUN: %clang -pg --target=x86_64-unknown-linux -### %s \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
// RUN: | FileCheck --check-prefix=CHECK-PG %s
// CHECK-PG: gcrt1.o
// GCC forwards -u to the linker.
// RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
// RUN: | FileCheck --check-prefix=CHECK-u %s
// CHECK-u: "-u" "asdf"
diff --git a/test/Driver/lto.c b/test/Driver/lto.c
index 91524bf78b1d..62300bd8fac1 100644
--- a/test/Driver/lto.c
+++ b/test/Driver/lto.c
@@ -1,19 +1,22 @@
// -flto causes a switch to llvm-bc object files.
// RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log
-// RUN: grep '2: compiler, {1}, lto-bc' %t.log
+// RUN: grep '2: compiler, {1}, ir' %t.log
+// RUN: grep '3: backend, {2}, lto-bc' %t.log
// RUN: %clang -ccc-print-phases %s -flto 2> %t.log
// RUN: grep '0: input, ".*lto.c", c' %t.log
// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
-// RUN: grep '2: compiler, {1}, lto-bc' %t.log
-// RUN: grep '3: linker, {2}, image' %t.log
+// RUN: grep '2: compiler, {1}, ir' %t.log
+// RUN: grep '3: backend, {2}, lto-bc' %t.log
+// RUN: grep '4: linker, {3}, image' %t.log
// llvm-bc and llvm-ll outputs need to match regular suffixes
// (unfortunately).
// RUN: %clang %s -flto -save-temps -### 2> %t.log
// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log
-// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log
-// RUN: grep '".*a.out" .*".*lto\.o"' %t.log
+// RUN: grep '"-o" ".*lto\.bc" .*".*lto\.i"' %t.log
+// RUN: grep '"-o" ".*lto\.o" .*".*lto\.bc"' %t.log
+// RUN: grep '".*a\.\(out\|exe\)" .*".*lto\.o"' %t.log
// RUN: %clang %s -flto -S -### 2> %t.log
// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
diff --git a/test/Driver/mips-as.c b/test/Driver/mips-as.c
index ecbe7d668f96..12f184437417 100644
--- a/test/Driver/mips-as.c
+++ b/test/Driver/mips-as.c
@@ -51,7 +51,7 @@
// RUN: %clang -target mips64el-linux-gnu -mabi=64 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS64R2-EL-AS %s
-// MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL"
+// MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EL"
//
// RUN: %clang -target mips-linux-gnu -march=mips32r2 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
@@ -61,7 +61,7 @@
// RUN: %clang -target mips64-linux-gnu -march=octeon -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-OCTEON %s
-// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips-linux-gnu -mips1 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
@@ -106,17 +106,17 @@
// RUN: %clang -target mips64-linux-gnu -mips64 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64 %s
-// MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips64-linux-gnu -mips64r2 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s
-// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips64-linux-gnu -mips64r6 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6 %s
-// MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips-linux-gnu -mno-mips16 -mips16 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
@@ -214,15 +214,15 @@
//
// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips3 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS3-EB-AS %s
-// MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips4 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS4-EB-AS %s
-// MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips5 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS5-EB-AS %s
-// MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS32-EB-AS %s
@@ -236,11 +236,11 @@
//
// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS64-EB-AS %s
-// MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64r6 \
// RUN: 2>&1 | FileCheck -check-prefix=MIPS64R6-EB-AS %s
-// MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
+// MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-KPIC" "-EB"
//
// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -mhard-float -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=HARDFLOAT --implicit-check-not=-msoft-float %s
diff --git a/test/Driver/mips-cs.cpp b/test/Driver/mips-cs.cpp
index ad031a935de3..62a90f0b9110 100644
--- a/test/Driver/mips-cs.cpp
+++ b/test/Driver/mips-cs.cpp
@@ -28,6 +28,35 @@
// CHECK-BE-HF-32: "[[TC]]{{/|\\\\}}crtend.o"
// CHECK-BE-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, hard float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-32 %s
+// CHECK-BE-UC-HF-32: "-internal-isystem"
+// CHECK-BE-UC-HF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-BE-UC-HF-32: "-internal-isystem"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc"
+// CHECK-BE-UC-HF-32: "-internal-isystem"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-BE-UC-HF-32: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-32: "[[TC]]/include"
+// CHECK-BE-UC-HF-32: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-BE-UC-HF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-HF-32: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc"
+// CHECK-BE-UC-HF-32: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-HF-32: "[[TC]]/uclibc{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-HF-32: "-L[[TC]]/uclibc"
+// CHECK-BE-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc"
+// CHECK-BE-UC-HF-32-NOT: "-L[[TC]]"
+// CHECK-BE-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/lib/../lib"
+// CHECK-BE-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/lib/../lib"
+// CHECK-BE-UC-HF-32: "[[TC]]/uclibc{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -mips16 \
@@ -115,6 +144,35 @@
// CHECK-BE-HF-NAN: "[[TC]]/nan2008{{/|\\\\}}crtend.o"
// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, hard float, uclibc, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -muclibc -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-NAN %s
+// CHECK-BE-UC-HF-NAN: "-internal-isystem"
+// CHECK-BE-UC-HF-NAN: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-BE-UC-HF-NAN: "-internal-isystem"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc/nan2008"
+// CHECK-BE-UC-HF-NAN: "-internal-isystem"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-BE-UC-HF-NAN: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/include"
+// CHECK-BE-UC-HF-NAN: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-BE-UC-HF-NAN: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-HF-NAN: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008"
+// CHECK-BE-UC-HF-NAN: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/uclibc/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-HF-NAN: "-L[[TC]]/uclibc/nan2008"
+// CHECK-BE-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc/nan2008"
+// CHECK-BE-UC-HF-NAN-NOT: "-L[[TC]]"
+// CHECK-BE-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/lib/../lib"
+// CHECK-BE-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/usr/lib/../lib"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/uclibc/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -msoft-float \
@@ -144,6 +202,35 @@
// CHECK-BE-SF-32: "[[TC]]/soft-float{{/|\\\\}}crtend.o"
// CHECK-BE-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, soft float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -muclibc -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-SF-32 %s
+// CHECK-BE-UC-SF-32: "-internal-isystem"
+// CHECK-BE-UC-SF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-BE-UC-SF-32: "-internal-isystem"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc/soft-float"
+// CHECK-BE-UC-SF-32: "-internal-isystem"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-BE-UC-SF-32: "-internal-externc-isystem"
+// CHECK-BE-UC-SF-32: "[[TC]]/include"
+// CHECK-BE-UC-SF-32: "-internal-externc-isystem"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-BE-UC-SF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-SF-32: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float"
+// CHECK-BE-UC-SF-32: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-SF-32: "[[TC]]/uclibc/soft-float{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-SF-32: "-L[[TC]]/uclibc/soft-float"
+// CHECK-BE-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc/soft-float"
+// CHECK-BE-UC-SF-32-NOT: "-L[[TC]]"
+// CHECK-BE-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/lib/../lib"
+// CHECK-BE-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/usr/lib/../lib"
+// CHECK-BE-UC-SF-32: "[[TC]]/uclibc/soft-float{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -msoft-float -mips16 \
@@ -289,6 +376,35 @@
// CHECK-EL-HF-32: "[[TC]]/el{{/|\\\\}}crtend.o"
// CHECK-EL-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, hard float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mhard-float -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-32 %s
+// CHECK-EL-UC-HF-32: "-internal-isystem"
+// CHECK-EL-UC-HF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-EL-UC-HF-32: "-internal-isystem"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc/el"
+// CHECK-EL-UC-HF-32: "-internal-isystem"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-EL-UC-HF-32: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-32: "[[TC]]/include"
+// CHECK-EL-UC-HF-32: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-EL-UC-HF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-HF-32: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el"
+// CHECK-EL-UC-HF-32: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-HF-32: "[[TC]]/uclibc/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-HF-32: "-L[[TC]]/uclibc/el"
+// CHECK-EL-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc/el"
+// CHECK-EL-UC-HF-32-NOT: "-L[[TC]]"
+// CHECK-EL-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/lib/../lib"
+// CHECK-EL-UC-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/usr/lib/../lib"
+// CHECK-EL-UC-HF-32: "[[TC]]/uclibc/el{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-HF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips16 \
@@ -376,6 +492,35 @@
// CHECK-EL-HF-NAN: "[[TC]]/nan2008/el{{/|\\\\}}crtend.o"
// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, hard float, uclibc, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -muclibc -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-NAN %s
+// CHECK-EL-UC-HF-NAN: "-internal-isystem"
+// CHECK-EL-UC-HF-NAN: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-EL-UC-HF-NAN: "-internal-isystem"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc/nan2008/el"
+// CHECK-EL-UC-HF-NAN: "-internal-isystem"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-EL-UC-HF-NAN: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/include"
+// CHECK-EL-UC-HF-NAN: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-EL-UC-HF-NAN: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-HF-NAN: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el"
+// CHECK-EL-UC-HF-NAN: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/uclibc/nan2008/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-HF-NAN: "-L[[TC]]/uclibc/nan2008/el"
+// CHECK-EL-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc/nan2008/el"
+// CHECK-EL-UC-HF-NAN-NOT: "-L[[TC]]"
+// CHECK-EL-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/lib/../lib"
+// CHECK-EL-UC-HF-NAN: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/../lib"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/uclibc/nan2008/el{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/nan2008/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft \
@@ -405,6 +550,35 @@
// CHECK-EL-SF-32: "[[TC]]/soft-float/el{{/|\\\\}}crtend.o"
// CHECK-EL-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, soft float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-SF-32 %s
+// CHECK-EL-UC-SF-32: "-internal-isystem"
+// CHECK-EL-UC-SF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
+// CHECK-EL-UC-SF-32: "-internal-isystem"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/uclibc/soft-float/el"
+// CHECK-EL-UC-SF-32: "-internal-isystem"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward"
+// CHECK-EL-UC-SF-32: "-internal-externc-isystem"
+// CHECK-EL-UC-SF-32: "[[TC]]/include"
+// CHECK-EL-UC-SF-32: "-internal-externc-isystem"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/usr/include"
+// CHECK-EL-UC-SF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-SF-32: "--sysroot=[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el"
+// CHECK-EL-UC-SF-32: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-SF-32: "[[TC]]/uclibc/soft-float/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-SF-32: "-L[[TC]]/uclibc/soft-float/el"
+// CHECK-EL-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/uclibc/soft-float/el"
+// CHECK-EL-UC-SF-32-NOT: "-L[[TC]]"
+// CHECK-EL-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/lib/../lib"
+// CHECK-EL-UC-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/../lib"
+// CHECK-EL-UC-SF-32: "[[TC]]/uclibc/soft-float/el{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-SF-32: "[[TC]]/../../../../mips-linux-gnu/libc/uclibc/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float \
diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c
index 03cc0fd7e368..f7022306fc11 100644
--- a/test/Driver/mips-features.c
+++ b/test/Driver/mips-features.c
@@ -1,5 +1,15 @@
// Check handling MIPS specific features options.
//
+// -mabicalls
+// RUN: %clang -target mips-linux-gnu -### -c %s -mno-abicalls -mabicalls 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MABICALLS %s
+// CHECK-MABICALLS: "-target-feature" "-noabicalls"
+//
+// -mno-abicalls
+// RUN: %clang -target mips-linux-gnu -### -c %s -mabicalls -mno-abicalls 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MNOABICALLS %s
+// CHECK-MNOABICALLS: "-target-feature" "+noabicalls"
+//
// -mips16
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mno-mips16 -mips16 2>&1 \
diff --git a/test/Driver/mips-fsf.cpp b/test/Driver/mips-fsf.cpp
index 34ad91456e12..07b95c8fe9de 100644
--- a/test/Driver/mips-fsf.cpp
+++ b/test/Driver/mips-fsf.cpp
@@ -297,6 +297,33 @@
// CHECK-BE-HF-32R2: "[[TC]]{{/|\\\\}}crtend.o"
// CHECK-BE-HF-32R2: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, mips32r2, hard float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mhard-float -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-32R2 %s
+// CHECK-BE-UC-HF-32R2: "-internal-isystem"
+// CHECK-BE-UC-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-UC-HF-32R2: "-internal-isystem"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc"
+// CHECK-BE-UC-HF-32R2: "-internal-isystem"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-UC-HF-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/include"
+// CHECK-BE-UC-HF-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-BE-UC-HF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-HF-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc"
+// CHECK-BE-UC-HF-32R2: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/uclibc{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-HF-32R2: "-L[[TC]]/uclibc"
+// CHECK-BE-UC-HF-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc"
+// CHECK-BE-UC-HF-32R2: "-L[[TC]]/../../../../sysroot/uclibc/usr/lib/../lib"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/uclibc{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, mips32r2, fp64, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -mips32r2 -mfp64 -mhard-float \
@@ -351,6 +378,33 @@
// CHECK-BE-SF-32R2: "[[TC]]/sof{{/|\\\\}}crtend.o"
// CHECK-BE-SF-32R2: "[[TC]]/../../../../sysroot/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, mips32r2, soft float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -msoft-float -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-SF-32R2 %s
+// CHECK-BE-UC-SF-32R2: "-internal-isystem"
+// CHECK-BE-UC-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-UC-SF-32R2: "-internal-isystem"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/sof"
+// CHECK-BE-UC-SF-32R2: "-internal-isystem"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-UC-SF-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/include"
+// CHECK-BE-UC-SF-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-BE-UC-SF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-SF-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc/sof"
+// CHECK-BE-UC-SF-32R2: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/uclibc/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-SF-32R2: "-L[[TC]]/uclibc/sof"
+// CHECK-BE-UC-SF-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc/sof"
+// CHECK-BE-UC-SF-32R2: "-L[[TC]]/../../../../sysroot/uclibc/sof/usr/lib/../lib"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/uclibc/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, mips32r2 / mips16, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -mhard-float \
@@ -513,6 +567,33 @@
// CHECK-BE-NAN-32R2: "[[TC]]/nan2008{{/|\\\\}}crtend.o"
// CHECK-BE-NAN-32R2: "[[TC]]/../../../../sysroot/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Big-endian, mips32r2, nan2008, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mnan=2008 -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-UC-NAN-32R2 %s
+// CHECK-BE-UC-NAN-32R2: "-internal-isystem"
+// CHECK-BE-UC-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-UC-NAN-32R2: "-internal-isystem"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/nan2008"
+// CHECK-BE-UC-NAN-32R2: "-internal-isystem"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-UC-NAN-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/include"
+// CHECK-BE-UC-NAN-32R2: "-internal-externc-isystem"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-BE-UC-NAN-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-UC-NAN-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc/nan2008"
+// CHECK-BE-UC-NAN-32R2: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/uclibc/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-UC-NAN-32R2: "-L[[TC]]/uclibc/nan2008"
+// CHECK-BE-UC-NAN-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc/nan2008"
+// CHECK-BE-UC-NAN-32R2: "-L[[TC]]/../../../../sysroot/uclibc/nan2008/usr/lib/../lib"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/uclibc/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Big-endian, mips32r2, fp64, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu -mips32r2 -mfp64 -mnan=2008 \
@@ -1566,6 +1647,33 @@
// CHECK-EL-HF-32R2: "[[TC]]/el{{/|\\\\}}crtend.o"
// CHECK-EL-HF-32R2: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, mips32r2, hard float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mhard-float -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-32R2 %s
+// CHECK-EL-UC-HF-32R2: "-internal-isystem"
+// CHECK-EL-UC-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-UC-HF-32R2: "-internal-isystem"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el"
+// CHECK-EL-UC-HF-32R2: "-internal-isystem"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-UC-HF-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/include"
+// CHECK-EL-UC-HF-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-EL-UC-HF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-HF-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc/el"
+// CHECK-EL-UC-HF-32R2: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/uclibc/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-HF-32R2: "-L[[TC]]/uclibc/el"
+// CHECK-EL-UC-HF-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc/el"
+// CHECK-EL-UC-HF-32R2: "-L[[TC]]/../../../../sysroot/uclibc/el/usr/lib/../lib"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/uclibc/el{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-HF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, mips32r2, fp64, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips32r2 -mfp64 -mhard-float \
@@ -1620,6 +1728,33 @@
// CHECK-EL-SF-32R2: "[[TC]]/el/sof{{/|\\\\}}crtend.o"
// CHECK-EL-SF-32R2: "[[TC]]/../../../../sysroot/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, mips32r2, soft float, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -msoft-float -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-SF-32R2 %s
+// CHECK-EL-UC-SF-32R2: "-internal-isystem"
+// CHECK-EL-UC-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-UC-SF-32R2: "-internal-isystem"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/sof"
+// CHECK-EL-UC-SF-32R2: "-internal-isystem"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-UC-SF-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/include"
+// CHECK-EL-UC-SF-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-EL-UC-SF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-SF-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc/el/sof"
+// CHECK-EL-UC-SF-32R2: "-dynamic-linker" "/lib/ld-uClibc.so.0"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/uclibc/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-SF-32R2: "-L[[TC]]/uclibc/el/sof"
+// CHECK-EL-UC-SF-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc/el/sof"
+// CHECK-EL-UC-SF-32R2: "-L[[TC]]/../../../../sysroot/uclibc/el/sof/usr/lib/../lib"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/uclibc/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-SF-32R2: "[[TC]]/../../../../sysroot/uclibc/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, mips32r2 / mips16, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -mhard-float \
@@ -1782,6 +1917,33 @@
// CHECK-EL-NAN-32R2: "[[TC]]/el/nan2008{{/|\\\\}}crtend.o"
// CHECK-EL-NAN-32R2: "[[TC]]/../../../../sysroot/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
//
+// = Little-endian, mips32r2, nan2008, uclibc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mnan=2008 -muclibc \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-UC-NAN-32R2 %s
+// CHECK-EL-UC-NAN-32R2: "-internal-isystem"
+// CHECK-EL-UC-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-UC-NAN-32R2: "-internal-isystem"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/uclibc/el/nan2008"
+// CHECK-EL-UC-NAN-32R2: "-internal-isystem"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-UC-NAN-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/include"
+// CHECK-EL-UC-NAN-32R2: "-internal-externc-isystem"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/usr/include"
+// CHECK-EL-UC-NAN-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-UC-NAN-32R2: "--sysroot=[[TC]]/../../../../sysroot/uclibc/el/nan2008"
+// CHECK-EL-UC-NAN-32R2: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/uclibc/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-UC-NAN-32R2: "-L[[TC]]/uclibc/el/nan2008"
+// CHECK-EL-UC-NAN-32R2: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/../lib/uclibc/el/nan2008"
+// CHECK-EL-UC-NAN-32R2: "-L[[TC]]/../../../../sysroot/uclibc/el/nan2008/usr/lib/../lib"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/uclibc/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-UC-NAN-32R2: "[[TC]]/../../../../sysroot/uclibc/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
// = Little-endian, mips32r2, fp64, nan2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu -mips32r2 -mfp64 -mnan=2008 \
diff --git a/test/Driver/mips-integrated-as.s b/test/Driver/mips-integrated-as.s
index c3b1db391e0f..b648650e4be9 100644
--- a/test/Driver/mips-integrated-as.s
+++ b/test/Driver/mips-integrated-as.s
@@ -205,3 +205,13 @@
// FPXX-ODDSPREG: -cc1as
// FPXX-ODDSPREG: "-target-feature" "+fpxx"
// FPXX-ODDSPREG: "-target-feature" "-nooddspreg"
+
+// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -c %s -mabicalls 2>&1 | \
+// RUN: FileCheck -check-prefix=ABICALLS-ON %s
+// ABICALLS-ON: -cc1as
+// ABICALLS-ON: "-target-feature" "-noabicalls"
+
+// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -c %s -mno-abicalls 2>&1 | \
+// RUN: FileCheck -check-prefix=ABICALLS-OFF %s
+// ABICALLS-OFF: -cc1as
+// ABICALLS-OFF: "-target-feature" "+noabicalls"
diff --git a/test/Driver/mips-reduced-toolchain.cpp b/test/Driver/mips-reduced-toolchain.cpp
index fe7ed8ae045d..894bdb5a756b 100644
--- a/test/Driver/mips-reduced-toolchain.cpp
+++ b/test/Driver/mips-reduced-toolchain.cpp
@@ -4,6 +4,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_reduced_mips_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
// CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.7{{/|\\\\}}crtbegin.o"
@@ -17,6 +18,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mipsel-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_reduced_mips_tree \
+// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
// CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.7{{/|\\\\}}crtbegin.o"
diff --git a/test/Driver/modules.m b/test/Driver/modules.m
index d8e20e4148e9..8a0c8ba4d88f 100644
--- a/test/Driver/modules.m
+++ b/test/Driver/modules.m
@@ -4,18 +4,36 @@
// RUN: %clang -fmodules -fno-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
// CHECK-HAS-MODULES: -fmodules
-// RUN: %clang -fbuild-session-timestamp=123 -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s
-// TIMESTAMP_ONLY: -fbuild-session-timestamp=123
+// RUN: %clang -fbuild-session-file=doesntexist -### %s 2>&1 | FileCheck -check-prefix=NOFILE %s
+// NOFILE: no such file or directory: 'doesntexist'
+
+// RUN: touch -m -a -t 201008011501 %t.build-session-file
+// RUN: %clang -fbuild-session-file=%t.build-session-file -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s
+
+// RUN: %clang -fbuild-session-timestamp=1280703457 -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s
+// TIMESTAMP_ONLY: -fbuild-session-timestamp=128
+
+// RUN: %clang -fbuild-session-file=%t.build-session-file -fbuild-session-timestamp=123 -### %s 2>&1 | FileCheck -check-prefix=CONFLICT %s
+// CONFLICT: error: invalid argument '-fbuild-session-file={{.*}}.build-session-file' not allowed with '-fbuild-session-timestamp'
// RUN: %clang -fbuild-session-timestamp=123 -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE %s
// MODULES_VALIDATE_ONCE: -fbuild-session-timestamp=123
// MODULES_VALIDATE_ONCE: -fmodules-validate-once-per-build-session
+// RUN: %clang -fbuild-session-file=%t.build-session-file -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_FILE %s
+// MODULES_VALIDATE_ONCE_FILE: -fbuild-session-timestamp=128
+// MODULES_VALIDATE_ONCE_FILE: -fmodules-validate-once-per-build-session
+
// RUN: %clang -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_ERR %s
-// MODULES_VALIDATE_ONCE_ERR: option '-fmodules-validate-once-per-build-session' requires '-fbuild-session-timestamp=<seconds since Epoch>'
+// MODULES_VALIDATE_ONCE_ERR: option '-fmodules-validate-once-per-build-session' requires '-fbuild-session-timestamp=<seconds since Epoch>' or '-fbuild-session-file=<file>'
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT %s
// MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT-NOT: -fmodules-validate-system-headers
// RUN: %clang -fmodules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s
// MODULES_VALIDATE_SYSTEM_HEADERS: -fmodules-validate-system-headers
+
+// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s
+// CHECK-MODULE-MAP-FILES: "-fmodules"
+// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map"
+// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map"
diff --git a/test/Driver/modules.mm b/test/Driver/modules.mm
index b2948c4b3d96..63db69956e45 100644
--- a/test/Driver/modules.mm
+++ b/test/Driver/modules.mm
@@ -1,6 +1,8 @@
-// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
+// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
// RUN: %clang -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
+// RUN: %clang -fmodules -fno-cxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s
// CHECK-NO-MODULES-NOT: -fmodules
-// RUN: %clang -fcxx-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
+// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
+// RUN: %clang -fmodules -fno-cxx-modules -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s
// CHECK-HAS-MODULES: -fmodules
diff --git a/test/Driver/msvc_forward.c b/test/Driver/msvc_forward.c
index fe0ae84790e0..15f941ef95de 100644
--- a/test/Driver/msvc_forward.c
+++ b/test/Driver/msvc_forward.c
@@ -1,5 +1,7 @@
-// RUN: %clang -target i686-pc-win32 -lkernel32.lib -luser32.lib -### %s 2>&1 | FileCheck %s
+// RUN: %clang -target i686-pc-win32 -loldnames -lkernel32.lib -luser32.lib -### %s 2>&1 | FileCheck %s
+// CHECK-NOT: "-loldnames.lib"
// CHECK-NOT: "-lkernel32.lib"
// CHECK-NOT: "-luser32.lib"
+// CHECK: "oldnames.lib"
// CHECK: "kernel32.lib"
// CHECK: "user32.lib"
diff --git a/test/Driver/netbsd.c b/test/Driver/netbsd.c
index 0e3ebf3c9a28..eded7f52df7e 100644
--- a/test/Driver/netbsd.c
+++ b/test/Driver/netbsd.c
@@ -13,36 +13,42 @@
// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd7.0.0 \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=AARCH64-7 %s
-// RUN: %clang -no-canonical-prefixes -target arm64--netbsd \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM64 %s
-// RUN: %clang -no-canonical-prefixes -target arm64--netbsd7.0.0 \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM64-7 %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabi \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=ARM %s
+// RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi \
+// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=ARMEB %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=ARM-APCS %s
+// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabihf \
+// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=ARM-HF %s
// RUN: %clang -no-canonical-prefixes -target thumb--netbsd-eabi \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=THUMB %s
+// RUN: %clang -no-canonical-prefixes -target thumbeb--netbsd-eabi \
+// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=THUMBEB %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd7.0.0-eabi \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=ARM-7 %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd6.0.0-eabi \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=ARM-6 %s
-// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabihf \
-// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-HF %s
// RUN: %clang -no-canonical-prefixes -target sparc--netbsd \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC %s
// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd \
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC64 %s
+// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=POWERPC %s
+// RUN: %clang -no-canonical-prefixes -target powerpc64--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=POWERPC64 %s
// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
@@ -59,15 +65,12 @@
// RUN: %clang -no-canonical-prefixes -target aarch64--netbsd7.0.0 -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-AARCH64-7 %s
-// RUN: %clang -no-canonical-prefixes -target arm64--netbsd -static \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=S-ARM64 %s
-// RUN: %clang -no-canonical-prefixes -target arm64--netbsd7.0.0 -static \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=S-ARM64-7 %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd-eabi -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-ARM %s
+// RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-ARMEB %s
// RUN: %clang -no-canonical-prefixes -target arm--netbsd7.0.0-eabi -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-ARM-7 %s
@@ -80,6 +83,12 @@
// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-SPARC64 %s
+// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-POWERPC %s
+// RUN: %clang -no-canonical-prefixes -target powerpc64--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-POWERPC64 %s
// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -103,30 +112,14 @@
// AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// AARCH64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0"
// AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// AARCH64-7: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-// ARM64: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd"
-// ARM64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
-// ARM64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// ARM64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
-// ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
-// ARM64-7: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd7.0.0"
-// ARM64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
-// ARM64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// ARM64-7: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
-// ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi"
// ARM: as{{.*}}" "-mcpu=arm926ej-s" "-o"
// ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -136,6 +129,15 @@
// ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi"
+// ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
+// ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// ARMEB: "-m" "armelfb_nbsd_eabi"
+// ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
+// ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// ARM-APCS: clang{{.*}}" "-cc1" "-triple" "armv4--netbsd"
// ARM-APCS: as{{.*}}" "-mcpu=strongarm" "-o"
// ARM-APCS: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -145,6 +147,15 @@
// ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// ARM-HF: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabihf"
+// ARM-HF: as{{.*}}" "-mcpu=arm926ej-s" "-o"
+// ARM-HF: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// ARM-HF: "-m" "armelf_nbsd_eabihf"
+// ARM-HF: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}eabihf{{/|\\\\}}crti.o"
+// ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// THUMB: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi"
// THUMB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
// THUMB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -154,6 +165,15 @@
// THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// THUMBEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi"
+// THUMBEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
+// THUMBEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// THUMBEB: "-m" "armelfb_nbsd_eabi"
+// THUMBEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
+// THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi"
// ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// ARM-7: "-m" "armelf_nbsd_eabi"
@@ -170,9 +190,6 @@
// ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-// ARM-HF: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabihf"
-// ARM-HF: ld{{.*}}" "-m" "armelf_nbsd_eabihf"
-
// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd"
// SPARC: as{{.*}}" "-32" "-o"
// SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -190,6 +207,22 @@
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
+// POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// POWERPC: "-m" "elf32ppc_nbsd"
+// POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
+// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd"
+// POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// POWERPC64: "-m" "elf64ppc"
+// POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
// S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
@@ -213,30 +246,14 @@
// S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// S-AARCH64: "-lgcc_eh" "-lc" "-lgcc"
// S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0"
// S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// S-AARCH64-7: "-lgcc_eh" "-lc" "-lgcc"
// S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-// S-ARM64: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd"
-// S-ARM64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
-// S-ARM64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// S-ARM64: "-lgcc_eh" "-lc" "-lgcc"
-// S-ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
-// S-ARM64-7: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd7.0.0"
-// S-ARM64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
-// S-ARM64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
-// S-ARM64-7: "-lgcc_eh" "-lc" "-lgcc"
-// S-ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
// S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi"
// S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-ARM: "-m" "armelf_nbsd_eabi"
@@ -245,6 +262,14 @@
// S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// S-ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi"
+// S-ARMEB: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
+// S-ARMEB: "-m" "armelfb_nbsd_eabi"
+// S-ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
+// S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi"
// S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-ARM-7: "-m" "armelf_nbsd_eabi"
@@ -278,3 +303,19 @@
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// S-SPARC64: "-lgcc_eh" "-lc" "-lgcc"
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
+// S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
+// S-POWERPC: "-m" "elf32ppc_nbsd"
+// S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
+// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd"
+// S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
+// S-POWERPC64: "-m" "elf64ppc"
+// S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
diff --git a/test/Driver/netbsd.cpp b/test/Driver/netbsd.cpp
index 43b9fdeaa587..e386a212de2c 100644
--- a/test/Driver/netbsd.cpp
+++ b/test/Driver/netbsd.cpp
@@ -19,18 +19,18 @@
// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd7.0.0 \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=AARCH64-7 %s
-// RUN: %clangxx -no-canonical-prefixes -target arm64--netbsd \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM64 %s
-// RUN: %clangxx -no-canonical-prefixes -target arm64--netbsd7.0.0 \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM64-7 %s
// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC %s
// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=SPARC64 %s
+// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=POWERPC %s
+// RUN: %clangxx -no-canonical-prefixes -target powerpc64--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=POWERPC64 %s
// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
@@ -53,18 +53,18 @@
// RUN: %clangxx -no-canonical-prefixes -target aarch64--netbsd7.0.0 -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-AARCH64-7 %s
-// RUN: %clangxx -no-canonical-prefixes -target arm64--netbsd -static \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=S-ARM64 %s
-// RUN: %clangxx -no-canonical-prefixes -target arm64--netbsd7.0.0 -static \
-// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=S-ARM64-7 %s
// RUN: %clangxx -no-canonical-prefixes -target sparc--netbsd -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-SPARC %s
// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd -static \
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
// RUN: | FileCheck -check-prefix=S-SPARC64 %s
+// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-POWERPC %s
+// RUN: %clangxx -no-canonical-prefixes -target powerpc64--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-POWERPC64 %s
// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
@@ -101,31 +101,17 @@
// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd"
// AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// AARCH64: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// AARCH64: "-lm" "-lc"
// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0"
// AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// AARCH64-7: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// AARCH64-7: "-lm" "-lc"
// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-// ARM64: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd"
-// ARM64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
-// ARM64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// ARM64: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
-// ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
-// ARM64-7: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd7.0.0"
-// ARM64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
-// ARM64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// ARM64-7: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
-// ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd"
// SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -141,6 +127,20 @@
// SPARC64: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
+// POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
+// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd"
+// POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// POWERPC64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
// S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
@@ -176,31 +176,17 @@
// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd"
// S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// S-AARCH64: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
+// S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-AARCH64: "-lm" "-lc"
// S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0"
// S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// S-AARCH64-7: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
+// S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-AARCH64-7: "-lm" "-lc"
// S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-// S-ARM64: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd"
-// S-ARM64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
-// S-ARM64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// S-ARM64: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
-// S-ARM64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
-// S-ARM64-7: clang{{.*}}" "-cc1" "-triple" "arm64--netbsd7.0.0"
-// S-ARM64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
-// S-ARM64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
-// S-ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
-// S-ARM64-7: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
-// S-ARM64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
-
// S-SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd"
// S-SPARC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -215,3 +201,17 @@
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
// S-SPARC64: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
+// S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
+// S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
+// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64--netbsd"
+// S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
+// S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
+// S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-POWERPC64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
diff --git a/test/Driver/no-canonical-prefixes.c b/test/Driver/no-canonical-prefixes.c
new file mode 100644
index 000000000000..1aef9f40a9a7
--- /dev/null
+++ b/test/Driver/no-canonical-prefixes.c
@@ -0,0 +1,10 @@
+// REQUIRES: shell
+// RUN: mkdir -p %t
+// RUN: cd %t
+// RUN: ln -sf %clang test-clang
+// RUN: ./test-clang -v -S %s 2>&1 | FileCheck %s
+// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NCP %s
+
+
+// CHECK: /clang{{.*}}" -cc1
+// NCP: test-clang" -cc1
diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c
index d263f485bf2f..74fef5092a96 100644
--- a/test/Driver/openbsd.c
+++ b/test/Driver/openbsd.c
@@ -8,6 +8,14 @@
// CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o"
+// Check CPU type for MIPS64
+// RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
+// RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s
+// CHECK-MIPS64-CPU: "-target-cpu" "mips3"
+// CHECK-MIPS64EL-CPU: "-target-cpu" "mips3"
+
// Check that the new linker flags are passed to OpenBSD
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LD-R %s
@@ -59,12 +67,3 @@
// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
-
-// Check that the integrated assembler is enabled for PowerPC and SPARC
-// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=CHECK-IAS %s
-// RUN: %clang -target sparc-unknown-openbsd -### -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=CHECK-IAS %s
-// RUN: %clang -target sparc64-unknown-openbsd -### -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=CHECK-IAS %s
-// CHECK-IAS-NOT: "-no-integrated-as"
diff --git a/test/Driver/parse-progname.c b/test/Driver/parse-progname.c
new file mode 100644
index 000000000000..33c637822348
--- /dev/null
+++ b/test/Driver/parse-progname.c
@@ -0,0 +1,58 @@
+// REQUIRES: shell, arm-registered-target
+
+
+
+// RUN: ln -fs %clang %T/clang++
+// RUN: ln -fs %clang %T/clang++3.5.0
+// RUN: ln -fs %clang %T/clang++-3.5
+// RUN: ln -fs %clang %T/clang++-tot
+// RUN: ln -fs %clang %T/clang-c++
+// RUN: ln -fs %clang %T/clang-g++
+// RUN: ln -fs %clang %T/c++
+// RUN: ln -fs %clang %T/foo-clang++
+// RUN: ln -fs %clang %T/foo-clang++-3.5
+// RUN: ln -fs %clang %T/foo-clang++3.5
+// RUN: %T/clang++ -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/clang++3.5.0 -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/clang++-3.5 -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/clang++-tot -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/clang-c++ -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/clang-g++ -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/c++ -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/foo-clang++ -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/foo-clang++-3.5 -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// RUN: %T/foo-clang++3.5 -### %s 2>&1 | FileCheck -check-prefix=CXXMODE %s
+// CXXMODE: "-x" "c++"
+
+
+// RUN: ln -fs %clang %T/clang-cl
+// RUN: ln -fs %clang %T/cl
+// RUN: ln -fs %clang %T/cl.exe
+// RUN: ln -fs %clang %T/clang-cl3.5
+// RUN: ln -fs %clang %T/clang-cl-3.5
+// Note: use -- in front of the filename so it's not mistaken for an option on
+// filesystems that use slashes for dir separators.
+// RUN: %T/clang-cl -### -- %s 2>&1 | FileCheck -check-prefix=CLMODE %s
+// RUN: %T/cl -### -- %s 2>&1 | FileCheck -check-prefix=CLMODE %s
+// RUN: %T/cl.exe -### -- %s 2>&1 | FileCheck -check-prefix=CLMODE %s
+// RUN: %T/clang-cl3.5 -### -- %s 2>&1 | FileCheck -check-prefix=CLMODE %s
+// RUN: %T/clang-cl-3.5 -### -- %s 2>&1 | FileCheck -check-prefix=CLMODE %s
+// CLMODE: "-fdiagnostics-format" "msvc"
+
+
+// RUN: ln -fs %clang %T/clang-cpp
+// RUN: ln -fs %clang %T/cpp
+// RUN: %T/clang-cpp -### %s 2>&1 | FileCheck -check-prefix=CPPMODE %s
+// RUN: %T/cpp -### %s 2>&1 | FileCheck -check-prefix=CPPMODE %s
+// CPPMODE: "-E"
+
+
+// RUN: ln -fs %clang %T/cl-clang
+// RUN: %T/cl-clang -### %s 2>&1 | FileCheck -check-prefix=CMODE %s
+// CMODE: "-x" "c"
+// CMODE-NOT: "-fdiagnostics-format" "msvc"
+
+
+// RUN: ln -fs %clang %T/arm-linux-gnueabi-clang
+// RUN: %T/arm-linux-gnueabi-clang -### %s 2>&1 | FileCheck -check-prefix=TARGET %s
+// TARGET: Target: arm--linux-gnueabi
diff --git a/test/Driver/phases.c b/test/Driver/phases.c
index 4c480d59c14a..0283800825ac 100644
--- a/test/Driver/phases.c
+++ b/test/Driver/phases.c
@@ -2,47 +2,53 @@
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s
// BASIC: 0: input, "{{.*}}phases.c", c
// BASIC: 1: preprocessor, {0}, cpp-output
-// BASIC: 2: compiler, {1}, assembler
-// BASIC: 3: assembler, {2}, object
-// BASIC: 4: input, "{{.*}}phases.c", objective-c
-// BASIC: 5: preprocessor, {4}, objective-c-cpp-output
-// BASIC: 6: compiler, {5}, assembler
-// BASIC: 7: assembler, {6}, object
-// BASIC: 8: input, "{{.*}}phases.c", c++
-// BASIC: 9: preprocessor, {8}, c++-cpp-output
-// BASIC: 10: compiler, {9}, assembler
-// BASIC: 11: assembler, {10}, object
-// BASIC: 12: input, "{{.*}}phases.c", assembler
-// BASIC: 13: assembler, {12}, object
-// BASIC: 14: input, "{{.*}}phases.c", assembler-with-cpp
-// BASIC: 15: preprocessor, {14}, assembler
+// BASIC: 2: compiler, {1}, ir
+// BASIC: 3: backend, {2}, assembler
+// BASIC: 4: assembler, {3}, object
+// BASIC: 5: input, "{{.*}}phases.c", objective-c
+// BASIC: 6: preprocessor, {5}, objective-c-cpp-output
+// BASIC: 7: compiler, {6}, ir
+// BASIC: 8: backend, {7}, assembler
+// BASIC: 9: assembler, {8}, object
+// BASIC: 10: input, "{{.*}}phases.c", c++
+// BASIC: 11: preprocessor, {10}, c++-cpp-output
+// BASIC: 12: compiler, {11}, ir
+// BASIC: 13: backend, {12}, assembler
+// BASIC: 14: assembler, {13}, object
+// BASIC: 15: input, "{{.*}}phases.c", assembler
// BASIC: 16: assembler, {15}, object
-// BASIC: 17: input, "{{.*}}phases.c", c
-// BASIC: 18: preprocessor, {17}, cpp-output
-// BASIC: 19: compiler, {18}, assembler
-// BASIC: 20: assembler, {19}, object
-// BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image
+// BASIC: 17: input, "{{.*}}phases.c", assembler-with-cpp
+// BASIC: 18: preprocessor, {17}, assembler
+// BASIC: 19: assembler, {18}, object
+// BASIC: 20: input, "{{.*}}phases.c", c
+// BASIC: 21: preprocessor, {20}, cpp-output
+// BASIC: 22: compiler, {21}, ir
+// BASIC: 23: backend, {22}, assembler
+// BASIC: 24: assembler, {23}, object
+// BASIC: 25: linker, {4, 9, 14, 16, 19, 24}, image
// Universal linked image.
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
// ULI: 0: input, "{{.*}}phases.c", c
// ULI: 1: preprocessor, {0}, cpp-output
-// ULI: 2: compiler, {1}, assembler
-// ULI: 3: assembler, {2}, object
-// ULI: 4: linker, {3}, image
-// ULI: 5: bind-arch, "ppc", {4}, image
-// ULI: 6: bind-arch, "i386", {4}, image
-// ULI: 7: lipo, {5, 6}, image
+// ULI: 2: compiler, {1}, ir
+// ULI: 3: backend, {2}, assembler
+// ULI: 4: assembler, {3}, object
+// ULI: 5: linker, {4}, image
+// ULI: 6: bind-arch, "ppc", {5}, image
+// ULI: 7: bind-arch, "i386", {5}, image
+// ULI: 8: lipo, {6, 7}, image
// Universal object file.
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
// UOF: 0: input, "{{.*}}phases.c", c
// UOF: 1: preprocessor, {0}, cpp-output
-// UOF: 2: compiler, {1}, assembler
-// UOF: 3: assembler, {2}, object
-// UOF: 4: bind-arch, "ppc", {3}, object
-// UOF: 5: bind-arch, "i386", {3}, object
-// UOF: 6: lipo, {4, 5}, object
+// UOF: 2: compiler, {1}, ir
+// UOF: 3: backend, {2}, assembler
+// UOF: 4: assembler, {3}, object
+// UOF: 5: bind-arch, "ppc", {4}, object
+// UOF: 6: bind-arch, "i386", {4}, object
+// UOF: 7: lipo, {5, 6}, object
// Arch defaulting
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
diff --git a/test/Driver/pic.c b/test/Driver/pic.c
index 3629cc473574..a3d989c8b4f4 100644
--- a/test/Driver/pic.c
+++ b/test/Driver/pic.c
@@ -118,12 +118,15 @@
// Make sure -pie is passed to along to ld and that the right *crt* files
// are linked in.
// RUN: %clang %s -target i386-unknown-freebsd -fPIE -pie -### \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
// RUN: %clang %s -target i386-linux-gnu -fPIE -pie -### \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
// RUN: %clang %s -target i386-linux-gnu -fPIC -pie -### \
+// RUN: --gcc-toolchain="" \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
//
@@ -195,6 +198,8 @@
// RUN: | FileCheck %s --check-prefix=CHECK-PIC2
// RUN: %clang -c %s -target armv7-apple-ios -mkernel -miphoneos-version-min=6.0.0 -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN: %clang -c %s -target arm64-apple-ios -mkernel -miphoneos-version-min=7.0.0 -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-PIC2
// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext -miphoneos-version-min=5.0.0 -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext -miphoneos-version-min=6.0.0 -static -### 2>&1 \
diff --git a/test/Driver/ppc-abi.c b/test/Driver/ppc-abi.c
new file mode 100644
index 000000000000..6fee63a303cf
--- /dev/null
+++ b/test/Driver/ppc-abi.c
@@ -0,0 +1,19 @@
+// Check passing PowerPC ABI options to the backend.
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ELFv1 %s
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1 %s
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s
+
+// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ELFv2 %s
+// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1 %s
+// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s
+
+// CHECK-ELFv1: "-target-abi" "elfv1"
+// CHECK-ELFv2: "-target-abi" "elfv2"
+
diff --git a/test/Driver/ppc-features.cpp b/test/Driver/ppc-features.cpp
index fa9a7ecd4d2f..f7cc879f39ac 100644
--- a/test/Driver/ppc-features.cpp
+++ b/test/Driver/ppc-features.cpp
@@ -89,12 +89,24 @@
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
// CHECK-FPRND: "-target-feature" "+fprnd"
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCMPB %s
+// CHECK-NOCMPB: "-target-feature" "-cmpb"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-cmpb -mcmpb -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CMPB %s
+// CHECK-CMPB: "-target-feature" "+cmpb"
+
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
// CHECK-NOVSX: "-target-feature" "-vsx"
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
// CHECK-VSX: "-target-feature" "+vsx"
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s
+// CHECK-NOP8VECTOR: "-target-feature" "-power8-vector"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s
+// CHECK-P8VECTOR: "-target-feature" "+power8-vector"
+
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
// CHECK-NOCRBITS: "-target-feature" "-crbits"
@@ -102,11 +114,11 @@
// CHECK-CRBITS: "-target-feature" "+crbits"
// Assembler features
-// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
// CHECK_BE_AS_ARGS: "-mppc64"
// CHECK_BE_AS_ARGS: "-many"
-// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s
+// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_LE_AS_ARGS %s
// CHECK_LE_AS_ARGS: "-mppc64"
// CHECK_LE_AS_ARGS: "-many"
// CHECK_LE_AS_ARGS: "-mlittle-endian"
diff --git a/test/Driver/prefixed-tools.c b/test/Driver/prefixed-tools.c
index d7c342a8a94b..cdd59dae133d 100644
--- a/test/Driver/prefixed-tools.c
+++ b/test/Driver/prefixed-tools.c
@@ -6,7 +6,7 @@
// RUN: -m32 -target x86_64--linux %s 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-M32 %s
-// CHECK-M64: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-as"
-// CHECK-M64: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-ld"
-// CHECK-M32: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-as"
-// CHECK-M32: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-ld"
+// CHECK-M64: "{{.*}}{{/|\\\\}}prefixed_tools_tree{{/|\\\\}}x86_64--linux-as"
+// CHECK-M64: "{{.*}}{{/|\\\\}}prefixed_tools_tree{{/|\\\\}}x86_64--linux-ld"
+// CHECK-M32: "{{.*}}{{/|\\\\}}prefixed_tools_tree{{/|\\\\}}x86_64--linux-as"
+// CHECK-M32: "{{.*}}{{/|\\\\}}prefixed_tools_tree{{/|\\\\}}x86_64--linux-ld"
diff --git a/test/Driver/r600-mcpu.cl b/test/Driver/r600-mcpu.cl
index 47c018512bed..94a77346e877 100644
--- a/test/Driver/r600-mcpu.cl
+++ b/test/Driver/r600-mcpu.cl
@@ -26,15 +26,15 @@
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=caicos %s -o - 2>&1 | FileCheck --check-prefix=CAICOS-CHECK %s
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=cayman %s -o - 2>&1 | FileCheck --check-prefix=CAYMAN-CHECK %s
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=aruba %s -o - 2>&1 | FileCheck --check-prefix=CAYMAN-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=tahiti %s -o - 2>&1 | FileCheck --check-prefix=TAHITI-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=pitcairn %s -o - 2>&1 | FileCheck --check-prefix=PITCAIRN-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=verde %s -o - 2>&1 | FileCheck --check-prefix=VERDE-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=oland %s -o - 2>&1 | FileCheck --check-prefix=OLAND-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=bonaire %s -o - 2>&1 | FileCheck --check-prefix=BONAIRE-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=kabini %s -o - 2>&1 | FileCheck --check-prefix=KABINI-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=kaveri %s -o - 2>&1 | FileCheck --check-prefix=KAVERI-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=hawaii %s -o - 2>&1 | FileCheck --check-prefix=HAWAII-CHECK %s
-// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=mullins %s -o - 2>&1 | FileCheck --check-prefix=MULLINS-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=tahiti %s -o - 2>&1 | FileCheck --check-prefix=TAHITI-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=pitcairn %s -o - 2>&1 | FileCheck --check-prefix=PITCAIRN-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=verde %s -o - 2>&1 | FileCheck --check-prefix=VERDE-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=oland %s -o - 2>&1 | FileCheck --check-prefix=OLAND-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=bonaire %s -o - 2>&1 | FileCheck --check-prefix=BONAIRE-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kabini %s -o - 2>&1 | FileCheck --check-prefix=KABINI-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kaveri %s -o - 2>&1 | FileCheck --check-prefix=KAVERI-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=hawaii %s -o - 2>&1 | FileCheck --check-prefix=HAWAII-CHECK %s
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=mullins %s -o - 2>&1 | FileCheck --check-prefix=MULLINS-CHECK %s
// R600-CHECK: "-target-cpu" "r600"
// RS880-CHECK: "-target-cpu" "rs880"
diff --git a/test/Driver/response-file.c b/test/Driver/response-file.c
new file mode 100644
index 000000000000..208a941e8723
--- /dev/null
+++ b/test/Driver/response-file.c
@@ -0,0 +1,23 @@
+// REQUIRES: long_tests
+
+// Check that clang is able to process short response files
+// Since this is a short response file, clang must not use a response file
+// to pass its parameters to other tools. This is only necessary for a large
+// number of parameters.
+// RUN: echo "-DTEST" >> %t.0.txt
+// RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT
+// SHORT-NOT: Arguments passed via response file
+// SHORT: extern int it_works;
+
+// Check that clang is able to process long response files, routing a long
+// sequence of arguments to other tools by using response files as well.
+// We generate a 2MB response file to be big enough to surpass any system
+// limit.
+// RUN: %clang -E %S/Inputs/gen-response.c | grep DTEST > %t.1.txt
+// RUN: %clang -E @%t.1.txt %s -v 2>&1 | FileCheck %s -check-prefix=LONG
+// LONG: Arguments passed via response file
+// LONG: extern int it_works;
+
+#ifdef TEST
+extern int it_works;
+#endif
diff --git a/test/Driver/rewrite-legacy-objc.m b/test/Driver/rewrite-legacy-objc.m
index 0c6404e323de..b0b78d00817a 100644
--- a/test/Driver/rewrite-legacy-objc.m
+++ b/test/Driver/rewrite-legacy-objc.m
@@ -3,11 +3,11 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
// TEST0: rewrite-legacy-objc.m"
// RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.9.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST1 %s
// RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.6.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST2 %s
-// TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option"
-// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option"
+// TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
+// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
diff --git a/test/Driver/rewrite-map-in-diagnostics.c b/test/Driver/rewrite-map-in-diagnostics.c
new file mode 100644
index 000000000000..984e0d6e8ce6
--- /dev/null
+++ b/test/Driver/rewrite-map-in-diagnostics.c
@@ -0,0 +1,12 @@
+// RUN: rm -rf "%t"
+// RUN: mkdir -p "%t"
+// RUN: not env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTION=1 \
+// RUN: %clang -fsyntax-only -frewrite-map-file %p/Inputs/rewrite.map %s 2>&1 \
+// RUN: | FileCheck %s
+
+#pragma clang __debug parser_crash
+
+// CHECK: note: diagnostic msg: {{.*}}rewrite.map
+
+// FIXME: This doesn't fail on "env clang". Investigating.
+// REQUIRES: shell
diff --git a/test/Driver/rewrite-objc.m b/test/Driver/rewrite-objc.m
index 95db58294d2a..ba5f835ed8f5 100644
--- a/test/Driver/rewrite-objc.m
+++ b/test/Driver/rewrite-objc.m
@@ -3,4 +3,4 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c
index 786262c68b84..dc8e93e50f26 100644
--- a/test/Driver/sanitizer-ld.c
+++ b/test/Driver/sanitizer-ld.c
@@ -9,11 +9,12 @@
// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-ASAN-LINUX-NOT: "-lc"
// CHECK-ASAN-LINUX: libclang_rt.asan-i386.a"
+// CHECK-ASAN-LINUX-NOT: "-export-dynamic"
+// CHECK-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan-i386.a.syms"
+// CHECK-ASAN-LINUX-NOT: "-export-dynamic"
// CHECK-ASAN-LINUX: "-lpthread"
// CHECK-ASAN-LINUX: "-lrt"
// CHECK-ASAN-LINUX: "-ldl"
-// CHECK-ASAN-LINUX-NOT: "-export-dynamic"
-// CHECK-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan-i386.a.syms"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fsanitize=address -shared-libasan \
@@ -24,8 +25,8 @@
// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
// CHECK-SHARED-ASAN-LINUX-NOT: libclang_rt.asan-i386.a"
-// CHECK-SHARED-ASAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.asan-preinit-i386.a" "-no-whole-archive"
// CHECK-SHARED-ASAN-LINUX: libclang_rt.asan-i386.so"
+// CHECK-SHARED-ASAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.asan-preinit-i386.a" "-no-whole-archive"
// CHECK-SHARED-ASAN-LINUX-NOT: "-lpthread"
// CHECK-SHARED-ASAN-LINUX-NOT: "-lrt"
// CHECK-SHARED-ASAN-LINUX-NOT: "-ldl"
@@ -60,10 +61,10 @@
// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx
// CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan-i386.a"
// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx
+// CHECK-ASAN-FREEBSD-NOT: "--dynamic-list"
+// CHECK-ASAN-FREEBSD: "-export-dynamic"
// CHECK-ASAN-FREEBSD: "-lpthread"
// CHECK-ASAN-FREEBSD: "-lrt"
-// CHECK-ASAN-FREEBSD: "-export-dynamic"
-// CHECK-ASAN-FREEBSD-NOT: "--dynamic-list"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-freebsd -fsanitize=address \
@@ -82,14 +83,14 @@
//
// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-ASAN-LINUX-CXX-NOT: "-lc"
-// CHECK-ASAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.asan_cxx-i386.a" "-no-whole-archive"
// CHECK-ASAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.asan-i386.a" "-no-whole-archive"
+// CHECK-ASAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.asan_cxx-i386.a" "-no-whole-archive"
+// CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
+// CHECK-ASAN-LINUX-CXX: "-export-dynamic"
+// CHECK-ASAN-LINUX-CXX: stdc++
// CHECK-ASAN-LINUX-CXX: "-lpthread"
// CHECK-ASAN-LINUX-CXX: "-lrt"
// CHECK-ASAN-LINUX-CXX: "-ldl"
-// CHECK-ASAN-LINUX-CXX: "-export-dynamic"
-// CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
-// CHECK-ASAN-LINUX-CXX: stdc++
// RUN: %clang -no-canonical-prefixes %s -### -o /dev/null -fsanitize=address \
// RUN: -target i386-unknown-linux --sysroot=%S/Inputs/basic_linux_tree \
@@ -126,10 +127,10 @@
//
// CHECK-ASAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-ASAN-ANDROID-NOT: "-lc"
-// CHECK-ASAN-ANDROID: libclang_rt.asan-arm-android.so"
-// CHECK-ASAN-ANDROID-NOT: "-lpthread"
// CHECK-ASAN-ANDROID: "-pie"
// CHECK-ASAN-ANDROID-NOT: "-lpthread"
+// CHECK-ASAN-ANDROID: libclang_rt.asan-arm-android.so"
+// CHECK-ASAN-ANDROID-NOT: "-lpthread"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target arm-linux-androideabi -fsanitize=address \
@@ -159,12 +160,13 @@
// CHECK-TSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-TSAN-LINUX-CXX-NOT: stdc++
// CHECK-TSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.tsan-x86_64.a" "-no-whole-archive"
-// CHECK-TSAN-LINUX-CXX: "-lpthread"
-// CHECK-TSAN-LINUX-CXX: "-lrt"
-// CHECK-TSAN-LINUX-CXX: "-ldl"
// CHECK-TSAN-LINUX-CXX-NOT: "-export-dynamic"
// CHECK-TSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan-x86_64.a.syms"
+// CHECK-TSAN-LINUX-CXX-NOT: "-export-dynamic"
// CHECK-TSAN-LINUX-CXX: stdc++
+// CHECK-TSAN-LINUX-CXX: "-lpthread"
+// CHECK-TSAN-LINUX-CXX: "-lrt"
+// CHECK-TSAN-LINUX-CXX: "-ldl"
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -lstdc++ -fsanitize=memory \
@@ -175,12 +177,13 @@
// CHECK-MSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-MSAN-LINUX-CXX-NOT: stdc++
// CHECK-MSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.msan-x86_64.a" "-no-whole-archive"
-// CHECK-MSAN-LINUX-CXX: "-lpthread"
-// CHECK-MSAN-LINUX-CXX: "-lrt"
-// CHECK-MSAN-LINUX-CXX: "-ldl"
// CHECK-MSAN-LINUX-CXX-NOT: "-export-dynamic"
// CHECK-MSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan-x86_64.a.syms"
+// CHECK-MSAN-LINUX-CXX-NOT: "-export-dynamic"
// CHECK-MSAN-LINUX-CXX: stdc++
+// CHECK-MSAN-LINUX-CXX: "-lpthread"
+// CHECK-MSAN-LINUX-CXX: "-lrt"
+// CHECK-MSAN-LINUX-CXX: "-ldl"
// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -188,12 +191,23 @@
// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX %s
// CHECK-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan
+// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
// CHECK-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.san-i386.a" "-no-whole-archive"
// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan
+// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
// CHECK-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.ubsan-i386.a" "-no-whole-archive"
+// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
-// CHECK-UBSAN-LINUX: "-lpthread"
// CHECK-UBSAN-LINUX-NOT: "-lstdc++"
+// CHECK-UBSAN-LINUX: "-lpthread"
+
+// RUN: %clang -fsanitize=undefined -fsanitize-link-c++-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-LINK-CXX %s
+// CHECK-UBSAN-LINUX-LINK-CXX-NOT: "-lstdc++"
+// CHECK-UBSAN-LINUX-LINK-CXX: "-whole-archive" "{{.*}}libclang_rt.ubsan_cxx-i386.a" "-no-whole-archive"
+// CHECK-UBSAN-LINUX-LINK-CXX-NOT: "-lstdc++"
// RUN: %clangxx -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -205,11 +219,16 @@
// CHECK-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.san-i386.a" "-no-whole-archive"
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.ubsan-i386.a" "-no-whole-archive"
+// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.ubsan-i386.a.syms"
+// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.ubsan_cxx-i386.a" "-no-whole-archive"
-// CHECK-UBSAN-LINUX-CXX: "-lpthread"
+// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.ubsan_cxx-i386.a.syms"
+// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
// CHECK-UBSAN-LINUX-CXX: "-lstdc++"
+// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
+// CHECK-UBSAN-LINUX-CXX: "-lpthread"
// RUN: %clang -fsanitize=address,undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -221,8 +240,8 @@
// CHECK-ASAN-UBSAN-LINUX-NOT: libclang_rt.san
// CHECK-ASAN-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.ubsan-i386.a" "-no-whole-archive"
// CHECK-ASAN-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
-// CHECK-ASAN-UBSAN-LINUX: "-lpthread"
// CHECK-ASAN-UBSAN-LINUX-NOT: "-lstdc++"
+// CHECK-ASAN-UBSAN-LINUX: "-lpthread"
// RUN: %clangxx -fsanitize=address,undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -234,8 +253,8 @@
// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.san
// CHECK-ASAN-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.ubsan-i386.a" "-no-whole-archive"
// CHECK-ASAN-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.ubsan_cxx-i386.a" "-no-whole-archive"
-// CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread"
// CHECK-ASAN-UBSAN-LINUX-CXX: "-lstdc++"
+// CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread"
// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -271,8 +290,8 @@
// CHECK-LSAN-UBSAN-LINUX-NOT: libclang_rt.san
// CHECK-LSAN-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.ubsan-x86_64.a" "-no-whole-archive"
// CHECK-LSAN-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
-// CHECK-LSAN-UBSAN-LINUX: "-lpthread"
// CHECK-LSAN-UBSAN-LINUX-NOT: "-lstdc++"
+// CHECK-LSAN-UBSAN-LINUX: "-lpthread"
// RUN: %clang -fsanitize=leak,address %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
diff --git a/test/Driver/save-temps.c b/test/Driver/save-temps.c
index a4ca3b26649e..a157aeaaff4a 100644
--- a/test/Driver/save-temps.c
+++ b/test/Driver/save-temps.c
@@ -1,17 +1,28 @@
// RUN: %clang -target x86_64-apple-darwin -save-temps -arch x86_64 %s -### 2>&1 \
// RUN: | FileCheck %s
// CHECK: "-o" "save-temps.i"
+// CHECK: "-disable-llvm-optzns"
+// CHECK: "-o" "save-temps.bc"
// CHECK: "-o" "save-temps.s"
// CHECK: "-o" "save-temps.o"
// CHECK: "-o" "a.out"
+// Check for a single clang cc1 invocation when NOT using -save-temps.
+// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -S %s -### 2>&1 \
+// RUN: | FileCheck %s -check-prefix=NO-TEMPS
+// NO-TEMPS: "-cc1"
+// NO-TEMPS: "-S"
+// NO-TEMPS: "-x" "c"
+
// RUN: %clang -target x86_64-apple-darwin -save-temps -arch i386 -arch x86_64 %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=MULT-ARCH
// MULT-ARCH: "-o" "save-temps-i386.i"
+// MULT-ARCH: "-o" "save-temps-i386.bc"
// MULT-ARCH: "-o" "save-temps-i386.s"
// MULT-ARCH: "-o" "save-temps-i386.o"
// MULT-ARCH: "-o" "a.out-i386"
// MULT-ARCH: "-o" "save-temps-x86_64.i"
+// MULT-ARCH: "-o" "save-temps-x86_64.bc"
// MULT-ARCH: "-o" "save-temps-x86_64.s"
// MULT-ARCH: "-o" "save-temps-x86_64.o"
// MULT-ARCH: "-o" "a.out-x86_64"
diff --git a/test/Driver/sparc-float.c b/test/Driver/sparc-float.c
index 15050d2c4ea4..e84c487c73c9 100644
--- a/test/Driver/sparc-float.c
+++ b/test/Driver/sparc-float.c
@@ -5,6 +5,7 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target sparc-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-DEF %s
+// CHECK-DEF: "-target-feature" "+soft-float"
// CHECK-DEF: "-msoft-float"
//
// -mhard-float
@@ -17,12 +18,14 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target sparc-linux-gnu -msoft-float \
// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
+// CHECK-SOFT: "-target-feature" "+soft-float"
// CHECK-SOFT: "-msoft-float"
//
// Default sparc64
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target sparc64-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-DEF-SPARC64 %s
+// CHECK-DEF-SPARC64: "-target-feature" "+soft-float"
// CHECK-DEF-SPARC64: "-msoft-float"
//
// -mhard-float
@@ -35,4 +38,5 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target sparc64-linux-gnu -msoft-float \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-SPARC64 %s
+// CHECK-SOFT-SPARC64: "-target-feature" "+soft-float"
// CHECK-SOFT-SPARC64: "-msoft-float"
diff --git a/test/Driver/split-debug.c b/test/Driver/split-debug.c
index 792abbd55259..6296c4672e5c 100644
--- a/test/Driver/split-debug.c
+++ b/test/Driver/split-debug.c
@@ -1,6 +1,5 @@
// Check that we split debug output properly
//
-// REQUIRES: asserts
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
//
diff --git a/test/Driver/split-debug.s b/test/Driver/split-debug.s
index d5f077af1346..64e8f2fa03d2 100644
--- a/test/Driver/split-debug.s
+++ b/test/Driver/split-debug.s
@@ -1,6 +1,5 @@
// Check that we split debug output properly
//
-// REQUIRES: asserts
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
//
diff --git a/test/Driver/std.c b/test/Driver/std.c
index c82e9f15c7da..02dca6698d34 100644
--- a/test/Driver/std.c
+++ b/test/Driver/std.c
@@ -1,8 +1,18 @@
-// RUN: %clang -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=OVERRIDE %s
+// RUN: %clang -w -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=OVERRIDE %s
// OVERRIDE: ??(??)
-// RUN: %clang -ansi %s -E -o - | FileCheck -check-prefix=ANSI %s
+// RUN: %clang -w -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=FOVERRIDE %s
+// FOVERRIDE: ??(??)
+// RUN: %clang -w -ansi %s -E -o - | FileCheck -check-prefix=ANSI %s
// ANSI: []
-// RUN: %clang -std=gnu99 -trigraphs %s -E -o - | FileCheck -check-prefix=EXPLICIT %s
+// RUN: %clang -w -ansi %s -fno-trigraphs -E -o - | FileCheck -check-prefix=ANSI-OVERRIDE %s
+// ANSI-OVERRIDE: ??(??)
+// RUN: %clang -w -std=gnu99 -trigraphs %s -E -o - | FileCheck -check-prefix=EXPLICIT %s
// EXPLICIT: []
+// RUN: %clang -w -std=gnu99 -ftrigraphs %s -E -o - | FileCheck -check-prefix=FEXPLICIT %s
+// FEXPLICIT: []
+// RUN: %clang -w -ftrigraphs -fno-trigraphs %s -E -o - | FileCheck -check-prefix=ONOFF %s
+// ONOFF: ??(??)
+// RUN: %clang -w -fno-trigraphs -trigraphs %s -E -o - | FileCheck -check-prefix=OFFFON %s
+// OFFFON: []
??(??)
diff --git a/test/Driver/symbol-rewriter.c b/test/Driver/symbol-rewriter.c
new file mode 100644
index 000000000000..3cfdb9d09cd9
--- /dev/null
+++ b/test/Driver/symbol-rewriter.c
@@ -0,0 +1,21 @@
+// RUN: %clang -frewrite-map-file %S/Inputs/rewrite.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-SINGLE
+
+// CHECK-SINGLE: "-frewrite-map-file" "{{.*[\\/]}}rewrite.map"
+
+// RUN: %clang -frewrite-map-file %S/Inputs/rewrite-1.map -frewrite-map-file %S/Inputs/rewrite-2.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-MULTIPLE
+
+// CHECK-MULTIPLE: "-frewrite-map-file" "{{.*[\\/]}}rewrite-1.map" "-frewrite-map-file" "{{.*[\\/]}}rewrite-2.map"
+
+// RUN: %clang -frewrite-map-file=%S/Inputs/rewrite.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-SINGLE-EQ
+
+// CHECK-SINGLE-EQ: "-frewrite-map-file" "{{.*[\\/]}}rewrite.map"
+
+// RUN: %clang -frewrite-map-file=%S/Inputs/rewrite-1.map -frewrite-map-file=%S/Inputs/rewrite-2.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-MULTIPLE-EQ
+
+// CHECK-MULTIPLE-EQ: "-frewrite-map-file" "{{.*[\\/]}}rewrite-1.map"
+// CHECK-MULTIPLE-EQ: "-frewrite-map-file" "{{.*[\\/]}}rewrite-2.map"
+
+// RUN: %clang -frewrite-map-file %S/Inputs/rewrite-1.map -frewrite-map-file=%S/Inputs/rewrite-2.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-MIXED
+
+// CHECK-MIXED: "-frewrite-map-file" "{{.*[\\/]}}rewrite-1.map" "-frewrite-map-file" "{{.*[\\/]}}rewrite-2.map"
+
diff --git a/test/Driver/systemz-as.s b/test/Driver/systemz-as.s
new file mode 100644
index 000000000000..34ad9c41eaf3
--- /dev/null
+++ b/test/Driver/systemz-as.s
@@ -0,0 +1,14 @@
+// Make sure SystemZ defaults to using the integrated assembler
+
+// RUN: %clang -target s390x-ibm-linux -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=IAS %s
+
+// RUN: %clang -target s390x-ibm-linux -integrated-as -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=IAS %s
+// IAS: "-cc1as"{{.*}} "-target-cpu" "z10"
+
+// RUN: %clang -target s390x-ibm-linux -no-integrated-as -### -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=NO-IAS %s
+// NO-IAS-NOT: -cc1as
+// NO-IAS: "-march=z10"
+
diff --git a/test/Driver/thread-model.c b/test/Driver/thread-model.c
new file mode 100644
index 000000000000..9702c2231a26
--- /dev/null
+++ b/test/Driver/thread-model.c
@@ -0,0 +1,15 @@
+// RUN: %clang -### -target arm-unknown-linux-gnu -c %s -mthread-model posix -v 2>&1 | FileCheck -check-prefix=CHECK-POSIX %s
+// RUN: %clang -### -target arm-unknown-linux-gnu -c %s -mthread-model single -v 2>&1 | FileCheck -check-prefix=CHECK-SINGLE %s
+// RUN: not %clang -target arm-unknown-linux-gnu -c %s -mthread-model silly -v 2>&1 | FileCheck -check-prefix=CHECK-INVALID %s
+// CHECK-POSIX: "-mthread-model" "posix"
+// CHECK-SINGLE: "-mthread-model" "single"
+// CHECK-INVALID: error: invalid thread model 'silly' in '-mthread-model silly' for this target
+
+// RUN: %clang -### -target arm-unknown-linux-gnu -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-LINUX-POSIX %s
+// RUN: %clang -### -target arm-unknown-linux-gnu -c %s -v -mthread-model single 2>&1 | FileCheck -check-prefix=CHECK-LINUX-SINGLE %s
+// RUN: %clang -### -target arm-unknown-linux-gnu -c %s -v -mthread-model silly 2>&1 | FileCheck -check-prefix=CHECK-LINUX-INVALID %s
+// CHECK-LINUX-POSIX: Thread model: posix
+// CHECK-LINUX-POSIX: "-mthread-model" "posix"
+// CHECK-LINUX-SINGLE: Thread model: single
+// CHECK-LINUX-SINGLE: "-mthread-model" "single"
+// CHECK-LINUX-INVALID-NOT: Thread model:
diff --git a/test/Driver/unknown-gcc-arch.c b/test/Driver/unknown-gcc-arch.c
index 6317e13ec486..2aba50d53202 100644
--- a/test/Driver/unknown-gcc-arch.c
+++ b/test/Driver/unknown-gcc-arch.c
@@ -14,23 +14,23 @@
// RUN: -no-integrated-as 2>&1 | FileCheck -check-prefix=I386-M64 %s
// I386-M64: {{.*as.*--64}}
-
-// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=PPC64 %s
+// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### \
+// RUN: -no-integrated-as 2>&1 | FileCheck -check-prefix=PPC64 %s
// PPC64: {{.*as.*-a64}}
-// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### -m32 2>&1 \
-// RUN: | FileCheck -check-prefix=PPC64-M32 %s
+// RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### -m64 \
+// RUN: -no-integrated-as 2>&1 | FileCheck -check-prefix=PPC-M64 %s
+// PPC-M64: {{.*as.*-a64}}
+
+
+// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### -m32 \
+// RUN: -no-integrated-as 2>&1 | FileCheck -check-prefix=PPC64-M32 %s
// PPC64-M32: {{.*as.*-a32}}
// RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### 2>&1 \
-// RUN: | FileCheck -check-prefix=PPC %s
+// RUN: -no-integrated-as | FileCheck -check-prefix=PPC %s
// PPC: {{.*as.*-a32}}
-// RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### -m64 2>&1 \
-// RUN: | FileCheck -check-prefix=PPC-M64 %s
-// PPC-M64: {{.*as.*-a64}}
-
// RUN: %clang -target sparc64-unknown-unknown -no-integrated-as -c -x assembler %s -### -m32 2>&1 \
// RUN: | FileCheck -check-prefix=SPARCV8 %s
// SPARCV8: {{.*as.*-32}}
diff --git a/test/Driver/warning-options.cpp b/test/Driver/warning-options.cpp
index f1a335d2139d..4d9e1f7466de 100644
--- a/test/Driver/warning-options.cpp
+++ b/test/Driver/warning-options.cpp
@@ -3,11 +3,6 @@
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-copy=128
-// FIXME: Remove this together with -Warc-abi once an Xcode is released that doesn't pass this flag.
-// RUN: %clang -### -Warc-abi -Wno-arc-abi %s 2>&1 | FileCheck -check-prefix=ARCABI %s
-// ARCABI-NOT: unknown warning option '-Warc-abi'
-// ARCABI-NOT: unknown warning option '-Wno-arc-abi'
-
// Check that -isysroot warns on nonexistent paths.
// RUN: %clang -### -c -target i386-apple-darwin10 -isysroot /FOO %s 2>&1 | FileCheck --check-prefix=CHECK-ISYSROOT %s
// CHECK-ISYSROOT: warning: no such sysroot directory: '{{([A-Za-z]:.*)?}}/FOO'
diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c
new file mode 100644
index 000000000000..979f68539c01
--- /dev/null
+++ b/test/Driver/windows-cross.c
@@ -0,0 +1,40 @@
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -o /dev/null %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-BASIC
+
+// CHECK-BASIC: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %s/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -rtlib=compiler-rt -o /dev/null %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-RTLIB
+
+// CHECK-RTLIB: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib" "-L{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "{{.*[\\/]}}clang_rt.builtins-arm.lib"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -rtlib=compiler-rt -stdlib=libc++ -o /dev/null %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-C-LIBCXX
+
+// CHECK-C-LIBCXX: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "{{.*}}.o" "-lmsvcrt" "{{.*[\\/]}}clang_rt.builtins-arm.lib"
+
+// RUN: %clangxx -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -rtlib=compiler-rt -stdlib=libc++ -o /dev/null %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-LIBCXX
+
+// CHECK-LIBCXX: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definition" "-o" "{{[^"]*}}" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbegin.obj" "{{.*}}.o" "-lc++" "-lmsvcrt" "{{.*[\\/]}}clang_rt.builtins-arm.lib"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -shared -rtlib=compiler-rt -stdlib=libc++ -o shared.dll %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-SHARED
+
+// CHECK-SHARED: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definition" "-o" "shared.dll" "--out-implib" "shared.lib" "{{.*}}/Inputs/Windows/ARM/8.1/usr/lib/crtbeginS.obj" "{{.*}}.o" "-lmsvcrt" "{{.*[\\/]}}clang_rt.builtins-arm.lib"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %s/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -shared -rtlib=compiler-rt -stdlib=libc++ -nostartfiles -o shared.dll %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-NOSTARTFILES
+
+// CHECK-NOSTARTFILES: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definition" "-o" "shared.dll" "--out-implib" "shared.lib" "{{.*}}.o" "-lmsvcrt" "{{.*[\\/]}}clang_rt.builtins-arm.lib"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -shared -rtlib=compiler-rt -stdlib=libc++ -nostartfiles -nodefaultlibs -o shared.dll %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-STANDALONE
+
+// CHECK-STANDALONE: armv7-windows-itanium-ld" "--sysroot={{.*}}/Inputs/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definition" "-o" "shared.dll" "--out-implib" "shared.lib" "{{.*}}.o"
+
+// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %/Inputs/Windows/ARM/8.1/usr/bin -shared -o shared.dll -x c++ %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK-LIBSTDCXX
+
+// CHECK-LIBSTDCXX: "-internal-isystem" "{{.*}}/usr/include/c++" "-internal-isystem" "{{.*}}/usr/include/c++/armv7--windows-itanium" "-internal-isystem" "{{.*}}/usr/include/c++/backwards"
+
diff --git a/test/Driver/x86-march.c b/test/Driver/x86-march.c
new file mode 100644
index 000000000000..fd6e30b01593
--- /dev/null
+++ b/test/Driver/x86-march.c
@@ -0,0 +1,105 @@
+// Ensure we support the various CPU architecture names.
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=nocona 2>&1 \
+// RUN: | FileCheck %s -check-prefix=nocona
+// nocona: "-target-cpu" "nocona"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=core2 2>&1 \
+// RUN: | FileCheck %s -check-prefix=core2
+// core2: "-target-cpu" "core2"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=penryn 2>&1 \
+// RUN: | FileCheck %s -check-prefix=penryn
+// penryn: "-target-cpu" "penryn"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=nehalem 2>&1 \
+// RUN: | FileCheck %s -check-prefix=nehalem
+// nehalem: "-target-cpu" "nehalem"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=westmere 2>&1 \
+// RUN: | FileCheck %s -check-prefix=westmere
+// westmere: "-target-cpu" "westmere"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=sandybridge 2>&1 \
+// RUN: | FileCheck %s -check-prefix=sandybridge
+// sandybridge: "-target-cpu" "sandybridge"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=ivybridge 2>&1 \
+// RUN: | FileCheck %s -check-prefix=ivybridge
+// ivybridge: "-target-cpu" "ivybridge"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=haswell 2>&1 \
+// RUN: | FileCheck %s -check-prefix=haswell
+// haswell: "-target-cpu" "haswell"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=broadwell 2>&1 \
+// RUN: | FileCheck %s -check-prefix=broadwell
+// broadwell: "-target-cpu" "broadwell"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=bonnell 2>&1 \
+// RUN: | FileCheck %s -check-prefix=bonnell
+// bonnell: "-target-cpu" "bonnell"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=silvermont 2>&1 \
+// RUN: | FileCheck %s -check-prefix=silvermont
+// silvermont: "-target-cpu" "silvermont"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=k8 2>&1 \
+// RUN: | FileCheck %s -check-prefix=k8
+// k8: "-target-cpu" "k8"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=opteron 2>&1 \
+// RUN: | FileCheck %s -check-prefix=opteron
+// opteron: "-target-cpu" "opteron"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=athlon64 2>&1 \
+// RUN: | FileCheck %s -check-prefix=athlon64
+// athlon64: "-target-cpu" "athlon64"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=athlon-fx 2>&1 \
+// RUN: | FileCheck %s -check-prefix=athlon-fx
+// athlon-fx: "-target-cpu" "athlon-fx"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=k8-sse3 2>&1 \
+// RUN: | FileCheck %s -check-prefix=k8-sse3
+// k8-sse3: "-target-cpu" "k8-sse3"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=opteron-sse3 2>&1 \
+// RUN: | FileCheck %s -check-prefix=opteron-sse3
+// opteron-sse3: "-target-cpu" "opteron-sse3"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=athlon64-sse3 2>&1 \
+// RUN: | FileCheck %s -check-prefix=athlon64-sse3
+// athlon64-sse3: "-target-cpu" "athlon64-sse3"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=amdfam10 2>&1 \
+// RUN: | FileCheck %s -check-prefix=amdfam10
+// amdfam10: "-target-cpu" "amdfam10"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=barcelona 2>&1 \
+// RUN: | FileCheck %s -check-prefix=barcelona
+// barcelona: "-target-cpu" "barcelona"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=bdver1 2>&1 \
+// RUN: | FileCheck %s -check-prefix=bdver1
+// bdver1: "-target-cpu" "bdver1"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=bdver2 2>&1 \
+// RUN: | FileCheck %s -check-prefix=bdver2
+// bdver2: "-target-cpu" "bdver2"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=bdver3 2>&1 \
+// RUN: | FileCheck %s -check-prefix=bdver3
+// bdver3: "-target-cpu" "bdver3"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=bdver4 2>&1 \
+// RUN: | FileCheck %s -check-prefix=bdver4
+// bdver4: "-target-cpu" "bdver4"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=btver1 2>&1 \
+// RUN: | FileCheck %s -check-prefix=btver1
+// btver1: "-target-cpu" "btver1"
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=btver2 2>&1 \
+// RUN: | FileCheck %s -check-prefix=btver2
+// btver2: "-target-cpu" "btver2"