Skip to content

Commit b022714

Browse files
author
git apple-llvm automerger
committed
Merge commit '986f519d1f76' from llvm.org/main into next
2 parents 2ba291b + 986f519 commit b022714

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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

Comments
 (0)