1
1
// Test __sanitizer_set_report_path and __sanitizer_get_report_path:
2
2
// 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
5
4
6
5
#include < sanitizer/common_interface_defs.h>
7
6
#include < stdio.h>
@@ -12,31 +11,31 @@ int main(int argc, char **argv) {
12
11
sprintf (buff, " %s.report_path/report" , argv[0 ]);
13
12
__sanitizer_set_report_path (buff);
14
13
// CHECK: {{.*}}.report_path/report.[[PID:[0-9]+]]
15
- printf ( " %s\n " , __sanitizer_get_report_path ());
14
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
16
15
17
16
strcpy (buff, " %H/foo" );
18
17
__sanitizer_set_report_path (buff);
19
18
// CHECK: [[T:.*]].homedir/foo.[[PID]]
20
- printf ( " %s\n " , __sanitizer_get_report_path ());
19
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
21
20
22
21
strcpy (buff, " %t/foo" );
23
22
__sanitizer_set_report_path (buff);
24
23
// CHECK: [[T]].tmpdir/foo.[[PID]]
25
- printf ( " %s\n " , __sanitizer_get_report_path ());
24
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
26
25
27
26
strcpy (buff, " %H/%p/%%foo" );
28
27
__sanitizer_set_report_path (buff);
29
28
// CHECK: [[T]].homedir/[[PID]]/%foo.[[PID]]
30
- printf ( " %s\n " , __sanitizer_get_report_path ());
29
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
31
30
32
31
strcpy (buff, " %%foo%%bar" );
33
32
__sanitizer_set_report_path (buff);
34
33
// CHECK: %foo%bar.[[PID]]
35
- printf ( " %s\n " , __sanitizer_get_report_path ());
34
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
36
35
37
36
strcpy (buff, " %%foo%ba%%r" );
38
37
__sanitizer_set_report_path (buff);
39
- // ERROR : Unexpected pattern: %%foo%ba%%r
38
+ // CHECK : Unexpected pattern: %%foo%ba%%r
40
39
// CHECK: %%foo%ba%%r.[[PID]]
41
- printf ( " %s\n " , __sanitizer_get_report_path ());
40
+ fprintf (stderr, " %s\n " , __sanitizer_get_report_path ());
42
41
}
0 commit comments