diff options
author | Sergey Matveev <earthdok@google.com> | 2015-05-08 16:30:01 +0000 |
---|---|---|
committer | Sergey Matveev <earthdok@google.com> | 2015-05-08 16:30:01 +0000 |
commit | 42cc8fa592fa7b56cee11ae70bd66fd3e28c3cfc (patch) | |
tree | 1d43684bd71d99608620ad1e7ee6f9eef657fedd | |
parent | df43e6862918eba86dd8b608bc2ae202225092dc (diff) | |
download | bcm5719-llvm-42cc8fa592fa7b56cee11ae70bd66fd3e28c3cfc.tar.gz bcm5719-llvm-42cc8fa592fa7b56cee11ae70bd66fd3e28c3cfc.zip |
[sanitizer] Attempt to fix the test for missing coverage script.
llvm-svn: 236877
-rw-r--r-- | compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc index 7ca92bd6d15..eb5f86b4304 100644 --- a/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc +++ b/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc @@ -2,9 +2,7 @@ // RUN: ASAN_OPTIONS=coverage=1:coverage_dir=%T/coverage-missing -// First case: coverage from executable. main() is called on every code path; -// other than that, the foo and bar code paths are complementary in terms of -// PCs covered. +// First case: coverage from executable. main() is called on every code path. // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -DFOOBAR -DMAIN // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing @@ -23,9 +21,12 @@ // RUN: [ $(cat bar.txt | wc -l) == 4 ] // RUN: %sancov missing %t < foo.txt > foo-missing.txt // RUN: sort main.txt foo-missing.txt -o foo-missing-with-main.txt -// RUN: diff bar.txt foo-missing-with-main.txt +// The "missing from foo" set may contain a few bogus PCs from the sanitizer +// runtime, but it must include the entire "bar" code path as a subset. Sorted +// lists can be tested for set inclusion with diff + grep. +// RUN: diff bar.txt foo-missing-with-main.txt | not grep "^<" -// Second case: coverage from DSO. Strictly complementary code paths. +// Second case: coverage from DSO. // cd %T // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %dynamiclib -DFOOBAR -shared -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s %dynamiclib -o %t -DMAIN @@ -42,7 +43,7 @@ // RUN: rm *.sancov // RUN: [ $(cat bar.txt | wc -l) == 3 ] // RUN: %sancov missing %dynamiclib < foo.txt > foo-missing.txt -// RUN: diff bar.txt foo-missing.txt +// RUN: diff bar.txt foo-missing.txt | not grep "^<" // REQUIRES: x86_64-supported-target, i386-supported-target // XFAIL: android |