SWDEV-232428 - Fix hipPrintSpecifiers test failure on Windows

The following snippets has different behaviour based on platform.

printf("%p", 0x123abc);
Linux   -> 0x123abc
Windows -> 123ABC

printf("%p", nullptr);
Linux   -> (nil)
Windows -> 0000000000000000

%p specifier according to C spec is implementation defined, so we need
to adjust the reference string to be correct on Windows.

Change-Id: I7059fa0f6cde611718bd76655637670fcbccf43c
Этот коммит содержится в:
Vladislav Sytchenko
2021-03-07 16:52:42 -05:00
родитель 84f8785288
Коммит 1c08fb58d0
+23
Просмотреть файл
@@ -58,6 +58,7 @@ __global__ void test_kernel() {
}
int main(int argc, char **argv) {
#if !defined(_WIN32)
std::string reference(R"here(xyzzy
%
hello % world
@@ -78,6 +79,28 @@ x
(nil)
3.14159000 hello 0xf01dab1eca55e77e
)here");
#else
std::string reference(R"here(xyzzy
%
hello % world
%s
%sF01DAB1ECA55E77E
%cxyzzy
sep
-42
42
123.456000
-123.456000
-1.234560e+02
1.234560E+02
123.456
-123.456
x
0000000000000000
3.14159000 hello F01DAB1ECA55E77E
)here");
#endif
CaptureStream captured(stdout);
hipLaunchKernelGGL(test_kernel, dim3(1), dim3(1), 0, 0);