63 lines · cpp
1// Backslash escaping makes matching against the installation directory fail on2// Windows. Temporarily disable the test there until we add an option to print3// the installation directory unescaped.4 5// By default, we should search for libc++ next to the driver.6// RUN: mkdir -p %t/bin7// RUN: mkdir -p %t/include/c++/v18// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %/t/bin \9// RUN: -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \10// RUN: FileCheck -check-prefix=LIBCXX %s11// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %/t/bin \12// RUN: -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \13// RUN: FileCheck -check-prefix=LIBCXX %s14// LIBCXX: InstalledDir: [[INSTALLDIR:.+$]]15// LIBCXX: "-internal-isystem" "[[INSTALLDIR]]{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"16 17// Passing -stdlib++-isystem should suppress the default search.18// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %/t/bin \19// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \20// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NODEFAULT %s21// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %/t/bin \22// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \23// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NODEFAULT %s24// NODEFAULT: InstalledDir: [[INSTALLDIR:.+$]]25// NODEFAULT-NOT: "-internal-isystem" "[[INSTALLDIR]]{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"26 27// And we should add it as an -internal-isystem.28// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \29// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \30// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=INCPATH %s31// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \32// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \33// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=INCPATH %s34// INCPATH: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar"35 36// We shouldn't pass the -stdlib++-isystem to cc1.37// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \38// RUN: -stdlib++-isystem /tmp -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \39// RUN: FileCheck -check-prefix=NOCC1 %s40// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \41// RUN: -stdlib++-isystem /tmp -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \42// RUN: FileCheck -check-prefix=NOCC1 %s43// NOCC1-NOT: "-stdlib++-isystem" "/tmp"44 45// It should respect -nostdinc++.46// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \47// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc++ \48// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINCXX %s49// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \50// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc++ \51// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINCXX %s52// NOSTDINCXX-NOT: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar"53 54// It should take effect even if -nostdinc or -nostdlibinc are specified; only55// -nostdinc++ should suppress it.56// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \57// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc \58// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINC %s59// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \60// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdlibinc \61// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINC %s62// NOSTDINC: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar"63