[PATCH] D87461: Disable sanitizer options for AMDGPU
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 10 12:41:43 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4934127e627d: Diable sanitizer options for amdgpu (authored by yaxunl).
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87461/new/
https://reviews.llvm.org/D87461
Files:
clang/lib/Driver/SanitizerArgs.cpp
clang/test/Driver/hip-sanitize-options.hip
Index: clang/test/Driver/hip-sanitize-options.hip
===================================================================
--- /dev/null
+++ clang/test/Driver/hip-sanitize-options.hip
@@ -0,0 +1,9 @@
+// REQUIRES: clang-driver, x86-registered-target, amdgpu-registered-target
+
+// RUN: %clang -### -target x86_64-unknown-linux-gnu --offload-arch=gfx906 \
+// RUN: -fsanitize=address \
+// RUN: -nogpuinc -nogpulib \
+// RUN: %s 2>&1 | FileCheck %s
+
+// CHECK-NOT: {{"[^"]*clang[^"]*".* "-fcuda-is-device".* "-fsanitize=address"}}
+// CHECK: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
Index: clang/lib/Driver/SanitizerArgs.cpp
===================================================================
--- clang/lib/Driver/SanitizerArgs.cpp
+++ clang/lib/Driver/SanitizerArgs.cpp
@@ -929,10 +929,10 @@
void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs,
types::ID InputType) const {
- // NVPTX doesn't currently support sanitizers. Bailing out here means that
- // e.g. -fsanitize=address applies only to host code, which is what we want
- // for now.
- if (TC.getTriple().isNVPTX())
+ // NVPTX/AMDGPU doesn't currently support sanitizers. Bailing out here means
+ // that e.g. -fsanitize=address applies only to host code, which is what we
+ // want for now.
+ if (TC.getTriple().isNVPTX() || TC.getTriple().isAMDGPU())
return;
// Translate available CoverageFeatures to corresponding clang-cc1 flags.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87461.291067.patch
Type: text/x-patch
Size: 1582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200910/2fa4a5a4/attachment.bin>
More information about the cfe-commits
mailing list