[clang] d4245ed - [clang-cl] Accept /FA[c][s][u], but ignore the arguments
Stephen Long via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 13 12:02:09 PDT 2022
Author: Stephen Long
Date: 2022-06-13T12:01:54-07:00
New Revision: d4245ed67ce44188714e6b29a0b45e860619bcf2
URL: https://github.com/llvm/llvm-project/commit/d4245ed67ce44188714e6b29a0b45e860619bcf2
DIFF: https://github.com/llvm/llvm-project/commit/d4245ed67ce44188714e6b29a0b45e860619bcf2.diff
LOG: [clang-cl] Accept /FA[c][s][u], but ignore the arguments
Previously, /FAsc would emit a warning. Now, it will just do what /FA does.
https://docs.microsoft.com/en-us/cpp/build/reference/fa-fa-listing-file?view=msvc-170
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D127519
Added:
Modified:
clang/include/clang/Driver/Options.td
clang/test/Driver/cl-options.c
clang/test/Driver/cl-outputs.c
Removed:
################################################################################
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 563ad4611c17..b614ae969c62 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6582,7 +6582,7 @@ def _SLASH_EP : CLFlag<"EP">,
def _SLASH_external_env : CLJoined<"external:env:">,
HelpText<"Add dirs in env var <var> to include search path with warnings suppressed">,
MetaVarName<"<var>">;
-def _SLASH_FA : CLFlag<"FA">,
+def _SLASH_FA : CLJoined<"FA">,
HelpText<"Output assembly code file during compilation">;
def _SLASH_Fa : CLJoined<"Fa">,
HelpText<"Set assembly output file name (with /FA)">,
@@ -6750,7 +6750,6 @@ def _SLASH_doc : CLJoined<"doc">;
def _SLASH_experimental : CLJoined<"experimental:">;
def _SLASH_exportHeader : CLFlag<"exportHeader">;
def _SLASH_external : CLJoined<"external:">;
-def _SLASH_FA_joined : CLJoined<"FA">;
def _SLASH_favor : CLJoined<"favor">;
def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 89a5a90dfa57..a2e350a0a835 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -65,20 +65,29 @@
// RUN: %clang_cl -### /FA -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE %s
// RUN: %clang_cl -### /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE-FILE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE-FILE %s
// CHECK-PROFILE-INSTR-GENERATE: "-fprofile-instrument=clang" "--dependent-lib=clang_rt.profile{{[^"]*}}.lib"
// CHECK-PROFILE-INSTR-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw"
// RUN: %clang_cl -### /FA -fprofile-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
// CHECK-PROFILE-GENERATE: "-fprofile-instrument=llvm" "--dependent-lib=clang_rt.profile{{[^"]*}}.lib"
// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
// CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'
// RUN: %clang_cl -### /FA -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
// RUN: %clang_cl -### /FA -fprofile-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
// RUN: %clang_cl -### /FA -fprofile-instr-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
// RUN: %clang_cl -### /FA -fprofile-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-instr-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
+// RUN: %clang_cl -### /FAcsu -fprofile-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
// CHECK-PROFILE-USE: "-fprofile-instrument-use-path=default.profdata"
// CHECK-PROFILE-USE-FILE: "-fprofile-instrument-use-path=/tmp/somefile.prof"
diff --git a/clang/test/Driver/cl-outputs.c b/clang/test/Driver/cl-outputs.c
index 75ff77e15910..abca67b12e55 100644
--- a/clang/test/Driver/cl-outputs.c
+++ b/clang/test/Driver/cl-outputs.c
@@ -238,6 +238,28 @@
// FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
// FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
+// Copy of the same tests above, but with /FAcsu
+// RUN: %clang_cl /FAcsu -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU %s
+// FA_CSU: "-o" "cl-outputs.asm"
+// RUN: %clang_cl /FAcsu /Fa -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaEMPTY %s
+// FA_CSU_FaEMPTY: "-o" "cl-outputs.asm"
+// RUN: %clang_cl /FAcsu /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaNAME %s
+// RUN: %clang_cl /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaNAME %s
+// FA_CSU_FaNAME: "-o" "foo.asm"
+// RUN: %clang_cl /FAcsu /Faa.ext /Fab.ext -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaNAMEEXT %s
+// FA_CSU_FaNAMEEXT: "-o" "b.ext"
+// RUN: %clang_cl /FAcsu /Fafoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaDIR %s
+// FA_CSU_FaDIR: "-o" "foo.dir{{[/\\]+}}cl-outputs.asm"
+// RUN: %clang_cl /FAcsu /Fafoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaDIRNAME %s
+// FA_CSU_FaDIRNAME: "-o" "foo.dir{{[/\\]+}}a.asm"
+// RUN: %clang_cl /FAcsu /Fafoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaDIRNAMEEXT %s
+// FA_CSU_FaDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext"
+// RUN: %clang_cl /Faa.asm -### -- %s %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaMULTIPLESOURCE %s
+// FA_CSU_FaMULTIPLESOURCE: error: cannot specify '/Faa.asm' when compiling multiple source files
+// RUN: %clang_cl /Fa -### -- %s %s 2>&1 | FileCheck -check-prefix=FA_CSU_FaMULTIPLESOURCEOK %s
+// FA_CSU_FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
+// FA_CSU_FaMULTIPLESOURCEOK: "-o" "cl-outputs.asm"
+
// RUN: %clang_cl /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
// P: "-E"
// P: "-o" "cl-outputs.i"
More information about the cfe-commits
mailing list