summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/ubsan
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
commita7c9fe3762de3701bf6aea68fec382a046288353 (patch)
treeb1fd67fe9ef527c6955536e37f5abe6346459859 /compiler-rt/test/ubsan
parent3a0e9b37f3b592722b39d867404e62bf45bb786b (diff)
downloadbcm5719-llvm-a7c9fe3762de3701bf6aea68fec382a046288353.tar.gz
bcm5719-llvm-a7c9fe3762de3701bf6aea68fec382a046288353.zip
[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 llvm-svn: 338053
Diffstat (limited to 'compiler-rt/test/ubsan')
-rw-r--r--compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp b/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
index 806e0ee9e41..6c5cacfed8b 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
+++ b/compiler-rt/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;
}
OpenPOWER on IntegriCloud