diff options
Diffstat (limited to 'compiler_wrapper/sanitizer_flags_test.go')
-rw-r--r-- | compiler_wrapper/sanitizer_flags_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler_wrapper/sanitizer_flags_test.go b/compiler_wrapper/sanitizer_flags_test.go index a401d58e..741f7732 100644 --- a/compiler_wrapper/sanitizer_flags_test.go +++ b/compiler_wrapper/sanitizer_flags_test.go @@ -98,3 +98,24 @@ func TestKeepSanitizerFlagsIfSanitizeGivenInCommonFlags(t *testing.T) { } }) } + +func TestAddFuzzerFlagsForClang(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(clangX86_64, "-fsanitize=fuzzer", mainCc))) + if err := verifyArgOrder(cmd, "-fno-experimental-new-pass-manager", + "-fsanitize=fuzzer", mainCc); err != nil { + t.Error(err) + } + }) +} + +func TestOmitFuzzerFlagsForGcc(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(gccX86_64, "-fsanitize=fuzzer", mainCc))) + if err := verifyArgCount(cmd, 0, "-fno-experimental-new-pass-manager"); err != nil { + t.Error(err) + } + }) +} |