2019-05-22 20:07:52 +08:00
|
|
|
// UNSUPPORTED: system-windows
|
|
|
|
|
[clang][Darwin] Refactor header search path logic into the driver
Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.
This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.
Reviewers: jfb, arphaman
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61963
llvm-svn: 361278
2019-05-22 01:48:04 +08:00
|
|
|
// General tests that the system header search paths detected by the driver
|
|
|
|
// and passed to CC1 are correct on Darwin platforms.
|
|
|
|
|
2019-05-23 04:39:51 +08:00
|
|
|
// Check system headers (everything below <sysroot> and <resource-dir>). Ensure
|
|
|
|
// that both sysroot and isysroot are checked, and that isysroot has precedence.
|
[clang][Darwin] Refactor header search path logic into the driver
Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.
This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.
Reviewers: jfb, arphaman
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61963
llvm-svn: 361278
2019-05-22 01:48:04 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-SYSTEM %s
|
2019-05-23 04:39:51 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --sysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-SYSTEM %s
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: --sysroot / \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-SYSTEM %s
|
|
|
|
//
|
[clang][Darwin] Refactor header search path logic into the driver
Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.
This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.
Reviewers: jfb, arphaman
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61963
llvm-svn: 361278
2019-05-22 01:48:04 +08:00
|
|
|
// CHECK-SYSTEM: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-SYSTEM: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-SYSTEM: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-SYSTEM: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// Make sure that using -nobuiltininc will drop resource headers
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nobuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOBUILTININC %s
|
|
|
|
// CHECK-NOBUILTININC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOBUILTININC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOBUILTININC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// Make sure that using -nostdlibinc will drop <sysroot>/usr/local/include and
|
|
|
|
// <sysroot>/usr/include.
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nostdlibinc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDLIBINC %s
|
|
|
|
// CHECK-NOSTDLIBINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOSTDLIBINC: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// Make sure that -nostdinc drops all the system include paths, including
|
|
|
|
// <resource>/include.
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nostdinc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDINC %s
|
|
|
|
// CHECK-NOSTDINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOSTDINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOSTDINC-NOT: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOSTDINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// Check search paths without -isysroot
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
2020-05-16 05:09:08 +08:00
|
|
|
// RUN: --sysroot="" \
|
[clang][Darwin] Refactor header search path logic into the driver
Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.
This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.
Reviewers: jfb, arphaman
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61963
llvm-svn: 361278
2019-05-22 01:48:04 +08:00
|
|
|
// RUN: | FileCheck -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSYSROOT %s
|
|
|
|
// CHECK-NOSYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOSYSROOT: "-internal-isystem" "/usr/local/include"
|
|
|
|
// CHECK-NOSYSROOT: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOSYSROOT: "-internal-externc-isystem" "/usr/include"
|
2020-01-28 05:01:06 +08:00
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nostdinc -ibuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDINC-BUILTINC %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -ibuiltininc -nostdinc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDINC-BUILTINC %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nostdinc -nobuiltininc -ibuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDINC-BUILTINC %s
|
|
|
|
// CHECK-NOSTDINC-BUILTINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOSTDINC-BUILTINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOSTDINC-BUILTINC: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOSTDINC-BUILTINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nobuiltininc -ibuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOBUILTININC-BUILTINC %s
|
|
|
|
// CHECK-NOBUILTININC-BUILTINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOBUILTININC-BUILTINC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOBUILTININC-BUILTINC: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOBUILTININC-BUILTINC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -nostdinc -ibuiltininc -nobuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-NOSTDINC-NO-BUILTINC %s
|
|
|
|
// CHECK-NOSTDINC-NO-BUILTINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-NOSTDINC-NO-BUILTINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-NOSTDINC-NO-BUILTINC-NOT: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-NOSTDINC-NO-BUILTINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
|
|
// RUN: -target x86_64-apple-darwin \
|
|
|
|
// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
|
|
|
|
// RUN: -resource-dir=%S/Inputs/resource_dir \
|
|
|
|
// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -ibuiltininc -nobuiltininc \
|
|
|
|
// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \
|
|
|
|
// RUN: -DRESOURCE=%S/Inputs/resource_dir \
|
|
|
|
// RUN: --check-prefix=CHECK-BUILTINC-NOBUILTININC %s
|
|
|
|
// CHECK-BUILTINC-NOBUILTININC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
|
|
|
|
// CHECK-BUILTINC-NOBUILTININC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
|
|
|
|
// CHECK-BUILTINC-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE]]/include"
|
|
|
|
// CHECK-BUILTINC-NOBUILTININC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
|