https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/79821
>From c22d670259f1d9fc22b6e01bf19d1f2316b1d617 Mon Sep 17 00:00:00 2001 From: Ammarguellat <zahira.ammarguel...@intel.com> Date: Mon, 29 Jan 2024 04:56:13 -0800 Subject: [PATCH 1/3] Fix erroneous warning. --- clang/lib/Driver/ToolChains/Clang.cpp | 2 +- clang/test/Driver/range.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 8d8965fdf76fb..7ceb248f7afb9 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2705,7 +2705,7 @@ static StringRef EnumComplexRangeToStr(LangOptions::ComplexRangeKind Range) { static void EmitComplexRangeDiag(const Driver &D, LangOptions::ComplexRangeKind Range1, LangOptions::ComplexRangeKind Range2) { - if (Range1 != LangOptions::ComplexRangeKind::CX_Full) + if (Range1 != Range2 && Range1 != LangOptions::ComplexRangeKind::CX_None) D.Diag(clang::diag::warn_drv_overriding_option) << EnumComplexRangeToStr(Range1) << EnumComplexRangeToStr(Range2); } diff --git a/clang/test/Driver/range.c b/clang/test/Driver/range.c index 045d9c7d3d802..023b5cffbe3e0 100644 --- a/clang/test/Driver/range.c +++ b/clang/test/Driver/range.c @@ -35,6 +35,9 @@ // RUN: %clang -### -target x86_64 -ffast-math -fno-cx-limited-range -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=FULL %s +// RUN: %clang -c -target x86_64 -fcx-limited-range %s -Xclang -verify=range +// RUN: %clang -c -target x86_64 -fcx-fortran-rules %s -Xclang -verify=range + // LMTD: -complex-range=limited // FULL: -complex-range=full // LMTD-NOT: -complex-range=fortran @@ -44,3 +47,4 @@ // CHECK-NOT: -complex-range=fortran // WARN1: warning: overriding '-fcx-limited-range' option with '-fcx-fortran-rules' [-Woverriding-option] // WARN2: warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range' [-Woverriding-option] +// range-no-diagnostics >From 407340d515c2f1bd9ced550077e9e3c316c4e2c1 Mon Sep 17 00:00:00 2001 From: Ammarguellat <zahira.ammarguel...@intel.com> Date: Tue, 30 Jan 2024 06:26:53 -0800 Subject: [PATCH 2/3] Fixed LIT test. --- clang/test/Driver/range.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/test/Driver/range.c b/clang/test/Driver/range.c index 023b5cffbe3e0..9a51925dba9e8 100644 --- a/clang/test/Driver/range.c +++ b/clang/test/Driver/range.c @@ -35,8 +35,11 @@ // RUN: %clang -### -target x86_64 -ffast-math -fno-cx-limited-range -c %s 2>&1 \ // RUN: | FileCheck --check-prefix=FULL %s -// RUN: %clang -c -target x86_64 -fcx-limited-range %s -Xclang -verify=range -// RUN: %clang -c -target x86_64 -fcx-fortran-rules %s -Xclang -verify=range +// RUN: %clang -### -Werror -target x86_64 -fcx-limited-range -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=LMTD %s + +// RUN: %clang -### -Werror -target x86_64 -fcx-fortran-rules -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=FRTRN %s // LMTD: -complex-range=limited // FULL: -complex-range=full >From d7f2ad17b285fe0fcc153defb45dac2a16ab4e30 Mon Sep 17 00:00:00 2001 From: Ammarguellat <zahira.ammarguel...@intel.com> Date: Wed, 31 Jan 2024 04:58:57 -0800 Subject: [PATCH 3/3] Remove unused line in range.c. --- clang/test/Driver/range.c | 1 - 1 file changed, 1 deletion(-) diff --git a/clang/test/Driver/range.c b/clang/test/Driver/range.c index 9a51925dba9e8..49116df2f4480 100644 --- a/clang/test/Driver/range.c +++ b/clang/test/Driver/range.c @@ -50,4 +50,3 @@ // CHECK-NOT: -complex-range=fortran // WARN1: warning: overriding '-fcx-limited-range' option with '-fcx-fortran-rules' [-Woverriding-option] // WARN2: warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range' [-Woverriding-option] -// range-no-diagnostics _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits