summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-07-11 23:20:04 +0000
committerReid Kleckner <rnk@google.com>2019-07-11 23:20:04 +0000
commit33d96a60c5d9baaa7676dfc79d4dec70bb8ba71f (patch)
tree9e8ea902b977671eaefddbf4c190a0fe712f7235
parent5ec1a38f6ce0aeca2fbd4a79cac4ef10aef061a5 (diff)
downloadcompiler-rt-33d96a60c5d9baaa7676dfc79d4dec70bb8ba71f.tar.gz
Use clang driver for libfuzzer tests on Windows
Summary: There's no real reason to use clang-cl on Windows, the clang driver works just as well. This fixes a test which uses the -O0 flag, which was recently removed from clang-cl to match MSVC, which lacks this flag. While I'm here, remove the explicit -std=c++11 flag. Previously, this flag was necessary when the default C++ standard was C++98. Now that the default is C++14, this is no longer necessary. It's problematic on Windows, because the Visual C++ standard library relies on C++14 features, and attempting to compile it with C++11 results in errors. Rather than adding logic to conditionally set the standard to C++11 only on non-Win, this flag can be removed. See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and https://reviews.llvm.org/D64506. Reviewers: morehouse, thakis Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D64587 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365841 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/fuzzer/lit.cfg.py6
-rw-r--r--test/fuzzer/windows-opt-ref.test2
2 files changed, 3 insertions, 5 deletions
diff --git a/test/fuzzer/lit.cfg.py b/test/fuzzer/lit.cfg.py
index a4d0bc08f..7066e6a1e 100644
--- a/test/fuzzer/lit.cfg.py
+++ b/test/fuzzer/lit.cfg.py
@@ -66,10 +66,8 @@ def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=False):
compiler_cmd = config.clang
extra_cmd = config.target_flags
- if is_cpp and 'windows-msvc' in config.target_triple:
- std_cmd = '--driver-mode=cl'
- elif is_cpp:
- std_cmd = '--driver-mode=g++ -std=c++11'
+ if is_cpp:
+ std_cmd = '--driver-mode=g++'
else:
std_cmd = ''
diff --git a/test/fuzzer/windows-opt-ref.test b/test/fuzzer/windows-opt-ref.test
index 1f3386d13..53c45e369 100644
--- a/test/fuzzer/windows-opt-ref.test
+++ b/test/fuzzer/windows-opt-ref.test
@@ -1,7 +1,7 @@
REQUIRES: windows
// Verify that the linker eliminating unreferenced functions (/OPT:REF) does not
// strip sancov module constructor.
-RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest /link /OPT:REF
+RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest -Wl,-OPT:REF
RUN: not %run %t-SimpleCmpTest -seed=1 -runs=100000000 2>&1 | FileCheck %s