yaxunl created this revision. yaxunl added reviewers: tra, ashi1. Herald added subscribers: t-tye, tpr, dstuttard, kzhuravl. yaxunl requested review of this revision. Herald added a subscriber: wdng.
Currently AMDGPU does not support sanitizer. Disable sanitizer options for now until they are supported. 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.
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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits