diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -464,7 +464,8 @@ InGroup>; def warn_drv_use_ld_non_word : Warning< - "'-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead">; + "'-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead">, + InGroup, DefaultIgnore; def warn_drv_fine_grained_bitfield_accesses_ignored : Warning< "option '-ffine-grained-bitfield-accesses' cannot be enabled together with a sanitizer; flag ignored">, diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -869,6 +869,8 @@ def PointerToIntCast : DiagGroup<"pointer-to-int-cast", [PointerToEnumCast, VoidPointerToIntCast]>; +def UseLdNonWord : DiagGroup<"use-ld-non-word">; + def Move : DiagGroup<"move", [ PessimizingMove, RedundantMove, @@ -887,7 +889,8 @@ UnusedParameter, NullPointerArithmetic, EmptyInitStatement, - StringConcatation + StringConcatation, + UseLdNonWord, ]>; def Most : DiagGroup<"most", [ diff --git a/clang/test/Driver/fuse-ld.c b/clang/test/Driver/fuse-ld.c --- a/clang/test/Driver/fuse-ld.c +++ b/clang/test/Driver/fuse-ld.c @@ -1,10 +1,18 @@ -// RUN: %clang %s -### \ -// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 \ -// RUN: -target x86_64-unknown-linux \ -// RUN: | FileCheck %s --check-prefix=CHECK-ABSOLUTE-LD +/// The absolute path warning is enabled by -Wuse-ld-non-word and -Wextra. +// RUN: %clang %s -### -target x86_64-unknown-linux -Wuse-ld-non-word \ +// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CHECK-ABSOLUTE-LD // CHECK-ABSOLUTE-LD: warning: '-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead // CHECK-ABSOLUTE-LD: /usr/local/bin/or1k-linux-ld +// RUN: %clang %s -### -target x86_64-unknown-linux -Wextra \ +// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CHECK-ABSOLUTE-LD + +// RUN: %clang %s -### -target x86_64-unknown-linux \ +// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CHECK-NO-WARN +// CHECK-NO-WARN-NOT: warning: // RUN: %clang %s -### \ // RUN: -target x86_64-unknown-freebsd 2>&1 \