Use -O1 when testing with ASAN and MSAN to prevent Clang OOM errors.

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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278722 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 1d03155..579089a 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -617,6 +617,7 @@
                 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 @@
                     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',