[PATCH] D57318: [compiler-rt] Fix reporting unrecognized flags in unittests.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 28 03:04:51 PST 2019
ikudrin created this revision.
ikudrin added reviewers: etienneb, rnk.
Herald added subscribers: Sanitizers, dberris, kubamracek.
With D21896 <https://reviews.llvm.org/D21896>, unrecognized flags might be reported within a wrong test case. For example:
[ RUN ] SanitizerCommon.IntFlags
[ OK ] SanitizerCommon.IntFlags (9 ms)
[ RUN ] SanitizerCommon.StrFlags
WARNING: found 2 unrecognized flag(s):
--flag_name
zzzzzzz
[ OK ] SanitizerCommon.StrFlags (0 ms)
Actually, these two flags are created in `SanitizerCommon.IntFlags`.
The patch fixes that so that the warnings are issued within the right test case:
[ RUN ] SanitizerCommon.IntFlags
WARNING: found 1 unrecognized flag(s):
--flag_name
WARNING: found 1 unrecognized flag(s):
zzzzzzz
[ OK ] SanitizerCommon.IntFlags (6 ms)
[ RUN ] SanitizerCommon.StrFlags
[ OK ] SanitizerCommon.StrFlags (0 ms)
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D57318
Files:
lib/sanitizer_common/tests/sanitizer_flags_test.cc
Index: lib/sanitizer_common/tests/sanitizer_flags_test.cc
===================================================================
--- lib/sanitizer_common/tests/sanitizer_flags_test.cc
+++ lib/sanitizer_common/tests/sanitizer_flags_test.cc
@@ -33,6 +33,9 @@
parser.ParseString(env);
EXPECT_EQ(final_value, flag);
+
+ // Reporting unrecognized flags is needed to reset them.
+ ReportUnrecognizedFlags();
}
template <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57318.183813.patch
Type: text/x-patch
Size: 427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/7694ac58/attachment.bin>
More information about the llvm-commits
mailing list