1 | // Test __sanitizer_set_report_path and __sanitizer_get_report_path: |
2 | // RUN: %clangxx -O2 %s -o %t |
3 | // RUN: %run %t | FileCheck %s |
4 | |
5 | #include <assert.h> |
6 | #include <sanitizer/common_interface_defs.h> |
7 | #include <stdio.h> |
8 | #include <string.h> |
9 | |
10 | volatile int *null = 0; |
11 | |
12 | int main(int argc, char **argv) { |
13 | char buff[1000]; |
14 | sprintf(s: buff, format: "%s.report_path/report" , argv[0]); |
15 | __sanitizer_set_report_path(path: buff); |
16 | assert(strncmp(buff, __sanitizer_get_report_path(), strlen(buff)) == 0); |
17 | printf(format: "Path %s\n" , __sanitizer_get_report_path()); |
18 | } |
19 | |
20 | // CHECK: Path {{.*}}Posix/Output/sanitizer_set_report_path_test.cpp.tmp.report_path/report. |
21 | |