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
Dieser Commit ist enthalten in:
@@ -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);
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren