diff options
-rw-r--r-- | clang/lib/Driver/ToolChains/Solaris.cpp | 3 | ||||
-rw-r--r-- | clang/test/Driver/fsanitize.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp index 38f24d4cf7e..86b9ba9542f 100644 --- a/clang/lib/Driver/ToolChains/Solaris.cpp +++ b/clang/lib/Driver/ToolChains/Solaris.cpp @@ -177,6 +177,7 @@ Solaris::Solaris(const Driver &D, const llvm::Triple &Triple, SanitizerMask Solaris::getSupportedSanitizers() const { const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; SanitizerMask Res = ToolChain::getSupportedSanitizers(); // FIXME: Omit X86_64 until 64-bit support is figured out. if (IsX86) { @@ -184,6 +185,8 @@ SanitizerMask Solaris::getSupportedSanitizers() const { Res |= SanitizerKind::PointerCompare; Res |= SanitizerKind::PointerSubtract; } + if (IsX86 || IsX86_64) + Res |= SanitizerKind::Function; Res |= SanitizerKind::Vptr; return Res; } diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c index 2896eda5aaa..9a2a3836d15 100644 --- a/clang/test/Driver/fsanitize.c +++ b/clang/test/Driver/fsanitize.c @@ -727,6 +727,9 @@ // RUN: %clang -target x86_64--netbsd -fsanitize=scudo %s -### 2>&1 | FileCheck %s -check-prefix=SCUDO-NETBSD // SCUDO-NETBSD: "-fsanitize=scudo" +// RUN: %clang -target i386--solaris -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-SOLARIS +// RUN: %clang -target x86_64--solaris -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-SOLARIS +// FUNCTION-SOLARIS: "-fsanitize=function" // RUN: %clang -target x86_64-scei-ps4 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-PS4 |