On Tue, Dec 24, 2013 at 02:10:57PM +0400, Maxim Ostapenko wrote: > >As for the tests, I'm afraid I don't like them at all. > >If anything, it ought to be dg-do compile tests where you say > >scan assembly or some dump, but having runtime testcases that > >trigger undefined behavior that isn't detected by the instrumentation > >library at all and expect them to "pass" is simply wrong. > > > Got it, converted all tests except no-asan-stack.c, because i failed > to discover how to grep for stack > instrumentation. Perhaps memcmp of random data is fine?
It is still undefined behavior, IMNSHO it is far better to just change those tests into compile time tests and verify assembly using dg-final scan-assembler. Say verify that __asan_option_detect_stack_use_after_return isn't present for the no-use-after-return test, or __asan_report_store resp. __asan_report_load isn't present, or __asan_register_globals etc. Jakub