Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / tools / sancov / Inputs / test.cpp
bloba14b4cb93b00999063506cc67c262b1ebbadf63c
1 // compile & generate coverage data using:
2 // clang++ -g -o test-linux_x86_64 -fsanitize=address -fsanitize-coverage=bb test.cpp ../Inputs/foo.cpp
3 // ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 && mv test-linux_x86_64.??*.sancov test-linux_x86_64.0.sancov
4 // ASAN_OPTIONS="coverage=1" ./test-linux_x86_64 1 && mv test-linux_x86_64.??*.sancov test-linux_x86_64.1.sancov
6 #include <stdio.h>
7 #include <string>
9 void foo();
11 __attribute__((noinline))
12 std::string bar(std::string str) { printf("bar\n"); return str; }
14 int main(int argc, char **argv) {
15 if (argc == 2)
16 foo();
17 bar("str");
18 printf("main\n");