[PATCH] D17189: [compiler-rt] Fix test failures when switching default C++ library

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 00:20:44 PST 2016


Hahnfeld created this revision.
Hahnfeld added reviewers: samsonov, kcc, dvyukov.
Hahnfeld added a subscriber: llvm-commits.

1. Add two explicit `-stdlib=libstdc++` in conjunction with `-static-libstdc++`
2. Pass `-nostdinc++` when adding include paths for `libc++` built for `tsan`. This prevents clang finding the headers twice which would confuse `#include_next`

http://reviews.llvm.org/D17189

Files:
  test/asan/TestCases/throw_invoke_test.cc
  test/tsan/lit.cfg
  test/tsan/static_init6.cc

Index: test/tsan/static_init6.cc
===================================================================
--- test/tsan/static_init6.cc
+++ test/tsan/static_init6.cc
@@ -1,4 +1,4 @@
-// RUN: %clangxx_tsan -static-libstdc++ -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_tsan -stdlib=libstdc++ -static-libstdc++ -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
 #include <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
Index: test/tsan/lit.cfg
===================================================================
--- test/tsan/lit.cfg
+++ test/tsan/lit.cfg
@@ -55,6 +55,7 @@
   libcxx_libdir = os.path.join(libcxx_path, "lib")
   libcxx_so = os.path.join(libcxx_libdir, "libc++.so")
   clang_tsan_cxxflags += ["-std=c++11",
+                          "-nostdinc++",
                           "-I%s" % libcxx_incdir,
                           libcxx_so,
                           "-Wl,-rpath=%s" % libcxx_libdir]
Index: test/asan/TestCases/throw_invoke_test.cc
===================================================================
--- test/asan/TestCases/throw_invoke_test.cc
+++ test/asan/TestCases/throw_invoke_test.cc
@@ -1,5 +1,5 @@
 // RUN: %clangxx_asan %s -o %t && %run %t
-// RUN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t
+// RUN: %clangxx_asan %s -o %t -stdlib=libstdc++ -static-libstdc++ && %run %t
 
 // Clang doesn't support exceptions on Windows yet.
 // XFAIL: win32


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17189.47772.patch
Type: text/x-patch
Size: 1400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160212/d6c17ac6/attachment.bin>


More information about the llvm-commits mailing list