1*7c3d14c8STreehugger Robot // RUN: rm -rf %T/coverage-basic 2*7c3d14c8STreehugger Robot // RUN: mkdir %T/coverage-basic && cd %T/coverage-basic 3*7c3d14c8STreehugger Robot // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe 4*7c3d14c8STreehugger Robot // RUN: %env_asan_opts=coverage=1 %run ./test.exe 5*7c3d14c8STreehugger Robot // 6*7c3d14c8STreehugger Robot // RUN: %sancov print *.sancov | FileCheck %s 7*7c3d14c8STreehugger Robot #include <stdio.h> 8*7c3d14c8STreehugger Robot foo()9*7c3d14c8STreehugger Robotvoid foo() { fputs("FOO", stderr); } bar()10*7c3d14c8STreehugger Robotvoid bar() { fputs("BAR", stderr); } 11*7c3d14c8STreehugger Robot main(int argc,char ** argv)12*7c3d14c8STreehugger Robotint main(int argc, char **argv) { 13*7c3d14c8STreehugger Robot if (argc == 2) { 14*7c3d14c8STreehugger Robot foo(); 15*7c3d14c8STreehugger Robot bar(); 16*7c3d14c8STreehugger Robot } else { 17*7c3d14c8STreehugger Robot bar(); 18*7c3d14c8STreehugger Robot foo(); 19*7c3d14c8STreehugger Robot } 20*7c3d14c8STreehugger Robot } 21*7c3d14c8STreehugger Robot 22*7c3d14c8STreehugger Robot // CHECK: 0x{{[0-9a-f]*}} 23*7c3d14c8STreehugger Robot // CHECK: 0x{{[0-9a-f]*}} 24*7c3d14c8STreehugger Robot // CHECK: 0x{{[0-9a-f]*}} 25*7c3d14c8STreehugger Robot // CHECK-NOT: 0x{{[0-9a-f]*}} 26