
Newer SDKs don't even provide libstdc++ headers, so it's effectively never valid to build for libstdc++ unless the user explicitly asks for it (in which case they will need to provide include paths and more). This is a re-application of c5ccb78ade81 which had been reverted in 33171df9cc7f because it broke the Fuchsia CI bots. The issue was that the test was XPASSing because it didn't fail anymore when the CLANG_DEFAULT_CXX_LIB was set to libc++, which seems to be done for Fuchsia. Instead, the test only fails if CLANG_DEFAULT_CXX_LIB is set to libstdc++. As a fly-by fix, also adjust the triple used by various tests to something that is supported. Those tests were shown to fail on internal bots. Differential Revision: https://reviews.llvm.org/D131274
54 lines
2.2 KiB
C
54 lines
2.2 KiB
C
// Parse diagnostic arguments in the driver
|
|
|
|
// Exactly which arguments are warned about and which aren't differ based
|
|
// on what target is selected. -stdlib= and -fuse-ld= emit diagnostics when
|
|
// compiling C code, for e.g. *-linux-gnu. Linker inputs, like -lfoo, emit
|
|
// diagnostics when only compiling for all targets.
|
|
|
|
// This is normally a non-fatal warning:
|
|
// RUN: %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: -fsyntax-only -lfoo %s 2>&1 | FileCheck %s
|
|
|
|
// Either with a specific -Werror=unused.. or a blanket -Werror, this
|
|
// causes the command to fail.
|
|
// RUN: not %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: -fsyntax-only -lfoo \
|
|
// RUN: -Werror=unused-command-line-argument %s 2>&1 | FileCheck %s
|
|
|
|
// RUN: not %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: -fsyntax-only -lfoo -Werror %s 2>&1 | FileCheck %s
|
|
|
|
// With a specific -Wno-..., no diagnostic should be printed.
|
|
// RUN: %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: -fsyntax-only -lfoo -Werror \
|
|
// RUN: -Wno-unused-command-line-argument %s 2>&1 | count 0
|
|
|
|
// With -Qunused-arguments, no diagnostic should be printed.
|
|
// RUN: %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: -fsyntax-only -lfoo -Werror \
|
|
// RUN: -Qunused-arguments %s 2>&1 | count 0
|
|
|
|
// With the argument enclosed in --{start,end}-no-unused-arguments,
|
|
// there's no diagnostic.
|
|
// RUN: %clang --target=x86_64-apple-darwin11 -fsyntax-only \
|
|
// RUN: --start-no-unused-arguments -lfoo --end-no-unused-arguments \
|
|
// RUN: -Werror %s 2>&1 | count 0
|
|
|
|
// With --{start,end}-no-unused-argument around a different argument, it
|
|
// still warns about the unused argument.
|
|
// RUN: not %clang --target=x86_64-apple-darwin11 \
|
|
// RUN: --start-no-unused-arguments -fsyntax-only --end-no-unused-arguments \
|
|
// RUN: -lfoo -Werror %s 2>&1 | FileCheck %s
|
|
|
|
// Test clang-cl warning about unused linker options.
|
|
// RUN: not %clang_cl -fsyntax-only /WX \
|
|
// RUN: -LD -- %s 2>&1 | FileCheck %s --check-prefix=CL-WARNING
|
|
|
|
// Test clang-cl ignoring the warning with --start-no-unused-arguments.
|
|
// RUN: %clang_cl -fsyntax-only /WX \
|
|
// RUN: --start-no-unused-arguments /LD --end-no-unused-arguments -- %s 2>&1 | count 0
|
|
|
|
// CHECK: -lfoo: 'linker' input unused
|
|
|
|
// CL-WARNING: argument unused during compilation: '-LD'
|