diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2020-12-09 13:26:39 +0100 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2020-12-16 09:44:54 +0100 |
commit | f2661bed185e14a8f5aa9a54565a8b938a7a10aa (patch) | |
tree | 50563a8d305686eaefc5abd916a54ffcf6cae797 /clang/unittests/Frontend/CompilerInvocationTest.cpp | |
parent | 95114f21f5bf1704672dadb45ca7c25efca72e03 (diff) | |
download | llvm-f2661bed185e14a8f5aa9a54565a8b938a7a10aa.zip llvm-f2661bed185e14a8f5aa9a54565a8b938a7a10aa.tar.gz llvm-f2661bed185e14a8f5aa9a54565a8b938a7a10aa.tar.bz2 |
[clang][cli] Prevent double denormalization
If both flags created through BoolOption are CC1Option and the keypath has a non-default or non-implied value, the denormalizer gets called twice. If the denormalizer has the ability to generate both flags, we can end up generating the same flag twice.
Reviewed By: dexonsmith, Bigcheese
Differential Revision: https://reviews.llvm.org/D93094
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
-rw-r--r-- | clang/unittests/Frontend/CompilerInvocationTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp index 156e3393..51b7ba8 100644 --- a/clang/unittests/Frontend/CompilerInvocationTest.cpp +++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp @@ -269,7 +269,7 @@ TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentPos) { Invocation.generateCC1CommandLine(GeneratedArgs, *this); - ASSERT_THAT(GeneratedArgs, Contains(StrEq("-fdebug-pass-manager"))); + ASSERT_EQ(count(GeneratedArgs, StringRef("-fdebug-pass-manager")), 1); ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq("-fno-debug-pass-manager")))); } |