Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,4 @@
REQUIRES: aarch64-registered-target
RUN: not sancov -print-coverage-pcs %p/../Inputs/test-linux_android_aarch64 2>&1 | FileCheck %s --check-prefix=AARCH64
AARCH64: ERROR: __sanitizer_cov* functions not found

View File

@@ -0,0 +1,5 @@
#include <stdio.h>
#include <string>
__attribute__((noinline))
void foo() { printf("foo\n"); }

View File

@@ -0,0 +1 @@
fun:bar*

View File

@@ -0,0 +1,3 @@
# this path looks like sancov/Inputs/../Inputs/ in the binary.
# Make sure it is filtered out correctly.
src:*/sancov/Inputs/test.cpp

Binary file not shown.

View File

@@ -0,0 +1 @@
854459d69fea1d05f668bfe766c77b9955f7d3f2

View File

@@ -0,0 +1,25 @@
{
"covered-points" : ["4e132b", "4e1472", "4e1520", "4e1553", "4e1586"],
"binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
"point-symbol-info" : {
"test/tools/sancov/Inputs/foo.cpp" : {
"foo()" : {
"4e178c" : "5:0"
}
},
"test/tools/sancov/Inputs/test.cpp" : {
"bar(std::string)" : {
"4e132b" : "12:0"
},
"main" : {
"4e1472" : "14:0",
"4e14c2" : "16:9",
"4e1520" : "17:5",
"4e1553" : "17:5",
"4e1586" : "17:5",
"4e1635" : "19:1",
"4e1690" : "17:5"
}
}
}
}

View File

@@ -0,0 +1,25 @@
{
"covered-points" : ["4e132b", "4e1472", "4e14c2", "4e1520", "4e1553", "4e1586", "4e178c"],
"binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
"point-symbol-info" : {
"test/tools/sancov/Inputs/foo.cpp" : {
"foo()" : {
"4e178c" : "5:0"
}
},
"test/tools/sancov/Inputs/test.cpp" : {
"bar(std::string)" : {
"4e132b" : "12:0"
},
"main" : {
"4e1472" : "14:0",
"4e14c2" : "16:9",
"4e1520" : "17:5",
"4e1553" : "17:5",
"4e1586" : "17:5",
"4e1635" : "19:1",
"4e1690" : "17:5"
}
}
}
}

View File

@@ -0,0 +1 @@
9ffac6f81b9d935988b2462b1edc86a94b5cbfc0

View File

@@ -0,0 +1 @@
3eaab93b4cfd7f52ed76c2a4f3585884be9031d8

View File

@@ -0,0 +1,19 @@
// compile & generate coverage data using:
// clang++ -g -o test-linux_x86_64 -fsanitize=address -fsanitize-coverage=bb test.cpp ../Inputs/foo.cpp
// ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 && mv test-linux_x86_64.??*.sancov test-linux_x86_64.0.sancov
// ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 1 && mv test-linux_x86_64.??*.sancov test-linux_x86_64.1.sancov
#include <stdio.h>
#include <string>
void foo();
__attribute__((noinline))
std::string bar(std::string str) { printf("bar\n"); return str; }
int main(int argc, char **argv) {
if (argc == 2)
foo();
bar("str");
printf("main\n");
}

View File

@@ -0,0 +1,26 @@
REQUIRES: x86_64-linux
RUN: sancov -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s --check-prefix=ALL
RUN: sancov -covered-functions -blacklist %p/Inputs/fun_blacklist.txt %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
RUN: sancov -covered-functions -blacklist %p/Inputs/src_blacklist.txt %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=CHECK1 %s
RUN: sancov -print-coverage-stats %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=STATS %s
RUN: sancov -print-coverage-stats -blacklist %p/Inputs/fun_blacklist.txt %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=STATS-BLIST %s
ALL: test.cpp:12 bar(std::string)
ALL: test.cpp:14 main
CHECK-NOT: test.cpp:12 bar(std::string)
CHECK: test.cpp:14 main
CHECK1-NOT: test.cpp:12 bar(std::string)
CHECK1-NOT: test.cpp:14 main
STATS: all-edges: 9
STATS: cov-edges: 7
STATS: all-functions: 3
STATS: cov-functions: 3
STATS-BLIST: all-edges: 8
STATS-BLIST: cov-edges: 6
STATS-BLIST: all-functions: 2
STATS-BLIST: cov-functions: 2

