Skip to content

Commit c54b30a

Browse files
pschuhcheshire
authored andcommitted
Update coverage options for fuzzing to match clang (swiftlang#26156)
1 parent eb9b241 commit c54b30a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,9 +1130,14 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
11301130

11311131
// Automatically set coverage flags, unless coverage type was explicitly
11321132
// requested.
1133+
// Updated to match clang at Jul 2019.
11331134
Opts.SanitizeCoverage.IndirectCalls = true;
11341135
Opts.SanitizeCoverage.TraceCmp = true;
1135-
Opts.SanitizeCoverage.TracePCGuard = true;
1136+
Opts.SanitizeCoverage.PCTable = true;
1137+
if (Triple.isOSLinux()) {
1138+
Opts.SanitizeCoverage.StackDepth = true;
1139+
}
1140+
Opts.SanitizeCoverage.Inline8bitCounters = true;
11361141
Opts.SanitizeCoverage.CoverageType = llvm::SanitizerCoverageOptions::SCK_Edge;
11371142
}
11381143

test/IRGen/sanitize_coverage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ test()
3939
// FIXME: We need a way to distinguish the different types of coverage instrumentation
4040
// that isn't really fragile. For now just check there's at least one call to the function
4141
// used to increment coverage count at a particular PC.
42-
// SANCOV: call void @__sanitizer_cov
43-
4442
// SANCOV_TRACE_CMP: call void @__sanitizer_cov_trace_cmp
43+
44+
// SANCOV: call void @__sanitizer_cov

0 commit comments

Comments
 (0)