aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/sanitizer_flags_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/sanitizer_flags_test.go')
-rw-r--r--compiler_wrapper/sanitizer_flags_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler_wrapper/sanitizer_flags_test.go b/compiler_wrapper/sanitizer_flags_test.go
index 741f7732..8f50a900 100644
--- a/compiler_wrapper/sanitizer_flags_test.go
+++ b/compiler_wrapper/sanitizer_flags_test.go
@@ -119,3 +119,34 @@ func TestOmitFuzzerFlagsForGcc(t *testing.T) {
}
})
}
+
+func TestAddSanitizerCoverageFlagsForClang(t *testing.T) {
+ withTestContext(t, func(ctx *testContext) {
+ cmd := ctx.must(callCompiler(ctx, ctx.cfg,
+ ctx.newCommand(clangX86_64, "-fsanitize=address", "-fprofile-instr-generate", mainCc)))
+ if err := verifyArgOrder(cmd, "-fno-experimental-new-pass-manager",
+ "-fsanitize=address", "-fprofile-instr-generate", mainCc); err != nil {
+ t.Error(err)
+ }
+ })
+}
+
+func TestOmitSanitizerCoverageFlagsForClang(t *testing.T) {
+ withTestContext(t, func(ctx *testContext) {
+ cmd := ctx.must(callCompiler(ctx, ctx.cfg,
+ ctx.newCommand(clangX86_64, "-fsanitize=address", mainCc)))
+ if err := verifyArgCount(cmd, 0, "-fno-experimental-new-pass-manager"); err != nil {
+ t.Error(err)
+ }
+ })
+}
+
+func TestKeepSanitizerCoverageFlagsForClang(t *testing.T) {
+ withTestContext(t, func(ctx *testContext) {
+ cmd := ctx.must(callCompiler(ctx, ctx.cfg,
+ ctx.newCommand(clangX86_64, "-fprofile-instr-generate", mainCc)))
+ if err := verifyArgCount(cmd, 0, "-fno-experimental-new-pass-manager"); err != nil {
+ t.Error(err)
+ }
+ })
+}