View File

@@ -0,0 +1,13 @@
REQUIRES: x86_64-linux
RUN: sancov -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
RUN: sancov -covered-functions -strip_path_prefix=Inputs/ %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck --check-prefix=STRIP_PATH %s
RUN: sancov -demangle=0 -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck --check-prefix=NO_DEMANGLE %s
CHECK: Inputs{{[/\\]}}test.cpp:12 bar(std::string)
CHECK: Inputs{{[/\\]}}test.cpp:14 main
STRIP_PATH: {{^}}test.cpp:12 bar(std::string)
STRIP_PATH: {{^}}test.cpp:14 main
NO_DEMANGLE: test.cpp:12 _Z3barSs
NO_DEMANGLE: test.cpp:14 main

View File

@@ -0,0 +1,4 @@
# These tests require a registered x86 backend.
if not 'X86' in config.root.targets:
config.unsupported = True

View File

@@ -0,0 +1,64 @@
REQUIRES: x86_64-linux
RUN: sancov -merge %p/Inputs/test-linux_x86_64.0.symcov| FileCheck --check-prefix=MERGE1 %s
RUN: sancov -merge %p/Inputs/test-linux_x86_64.0.symcov %p/Inputs/test-linux_x86_64.1.symcov| FileCheck --check-prefix=MERGE2 %s
MERGE1: {
MERGE1-NEXT: "covered-points" : ["4e132b", "4e1472", "4e1520", "4e1553", "4e1586"],
MERGE1-NEXT: "binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
MERGE1-NEXT: "point-symbol-info" : {
MERGE1-NEXT: "test/tools/sancov/Inputs/foo.cpp" : {
MERGE1-NEXT: "foo()" : {
MERGE1-NEXT: "4e178c" : "5:0"
MERGE1-NEXT: }
MERGE1-NEXT: },
MERGE1-NEXT: "test/tools/sancov/Inputs/test.cpp" : {
MERGE1-NEXT: "bar(std::string)" : {
MERGE1-NEXT: "4e132b" : "12:0"
MERGE1-NEXT: },
MERGE1-NEXT: "main" : {
MERGE1-NEXT: "4e1472" : "14:0",
MERGE1-NEXT: "4e14c2" : "16:9",
MERGE1-NEXT: "4e1520" : "17:5",
MERGE1-NEXT: "4e1553" : "17:5",
MERGE1-NEXT: "4e1586" : "17:5",
MERGE1-NEXT: "4e1635" : "19:1",
MERGE1-NEXT: "4e1690" : "17:5"
MERGE1-NEXT: }
MERGE1-NEXT: }
MERGE1-NEXT: }
MERGE1-NEXT: }
MERGE2: {
MERGE2-NEXT: "covered-points" : ["04e132b", "04e1472", "04e1520", "04e1553", "04e1586", "14e132b", "14e1472", "14e14c2", "14e1520", "14e1553", "14e1586", "14e178c"],
MERGE2-NEXT: "point-symbol-info" : {
MERGE2-NEXT: "test/tools/sancov/Inputs/foo.cpp" : {
MERGE2-NEXT: "foo()" : {
MERGE2-NEXT: "04e178c" : "5:0",
MERGE2-NEXT: "14e178c" : "5:0"
MERGE2-NEXT: }
MERGE2-NEXT: },
MERGE2-NEXT: "test/tools/sancov/Inputs/test.cpp" : {
MERGE2-NEXT: "bar(std::string)" : {
MERGE2-NEXT: "04e132b" : "12:0",
MERGE2-NEXT: "14e132b" : "12:0"
MERGE2-NEXT: },
MERGE2-NEXT: "main" : {
MERGE2-NEXT: "04e1472" : "14:0",
MERGE2-NEXT: "04e14c2" : "16:9",
MERGE2-NEXT: "04e1520" : "17:5",
MERGE2-NEXT: "04e1553" : "17:5",
MERGE2-NEXT: "04e1586" : "17:5",
MERGE2-NEXT: "04e1635" : "19:1",
MERGE2-NEXT: "04e1690" : "17:5",
MERGE2-NEXT: "14e1472" : "14:0",
MERGE2-NEXT: "14e14c2" : "16:9",
MERGE2-NEXT: "14e1520" : "17:5",
MERGE2-NEXT: "14e1553" : "17:5",
MERGE2-NEXT: "14e1586" : "17:5",
MERGE2-NEXT: "14e1635" : "19:1",
MERGE2-NEXT: "14e1690" : "17:5"
MERGE2-NEXT: }
MERGE2-NEXT: }
MERGE2-NEXT: }
MERGE2-NEXT: }

