summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-12-27 03:16:20 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-12-27 03:16:20 +0000
commitc0e0924a93d5f5c77e25354184c64e43ff2d397b (patch)
tree3cbcf4f7307b389315bab44cb38564897c025d6d
parent0d5b5ffdc01d7a4a6c8508f35d3ee6eb56b2ed54 (diff)
downloadcompiler-rt-c0e0924a93d5f5c77e25354184c64e43ff2d397b.tar.gz
test: filter out -fPIE/-pie on Windows
Use some new substitutions to avoid duplicating the tests for just dropped flags. -fPIC/-fPIE/-fpic/-fpie do not make sense on Windows as they can cause ELF-style PIC. Substitute away the flag on Windows. This should repair the windows buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@290571 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/asan/TestCases/sanity_check_pure_c.c2
-rw-r--r--test/asan/TestCases/suppressions-library.cc2
-rw-r--r--test/asan/lit.cfg9
3 files changed, 11 insertions, 2 deletions
diff --git a/test/asan/TestCases/sanity_check_pure_c.c b/test/asan/TestCases/sanity_check_pure_c.c
index 428d660b6..9d74996e4 100644
--- a/test/asan/TestCases/sanity_check_pure_c.c
+++ b/test/asan/TestCases/sanity_check_pure_c.c
@@ -3,7 +3,7 @@
// RUN: not %run %t 2>&1 | FileCheck %s
// Sanity checking a test in pure C with -pie.
-// RUN: %clang_asan -O2 %s -pie -fPIE -o %t
+// RUN: %clang_asan -O2 %s %pie %fPIE -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
diff --git a/test/asan/TestCases/suppressions-library.cc b/test/asan/TestCases/suppressions-library.cc
index ad6e09279..e95d33916 100644
--- a/test/asan/TestCases/suppressions-library.cc
+++ b/test/asan/TestCases/suppressions-library.cc
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
+// RUN: %clangxx_asan -O0 -DSHARED_LIB %s %fPIC -shared -o %dynamiclib %ld_flags_rpath_so
// RUN: %clangxx_asan -O0 %s -o %t %ld_flags_rpath_exe
// Check that without suppressions, we catch the issue.
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index 75032d6b9..1059f393a 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -229,6 +229,15 @@ config.suffixes = ['.c', '.cc', '.cpp']
if config.host_os == 'Darwin':
config.suffixes.append('.mm')
+if config.host_os == 'Windows':
+ config.substitutions.append(('%fPIC', ''))
+ config.substitutions.append(('%fPIE', ''))
+ config.substitutions.append(('%pie', ''))
+else:
+ config.substitutions.append(('%fPIC', '-fPIC'))
+ config.substitutions.append(('%fPIE', '-fPIE'))
+ config.substitutions.append(('%pie', '-pie'))
+
# Only run the tests on supported OSs.
if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']:
config.unsupported = True