// Test that gcc-toolchain option is working correctly
//
+/// Without --rtlib=libgcc the driver may pick clang_rt.crtbegin.o if
+/// -DCLANG_DEFAULT_RTLIB=compiler-rt.
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t --target=x86_64-linux-gnu \
-// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ 2>&1 | \
+// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
// RUN: FileCheck %s
//
// Additionally check that the legacy spelling of the flag works.
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t --target=x86_64-linux-gnu \
-// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ 2>&1 | \
+// RUN: -gcc-toolchain %S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
// RUN: FileCheck %s
//
// Test for header search toolchain detection.