From df43ec30ab66f5af7bbf87e121e0fe26aad478b4 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Wed, 30 Nov 2022 23:09:28 -0800 Subject: [PATCH] [Driver] Add test for -stdlib++-isystem with -nostdinc This further clarifies the intent of the flag. --- clang/test/Driver/stdlibxx-isystem.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/clang/test/Driver/stdlibxx-isystem.cpp b/clang/test/Driver/stdlibxx-isystem.cpp index 827cdf9..d488898 100644 --- a/clang/test/Driver/stdlibxx-isystem.cpp +++ b/clang/test/Driver/stdlibxx-isystem.cpp @@ -51,3 +51,13 @@ // RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc++ \ // RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINCXX %s // NOSTDINCXX-NOT: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar" + +// It should take effect even if -nostdinc or -nostdlibinc are specified; only +// -nostdinc++ should suppress it. +// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \ +// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc \ +// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINC %s +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \ +// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdlibinc \ +// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINC %s +// NOSTDINC: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar" -- 2.7.4