View File

@@ -0,0 +1,8 @@
REQUIRES: x86_64-linux
RUN: sancov -skip-dead-files=0 -not-covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
RUN: sancov -not-covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=CHECK1 --allow-empty %s
CHECK: Inputs{{[/\\]}}foo.cpp:5 foo()
CHECK-NOT: {{.*__sanitizer.*}}
CHECK1-NOT: {{.+}}

View File

@@ -0,0 +1,9 @@
REQUIRES: x86_64-linux
RUN: sancov -print %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
CHECK: 0x4e132b
CHECK: 0x4e1472
CHECK: 0x4e1520
CHECK: 0x4e1553
CHECK: 0x4e1586

View File

@@ -0,0 +1,60 @@
REQUIRES: x86-registered-target
RUN: sancov -print-coverage-pcs %p/Inputs/test-linux_x86_64 | FileCheck %s --check-prefix=LINUX
RUN: llvm-objdump -d %p/Inputs/test-windows_x86_64 | FileCheck %s --check-prefix=DISAS_WIN
RUN: sancov -print-coverage-pcs %p/Inputs/test-windows_x86_64 | FileCheck %s --check-prefix=WINDOWS
RUN: sancov -print-coverage-pcs %p/Inputs/test-darwin_x86_64 | FileCheck %s --check-prefix=DARWIN
LINUX: 0x4e132b
LINUX: 0x4e1472
LINUX: 0x4e14c2
LINUX: 0x4e1520
LINUX: 0x4e1553
LINUX: 0x4e1586
LINUX: 0x4e1635
LINUX: 0x4e1690
LINUX: 0x4e178c
The coverage PCs should be equal to the return address of the call minus one. A
direct call is five bytes, so the coverage PCs should be call PC plus four.
DISAS_WIN: 14000103f: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x140001043
DISAS_WIN: 140001074: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x140001078
DISAS_WIN: 1400011df: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x1400011e3
DISAS_WIN: 140001227: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x14000122b
DISAS_WIN: 14000147e: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x140001482
DISAS_WIN: 1400015b6: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x1400015ba
DISAS_WIN: 140001629: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x14000162d
DISAS_WIN: 140001664: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x140001668
DISAS_WIN: 1400016f2: {{.*}} callq {{.*}} <__sanitizer_cov>
WINDOWS: 0x1400016f6
CHECK: 0x4e132b
CHECK: 0x4e1472
CHECK: 0x4e14c2
CHECK: 0x4e1520
CHECK: 0x4e1553
CHECK: 0x4e1586
CHECK: 0x4e1635
CHECK: 0x4e1690
CHECK: 0x4e178c
DARWIN: 0x100001527
DARWIN: 0x100001668
DARWIN: 0x1000016b7
DARWIN: 0x1000016dd
DARWIN: 0x10000179d
DARWIN: 0x1000017cc
DARWIN: 0x10000189d
DARWIN: 0x1000018e0
DARWIN: 0x100001906
DARWIN: 0x1000019dc
DARWIN: 0x100001a28

Some files were not shown because too many files have changed in this diff Show More