[PATCH] New "strict_string_checks" run-time flag

Kostya Serebryany kcc at google.com
Thu Jan 29 10:29:34 PST 2015

> > 2. remove the failing checks from the test suite and write the corresponding lit tests that will test both strict_string_checks modes (or drop them if they're covered by the tests you've added in this CL);



> I would prefer the second variant. If no objections or other ideas I'll prepare corresponding update for this patch.

Yes, please!

Comment at: test/asan/TestCases/atol_strict.c:3
@@ +2,3 @@
+// RUN: %clang_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: ASAN_OPTIONS=strict_string_checks=false %run %t 2>&1
+// RUN: ASAN_OPTIONS=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
m.guseva wrote:
> kcc wrote:
> > here and below, add a 3-rd RUN line to run w/o ASAN_OPTIONS (i.e. to test what's default)
> Isn't it in first line after compile or do you mean something else?
Oh, yes, sorry. 

Comment at: test/asan/Unit/lit.site.cfg.in:33
@@ +32,2 @@
+# Disable strict str checks in unit tests
+config.environment['ASAN_OPTIONS'] = 'strict_string_checks=false'
glider wrote:
> ygribov wrote:
> > kcc wrote:
> > > Hm. Why? 
> > Some tests relied on non-strict semantics.
> I think we must fix the tests. It's not a good idea to silently change the default string checking mode in a bunch of tests.
> The best solution is to make these OOB reports depend on the flag value (can the unit test read common_flags?)
No, unit test should not rely on the flags, we need to move such tests to lit tests.



More information about the llvm-commits mailing list