47 lines · c
1// REQUIRES: !(default-cxx-stdlib=libc++)2// UNSUPPORTED: system-windows3// Windows is unsupported because we use the Unix path separator `/` in the test.4 5// Unlike the Darwin driver, the MachO driver doesn't add any framework search paths,6// only the normal header ones.7// RUN: %clang -x c -target arm64-apple-none-macho -isysroot %S/Inputs/MacOSX15.1.sdk -### -c %s 2>&1 \8// RUN: | FileCheck --check-prefixes=CC1,NO-CXX,ULI,CI,UI,NO-FW -DSDKROOT=%S/Inputs/MacOSX15.1.sdk %s9 10// Unlike the Darwin driver, the MachO driver doesn't default to libc++, and unless11// CLANG_DEFAULT_CXX_STDLIB is libc++ it won't add any search paths.12// RUN: %clang -x c++ -target arm64-apple-none-macho -isysroot %S/Inputs/MacOSX15.1.sdk -### -c %s 2>&1 \13// RUN: | FileCheck --check-prefixes=CC1,NO-CXX,ULI,CI,UI,NO-FW -DSDKROOT=%S/Inputs/MacOSX15.1.sdk %s14 15// However, if the user requests libc++, the MachO driver should find the search path.16// RUN: %clang -x c++ -stdlib=libc++ -target arm64-apple-none-macho -isysroot %S/Inputs/MacOSX15.1.sdk -### -c %s 2>&1 \17// RUN: | FileCheck --check-prefixes=CC1,CXX,ULI,CI,UI,NO-FW -DSDKROOT=%S/Inputs/MacOSX15.1.sdk %s18 19// Verify that embedded uses can swap in alternate usr/include and usr/local/include directories.20// usr/local/include is specified in the driver as -internal-isystem, however, the driver generated21// paths come before the paths in the driver arguments. In order to keep usr/local/include in the22// same position, -isystem has to be used instead of -Xclang -internal-isystem. There isn't an23// -externc-isystem, but it's ok to use -Xclang -internal-externc-isystem since the driver doesn't24// use that if -nostdlibinc or -nostdinc is passed.25// RUN: %clang -x c++ -stdlib=libc++ -target arm64-apple-none-macho -isysroot %S/Inputs/MacOSX15.1.sdk \26// RUN: -nostdlibinc -isystem %S/Inputs/MacOSX15.1.sdk/embedded/usr/local/include \27// RUN: -Xclang -internal-externc-isystem -Xclang %S/Inputs/MacOSX15.1.sdk/embedded/usr/include \28// RUN: -### -c %s 2>&1 | FileCheck --check-prefixes=CC1,NO-CXX,EULI,CI,EUI,NO-FW -DSDKROOT=%S/Inputs/MacOSX15.1.sdk %s29 30 31// The ordering of these flags doesn't matter, and so this test is a little32// fragile. i.e. all of the -internal-isystem paths will be searched before the33// -internal-externc-isystem ones, and their order on the command line doesn't34// matter. The line order here is just the current order that the driver writes35// the cc1 arguments.36 37// CC1: "-cc1"38// CC1: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]"39// NO-CXX-NOT: "-internal-isystem" "{{.*}}/include/c++/v1"40// CXX-SAME: "-internal-isystem" "{{.*}}/include/c++/v1"41// ULI-SAME: "-internal-isystem" "[[SDKROOT]]/usr/local/include"42// EULI-SAME: "-isystem" "[[SDKROOT]]/embedded/usr/local/include"43// CI-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include"44// UI-SAME: "-internal-externc-isystem" "[[SDKROOT]]/usr/include"45// EUI-SAME: "-internal-externc-isystem" "[[SDKROOT]]/embedded/usr/include"46// NO-FW-NOT: "-internal-iframework"47