11// Test __sanitizer_set_report_path and __sanitizer_get_report_path:
22// RUN: %clangxx -O2 %s -o %t
3- // RUN: %env HOME=%t.homedir TMPDIR=%t.tmpdir %run %t 2>%t.err | FileCheck %s
4- // RUN: FileCheck %s --input-file=%t.err --check-prefix=ERROR
3+ // RUN: %env HOME=%t.homedir TMPDIR=%t.tmpdir %run %t 2>&1 | FileCheck %s
54
65#include < sanitizer/common_interface_defs.h>
76#include < stdio.h>
@@ -12,31 +11,31 @@ int main(int argc, char **argv) {
1211 sprintf (buff, " %s.report_path/report" , argv[0 ]);
1312 __sanitizer_set_report_path (buff);
1413 // CHECK: {{.*}}.report_path/report.[[PID:[0-9]+]]
15- printf ( " %s\n " , __sanitizer_get_report_path ());
14+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
1615
1716 strcpy (buff, " %H/foo" );
1817 __sanitizer_set_report_path (buff);
1918 // CHECK: [[T:.*]].homedir/foo.[[PID]]
20- printf ( " %s\n " , __sanitizer_get_report_path ());
19+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
2120
2221 strcpy (buff, " %t/foo" );
2322 __sanitizer_set_report_path (buff);
2423 // CHECK: [[T]].tmpdir/foo.[[PID]]
25- printf ( " %s\n " , __sanitizer_get_report_path ());
24+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
2625
2726 strcpy (buff, " %H/%p/%%foo" );
2827 __sanitizer_set_report_path (buff);
2928 // CHECK: [[T]].homedir/[[PID]]/%foo.[[PID]]
30- printf ( " %s\n " , __sanitizer_get_report_path ());
29+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
3130
3231 strcpy (buff, " %%foo%%bar" );
3332 __sanitizer_set_report_path (buff);
3433 // CHECK: %foo%bar.[[PID]]
35- printf ( " %s\n " , __sanitizer_get_report_path ());
34+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
3635
3736 strcpy (buff, " %%foo%ba%%r" );
3837 __sanitizer_set_report_path (buff);
39- // ERROR : Unexpected pattern: %%foo%ba%%r
38+ // CHECK : Unexpected pattern: %%foo%ba%%r
4039 // CHECK: %%foo%ba%%r.[[PID]]
41- printf ( " %s\n " , __sanitizer_get_report_path ());
40+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
4241}
0 commit comments