diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index ceb6775a3dcc..512aad2ca69a 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -5166,6 +5166,7 @@ void gcc::Compile::RenderExtraToolArgs(const JobAction &JA, break; case types::TY_PP_Asm: CmdArgs.push_back("-S"); + break; case types::TY_Nothing: CmdArgs.push_back("-fsyntax-only"); break; diff --git a/clang/test/Driver/gfortran.f90 b/clang/test/Driver/gfortran.f90 index 3631f8c9f4c1..e687e51b4df3 100644 --- a/clang/test/Driver/gfortran.f90 +++ b/clang/test/Driver/gfortran.f90 @@ -251,3 +251,10 @@ ! ! CHECK-PR22234-NOT: clang: error: invalid output type ! CHECK-PR22234: "-fsyntax-only" +! +! Regression test for the bug introduced with PR22234 fix. +! Make sure -fsyntax-only is not passed to gfortran during normal compilation. +! +! RUN: %clang -no-canonical-prefixes -target i386-linux -### %s -o %t 2>&1 \ +! RUN: | FileCheck %s --check-prefix=CHECK-PR22234-R +! CHECK-PR22234-R-NOT: "-fsyntax-only"