diff options
Diffstat (limited to 'misc/cgo/testsanitizers/cc_test.go')
-rw-r--r-- | misc/cgo/testsanitizers/cc_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/misc/cgo/testsanitizers/cc_test.go b/misc/cgo/testsanitizers/cc_test.go index 05b77932b4c..ee3c3bf28cc 100644 --- a/misc/cgo/testsanitizers/cc_test.go +++ b/misc/cgo/testsanitizers/cc_test.go @@ -235,6 +235,22 @@ func compilerSupportsLocation() bool { } } +// compilerRequiredAsanVersion reports whether the compiler is the version required by Asan. +func compilerRequiredAsanVersion() bool { + compiler, err := compilerVersion() + if err != nil { + return false + } + switch compiler.name { + case "gcc": + return compiler.major >= 7 + case "clang": + return true + default: + return false + } +} + type compilerCheck struct { once sync.Once err error |