[ASan] use clangxx_asan instead of clang_asan for C++ lit tests

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161936 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/lit_tests/Linux/clone_test.cc b/lib/asan/lit_tests/Linux/clone_test.cc
index ece27b1..6bc4193 100644
--- a/lib/asan/lit_tests/Linux/clone_test.cc
+++ b/lib/asan/lit_tests/Linux/clone_test.cc
@@ -1,7 +1,7 @@
 // Regression test for:
 // http://code.google.com/p/address-sanitizer/issues/detail?id=37
 
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t | FileCheck %s
 
 #include <stdio.h>
diff --git a/lib/asan/lit_tests/Linux/interception_failure_test.cc b/lib/asan/lit_tests/Linux/interception_failure_test.cc
index 0157264..56bb2e8 100644
--- a/lib/asan/lit_tests/Linux/interception_failure_test.cc
+++ b/lib/asan/lit_tests/Linux/interception_failure_test.cc
@@ -1,7 +1,7 @@
 // If user provides his own libc functions, ASan doesn't
 // intercept these functions.
 
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t 2>&1 | FileCheck %s
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/lib/asan/lit_tests/Linux/interception_malloc_test.cc b/lib/asan/lit_tests/Linux/interception_malloc_test.cc
index 4f1a092..6885c85 100644
--- a/lib/asan/lit_tests/Linux/interception_malloc_test.cc
+++ b/lib/asan/lit_tests/Linux/interception_malloc_test.cc
@@ -1,6 +1,6 @@
 // ASan interceptor can be accessed with __interceptor_ prefix.
 
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t 2>&1 | FileCheck %s
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/lib/asan/lit_tests/Linux/interception_test.cc b/lib/asan/lit_tests/Linux/interception_test.cc
index 01111f1..8a876d8 100644
--- a/lib/asan/lit_tests/Linux/interception_test.cc
+++ b/lib/asan/lit_tests/Linux/interception_test.cc
@@ -1,6 +1,6 @@
 // ASan interceptor can be accessed with __interceptor_ prefix.
 
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t 2>&1 | FileCheck %s
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/lib/asan/lit_tests/deep_tail_call.cc b/lib/asan/lit_tests/deep_tail_call.cc
index 452e473..eb9cd0c 100644
--- a/lib/asan/lit_tests/deep_tail_call.cc
+++ b/lib/asan/lit_tests/deep_tail_call.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | FileCheck %s
 
 // CHECK: AddressSanitizer global-buffer-overflow
diff --git a/lib/asan/lit_tests/default_options.cc b/lib/asan/lit_tests/default_options.cc
index 5468062..950a7d8 100644
--- a/lib/asan/lit_tests/default_options.cc
+++ b/lib/asan/lit_tests/default_options.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t 2>&1 | FileCheck %s
 
 const char *kAsanDefaultOptions="verbosity=1 foo=bar";
diff --git a/lib/asan/lit_tests/dlclose-test.cc b/lib/asan/lit_tests/dlclose-test.cc
index c13cf7c..ca1ef0c 100644
--- a/lib/asan/lit_tests/dlclose-test.cc
+++ b/lib/asan/lit_tests/dlclose-test.cc
@@ -21,9 +21,9 @@
 // 6. BOOM
 //===----------------------------------------------------------------------===//
 
-// RUN: %clang_asan -O2 %p/SharedLibs/dlclose-test-so.cc \
+// RUN: %clangxx_asan -O2 %p/SharedLibs/dlclose-test-so.cc \
 // RUN:     -fPIC -shared -o %t-so.so
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t | FileCheck %s
 
 #include <assert.h>
diff --git a/lib/asan/lit_tests/global-overflow.cc b/lib/asan/lit_tests/global-overflow.cc
index dcb554c..573da6c 100644
--- a/lib/asan/lit_tests/global-overflow.cc
+++ b/lib/asan/lit_tests/global-overflow.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | FileCheck %s
 
 #include <string.h>
diff --git a/lib/asan/lit_tests/heap-overflow.cc b/lib/asan/lit_tests/heap-overflow.cc
index 927194b..043139a 100644
--- a/lib/asan/lit_tests/heap-overflow.cc
+++ b/lib/asan/lit_tests/heap-overflow.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer > %t.output
 // RUN: FileCheck %s < %t.output
 // RUN: FileCheck %s --check-prefix=CHECK-%os < %t.output
diff --git a/lib/asan/lit_tests/large_func_test.cc b/lib/asan/lit_tests/large_func_test.cc
index 6e0a0f9..a353de1 100644
--- a/lib/asan/lit_tests/large_func_test.cc
+++ b/lib/asan/lit_tests/large_func_test.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt > %t.output
 // RUN: FileCheck %s < %t.output
 // RUN: FileCheck %s --check-prefix=CHECK-%os < %t.output
diff --git a/lib/asan/lit_tests/lit.cfg b/lib/asan/lit_tests/lit.cfg
index 01661f0..8fadd91 100644
--- a/lib/asan/lit_tests/lit.cfg
+++ b/lib/asan/lit_tests/lit.cfg
@@ -24,13 +24,15 @@
 
 # Setup default compiler flags used with -faddress-sanitizer option.
 # FIXME: Review the set of required flags and check if it can be reduced.
