mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-24 05:23:45 +02:00
27db5e9a0c
Differential Revision: http://reviews.llvm.org/D19395 llvm-svn: 267078
20 lines
624 B
C++
20 lines
624 B
C++
// 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");
|
|
}
|