summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-07-26 18:23:40 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-07-26 18:23:40 +0000
commit710b27eea2a6c005917d68a51f44c3e8aa1cf36d (patch)
treed008866f64fcd8318cddd28ecbaab353cc7cd5fa
parenta202b556cf98e61d2c86f91946430b7b32d2b09e (diff)
[test] Use printf instead of C++ iostream, NFC.
This test fails with libc++ when built with MemorySanitizer. This is because we link to an uninstrumented version of the library so msan detects a nested error when calling std::cout << "...". This can be easily avoided by using good old printf. Differential Revision: https://reviews.llvm.org/D49867 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@338053 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/ubsan/TestCases/Misc/monitor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ubsan/TestCases/Misc/monitor.cpp b/test/ubsan/TestCases/Misc/monitor.cpp
index 806e0ee9e..6c5cacfed 100644
--- a/test/ubsan/TestCases/Misc/monitor.cpp
+++ b/test/ubsan/TestCases/Misc/monitor.cpp
@@ -8,7 +8,7 @@
// Linkage issue
// XFAIL: openbsd
-#include <iostream>
+#include <cstdio>
extern "C" {
void __ubsan_get_current_report_data(const char **OutIssueKind,
@@ -26,9 +26,9 @@ void __ubsan_on_report(void) {
__ubsan_get_current_report_data(&IssueKind, &Message, &Filename, &Line, &Col,
&Addr);
- std::cout << "Issue: " << IssueKind << "\n"
- << "Location: " << Filename << ":" << Line << ":" << Col << "\n"
- << "Message: " << Message << std::endl;
+ printf("Issue: %s\n", IssueKind);
+ printf("Location: %s:%u:%u\n", Filename, Line, Col);
+ printf("Message: %s\n", Message);
(void)Addr;
}