On Wed, Dec 5, 2012 at 4:43 PM, Jakub Jelinek <ja...@redhat.com> wrote: > Hi! > > On Wed, Dec 05, 2012 at 04:06:51PM +0100, Jakub Jelinek wrote: >> FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_GlobalStringConstTest >> Ident(p[15]) execution test > > So, this one fails because we don't instrument string literals, in GCC > they aren't anything close to global variables (like they are in LLVM?) > Perhaps we could, handle STRING_CSTs in categorize_decl_for_section > like flag_mudflap handles them (essentially disable -fmerge-constants), > add code to output_constant_def_contents to emit the padding around it > if protected and in asan_finish_file traverse constant_pool_htab (), > looking for STRING_CSTs that were TREE_ASM_WRITTEN.
For LTO we need to remove the STRING_CST special handling in the IL anyway (and use CONST_DECLs for them). See PR50199. The fallout is of course not very high on my list to fix ;) But I have some proof-of-concept patch somewhere. Richard. >> FAIL: g++.dg/asan/asan_test.C -O2 >> AddressSanitizer_FileNameInGlobalReportTest Ident(p[15]) output pattern >> test, should match zoo.*asan_test.cc > > This one fails to match because the filename in that case isn't > asan_test.cc, but asan_test.C. Can it use say > ASAN_TEST_NAME macro, > #ifndef ASAN_TEST_NAME > # define ASAN_TEST_NAME "asan_test.cc" > #endif > > and replace "zoo.*asan_test.cc" with "zoo.*" ASAN_TEST_NAME (and similarly > in one of the disabled tests)? Then asan_test.C could just > #define ASAN_TEST_NAME "asan_test.C" > before #include "asan_test.cc" > > Jakub