Use -O1 when testing with ASAN and MSAN to prevent Clang OOM errors.
authorEric Fiselier <eric@efcs.ca>
Mon, 15 Aug 2016 19:37:20 +0000 (19:37 +0000)
committerEric Fiselier <eric@efcs.ca>
Mon, 15 Aug 2016 19:37:20 +0000 (19:37 +0000)
Currently certain tests get killed when compiled with ASAN at -O0 because
they eat all of the systems memory. This doesn't happen at -O1, so enable that
to work around the issue.

llvm-svn: 278722

libcxx/test/libcxx/test/config.py

index 1d03155..579089a 100644 (file)
@@ -617,6 +617,7 @@ class Configuration(object):
                 self.env['ASAN_OPTIONS'] = 'detect_odr_violation=0'
                 self.config.available_features.add('asan')
                 self.config.available_features.add('sanitizer-new-delete')
+                self.cxx.compile_flags += ['-O1']
             elif san == 'Memory' or san == 'MemoryWithOrigins':
                 self.cxx.flags += ['-fsanitize=memory']
                 if san == 'MemoryWithOrigins':
@@ -626,6 +627,7 @@ class Configuration(object):
                     self.env['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer
                 self.config.available_features.add('msan')
                 self.config.available_features.add('sanitizer-new-delete')
+                self.cxx.compile_flags += ['-O1']
             elif san == 'Undefined':
                 self.cxx.flags += ['-fsanitize=undefined',
                                    '-fno-sanitize=vptr,function,float-divide-by-zero',