Add pointer format test for Windows.
llvm-svn: 186472
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: fee09c68a04e087e7aa335b57f75a9270212772f
diff --git a/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp b/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
index fe420a5..114bba9 100644
--- a/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
+++ b/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
@@ -63,8 +63,14 @@
std::ostream os(&sb);
const void* n = 0;
os << n;
- assert(sb.str() == "0x0" || sb.str() == "(nil)");
assert(os.good());
+ // %p is implementation defined.
+ // On some platforms (Windows), it's a hex number without
+ // any leading 0x like prefix.
+ // In that format, we assume a null pointer will yield 2 '0' hex digits
+ // for each 8 bits of address space.
+ assert(sb.str() == "0x0" || sb.str() == "(nil)" ||
+ sb.str() == std::string(sizeof(void*)*2,'0'));
}
{
testbuf<char> sb;