Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/Option/SanitizerOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ llvm::SanitizerCoverageOptions swift::parseSanitizerCoverageArgValue(
} else if (StringRef(A->getValue(i)) == "trace-pc-guard") {
opts.TracePCGuard = true;
continue;
} else if (StringRef(A->getValue(i)) == "inline-8bit-counters") {
opts.Inline8bitCounters = true;
continue;
} else if (StringRef(A->getValue(i)) == "pc-table") {
opts.PCTable = true;
continue;
}

// Argument is not supported.
Expand Down
4 changes: 3 additions & 1 deletion test/Driver/sanitize_coverage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// REQUIRES: asan_runtime

// Try some options
// RUN: %swiftc_driver -driver-print-jobs -sanitize-coverage=edge,indirect-calls,trace-bb,trace-cmp,8bit-counters -sanitize=address %s | %FileCheck -check-prefix=SANCOV_EDGE_WITH_OPTIONS %s
// RUN: %swiftc_driver -driver-print-jobs -sanitize-coverage=edge,indirect-calls,trace-bb,trace-cmp,8bit-counters,inline-8bit-counters,pc-table -sanitize=address %s | %FileCheck -check-prefix=SANCOV_EDGE_WITH_OPTIONS %s

// Invalid command line arguments
// RUN: not %swiftc_driver -driver-print-jobs -sanitize-coverage=func %s 2>&1 | %FileCheck -check-prefix=SANCOV_WITHOUT_XSAN %s
Expand All @@ -16,6 +16,8 @@
// RUN: not %swiftc_driver -driver-print-jobs -sanitize=address -sanitize-coverage=trace-bb %s 2>&1 | %FileCheck -check-prefix=SANCOV_MISSING_ARG %s
// RUN: not %swiftc_driver -driver-print-jobs -sanitize=address -sanitize-coverage=trace-cmp %s 2>&1 | %FileCheck -check-prefix=SANCOV_MISSING_ARG %s
// RUN: not %swiftc_driver -driver-print-jobs -sanitize=address -sanitize-coverage=8bit-counters %s 2>&1 | %FileCheck -check-prefix=SANCOV_MISSING_ARG %s
// RUN: not %swiftc_driver -driver-print-jobs -sanitize=address -sanitize-coverage=inline-8bit-counters %s 2>&1 | %FileCheck -check-prefix=SANCOV_MISSING_ARG %s
// RUN: not %swiftc_driver -driver-print-jobs -sanitize=address -sanitize-coverage=pc-table %s 2>&1 | %FileCheck -check-prefix=SANCOV_MISSING_ARG %s

// SANCOV_FUNC: swift
// SANCOV_FUNC-DAG: -sanitize-coverage=func
Expand Down