-clang_asan_cxxflags = ("-faddress-sanitizer "
+clang_asan_cxxflags = ("-ccc-clang-cxx "
+                      + "-ccc-cxx "
+                      + "-faddress-sanitizer "
                       + "-mno-omit-leaf-frame-pointer "
                       + "-fno-omit-frame-pointer "
                       + "-fno-optimize-sibling-calls "
                       + "-g")
-config.substitutions.append( ("%clang_asan ", (" " + config.clang + " " +
-                                              clang_asan_cxxflags + " ")) )
+config.substitutions.append( ("%clangxx_asan ", (" " + config.clang + " " +
+                                                clang_asan_cxxflags + " ")) )
 
 # Setup path to symbolizer script.
 # FIXME: Instead we should copy this script to the build tree and point
diff --git a/lib/asan/lit_tests/memcmp_test.cc b/lib/asan/lit_tests/memcmp_test.cc
index 8293409..64b8313 100644
--- a/lib/asan/lit_tests/memcmp_test.cc
+++ b/lib/asan/lit_tests/memcmp_test.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt | FileCheck %s
 
 #include <string.h>
diff --git a/lib/asan/lit_tests/null_deref.cc b/lib/asan/lit_tests/null_deref.cc
index f82af11..91366dc 100644
--- a/lib/asan/lit_tests/null_deref.cc
+++ b/lib/asan/lit_tests/null_deref.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt > %t.output
 // RUN: FileCheck %s < %t.output
 // RUN: FileCheck %s --check-prefix=CHECK-%os < %t.output
diff --git a/lib/asan/lit_tests/shared-lib-test.cc b/lib/asan/lit_tests/shared-lib-test.cc
index 66f96c6..199076e 100644
--- a/lib/asan/lit_tests/shared-lib-test.cc
+++ b/lib/asan/lit_tests/shared-lib-test.cc
@@ -11,9 +11,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-// RUN: %clang_asan -O2 %p/SharedLibs/shared-lib-test-so.cc \
+// RUN: %clangxx_asan -O2 %p/SharedLibs/shared-lib-test-so.cc \
 // RUN:     -fPIC -shared -o %t-so.so
-// RUN: %clang_asan -O2 %s -o %t
+// RUN: %clangxx_asan -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | FileCheck %s
 
 #include <dlfcn.h>
diff --git a/lib/asan/lit_tests/stack-overflow.cc b/lib/asan/lit_tests/stack-overflow.cc
index 2ff921b..552a97a 100644
--- a/lib/asan/lit_tests/stack-overflow.cc
+++ b/lib/asan/lit_tests/stack-overflow.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | FileCheck %s
 
 #include <string.h>
diff --git a/lib/asan/lit_tests/stack-use-after-return.cc b/lib/asan/lit_tests/stack-use-after-return.cc
index b404ef8..929e760 100644
--- a/lib/asan/lit_tests/stack-use-after-return.cc
+++ b/lib/asan/lit_tests/stack-use-after-return.cc
@@ -1,5 +1,5 @@
 // XFAIL: *
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt | FileCheck %s
 
 #include <stdio.h>
diff --git a/lib/asan/lit_tests/strncpy-overflow.cc b/lib/asan/lit_tests/strncpy-overflow.cc
index a2e0015..ce537a4 100644
--- a/lib/asan/lit_tests/strncpy-overflow.cc
+++ b/lib/asan/lit_tests/strncpy-overflow.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt > %t.output
 // RUN: FileCheck %s < %t.output
 // RUN: FileCheck %s --check-prefix=CHECK-%os < %t.output
diff --git a/lib/asan/lit_tests/use-after-free.cc b/lib/asan/lit_tests/use-after-free.cc
index 61673b3..d047153 100644
--- a/lib/asan/lit_tests/use-after-free.cc
+++ b/lib/asan/lit_tests/use-after-free.cc
@@ -1,4 +1,4 @@
-// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %clangxx_asan -m64 -O2 %s -o %t
 // RUN: %t 2>&1 | %symbolizer | c++filt > %t.output
 // RUN: FileCheck %s < %t.output
 // RUN: FileCheck %s --check-prefix=CHECK-%os < %t.output
diff --git a/lib/lit.common.cfg b/lib/lit.common.cfg
index 16ba076..4c148b2 100644
--- a/lib/lit.common.cfg
+++ b/lib/lit.common.cfg
@@ -42,8 +42,10 @@
 path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
 config.environment['PATH'] = path
 
-# Define %clang substitution to use in test RUN lines.
+# Define %clang and %clangxx substitutions to use in test RUN lines.
 config.substitutions.append( ("%clang ", (" " + config.clang + " ")) )
+config.substitutions.append( ("%clangxx ", (" " + config.clang +
+                              " -ccc-clang-cxx -ccc-cxx ")) )
 
 # Use ugly construction to explicitly prohibit "clang", "clang++" etc.
 # in RUN lines.