https://github.com/ShashwathiNavada updated https://github.com/llvm/llvm-project/pull/200733
>From 41e30ff1295e902804a2e013deb775a86062ab1c Mon Sep 17 00:00:00 2001 From: ShashwathiNavada <[email protected]> Date: Mon, 1 Jun 2026 01:51:03 -0500 Subject: [PATCH 1/2] [Flang] Fix -frelaxed-c-loc-checks being ignored when using the driver --- clang/lib/Driver/ToolChains/Flang.cpp | 3 ++- flang/test/Semantics/c_loc01-relaxed.f90 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index 892a455167205..8b6e83528fecf 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -261,7 +261,8 @@ void Flang::addCodegenOptions(const ArgList &Args, options::OPT_frepack_arrays_contiguity_EQ, options::OPT_fstack_repack_arrays, options::OPT_fno_stack_repack_arrays, options::OPT_ftime_report, options::OPT_ftime_report_EQ, - options::OPT_funroll_loops, options::OPT_fno_unroll_loops}); + options::OPT_funroll_loops, options::OPT_fno_unroll_loops, + options::OPT_relaxed_c_loc}); if (Args.hasArg(options::OPT_fcoarray)) CmdArgs.push_back("-fcoarray"); } diff --git a/flang/test/Semantics/c_loc01-relaxed.f90 b/flang/test/Semantics/c_loc01-relaxed.f90 index 714d4acd5e06f..bfb036b6c0580 100644 --- a/flang/test/Semantics/c_loc01-relaxed.f90 +++ b/flang/test/Semantics/c_loc01-relaxed.f90 @@ -1,4 +1,5 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -frelaxed-c-loc-checks +! RUN: %python %S/test_errors.py %s %flang -frelaxed-c-loc-checks module m use iso_c_binding type haslen(L) >From 5bf76c3e49e217d2d986566e79a355ec4c3a7952 Mon Sep 17 00:00:00 2001 From: ShashwathiNavada <[email protected]> Date: Mon, 1 Jun 2026 09:46:17 -0500 Subject: [PATCH 2/2] Suggested changes --- flang/test/Driver/frelaxed-c-loc-checks.f90 | 3 +++ flang/test/Semantics/c_loc01-relaxed.f90 | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 flang/test/Driver/frelaxed-c-loc-checks.f90 diff --git a/flang/test/Driver/frelaxed-c-loc-checks.f90 b/flang/test/Driver/frelaxed-c-loc-checks.f90 new file mode 100644 index 0000000000000..4d5a1455fdc5c --- /dev/null +++ b/flang/test/Driver/frelaxed-c-loc-checks.f90 @@ -0,0 +1,3 @@ +RUN: %flang -### -frelaxed-c-loc-checks %s 2>&1 | FileCheck %s +CHECK: "-fc1" +CHECK-SAME: "-frelaxed-c-loc-checks" diff --git a/flang/test/Semantics/c_loc01-relaxed.f90 b/flang/test/Semantics/c_loc01-relaxed.f90 index bfb036b6c0580..714d4acd5e06f 100644 --- a/flang/test/Semantics/c_loc01-relaxed.f90 +++ b/flang/test/Semantics/c_loc01-relaxed.f90 @@ -1,5 +1,4 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -frelaxed-c-loc-checks -! RUN: %python %S/test_errors.py %s %flang -frelaxed-c-loc-checks module m use iso_c_binding type haslen(L) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
