Changeset View
Changeset View
Standalone View
Standalone View
clang/test/Driver/mingw-sysroot.cpp
// REQUIRES: shell | // REQUIRES: shell | ||||
// UNSUPPORTED: system-windows | // UNSUPPORTED: system-windows | ||||
// RUN: rm -rf %T/testroot-gcc | // RUN: rm -rf %T/testroot-gcc | ||||
// RUN: mkdir -p %T/testroot-gcc/bin | // RUN: mkdir -p %T/testroot-gcc/bin | ||||
// RUN: ln -s %clang %T/testroot-gcc/bin/x86_64-w64-mingw32-gcc | // RUN: ln -s %clang_bin %T/testroot-gcc/bin/x86_64-w64-mingw32-gcc | ||||
// RUN: ln -s %clang %T/testroot-gcc/bin/x86_64-w64-mingw32-clang | // RUN: ln -s %clang_bin %T/testroot-gcc/bin/x86_64-w64-mingw32-clang | ||||
// RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-gcc/x86_64-w64-mingw32 | // RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-gcc/x86_64-w64-mingw32 | ||||
// RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/lib %T/testroot-gcc/lib | // RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/lib %T/testroot-gcc/lib | ||||
// RUN: rm -rf %T/testroot-clang | // RUN: rm -rf %T/testroot-clang | ||||
// RUN: mkdir -p %T/testroot-clang/bin | // RUN: mkdir -p %T/testroot-clang/bin | ||||
// RUN: ln -s %clang %T/testroot-clang/bin/x86_64-w64-mingw32-clang | // RUN: ln -s %clang_bin %T/testroot-clang/bin/x86_64-w64-mingw32-clang | ||||
// RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-clang/x86_64-w64-mingw32 | // RUN: ln -s %S/Inputs/mingw_ubuntu_posix_tree/usr/x86_64-w64-mingw32 %T/testroot-clang/x86_64-w64-mingw32 | ||||
// If we find a gcc in the path with the right triplet prefix, pick that as | // If we find a gcc in the path with the right triplet prefix, pick that as | ||||
// sysroot: | // sysroot: | ||||
// RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang -target x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_GCC %s | // RUN: env "PATH=%T/testroot-gcc/bin:%PATH%" %clang_bin -target x86_64-w64-mingw32 -rtlib=platform -stdlib=libstdc++ --sysroot="" -c -### %s 2>&1 | FileCheck -check-prefix=CHECK_TESTROOT_GCC %s | ||||
// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++" | // CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++" | ||||
// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" | // CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" | ||||
// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" | // CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" | ||||
// CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}include" | // CHECK_TESTROOT_GCC: "{{.*}}/testroot-gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}include" | ||||
// If there's a matching sysroot next to the clang binary itself, prefer that | // If there's a matching sysroot next to the clang binary itself, prefer that | ||||
// over a gcc in the path: | // over a gcc in the path: | ||||
Show All 10 Lines |