141/143 Test #85: regression/struct_kernel_arguments ..................................................***Failed Error regular expression found in output. Regex=[FAIL] 4.58 sec
CMake Error at /build/pocl-1.4/cmake/run_test.cmake:34 (message):
FAIL: Test exited with nonzero code (1):
/build/pocl-1.4/obj-i686-linux-gnu/tests/regression/test_structs_as_args
STDOUT:
F(4: 0 != 5) F(5: -
2147483648 != 6) F(6: 0 != 7) F(7: 0 != 8)
STDERR:
-- OK
on i386, the default alignment is 4 for 64-bit types, too
the OpenCL standard is only explicit about alignment requirements for
OpenCL types, but not for the corresponding cl_* types in C
https://github.com/KhronosGroup/OpenCL-Headers/issues/149
fixes: #801
Gbp-Pq: Name 0003-fix-test_structs_as_args-on-i386.patch
cl_long b;\r
};\r
\r
+// i386 has a default alignment of 4 even for 64-bit types\r
+#ifdef __i386__\r
+#define CL_LONG_ALIGNMENT __attribute__((aligned(8)))\r
+#else\r
+#define CL_LONG_ALIGNMENT\r
+#endif\r
+\r
struct test_struct {\r
cl_int elementA;\r
cl_int elementB;\r
- cl_long elementC;\r
+ cl_long elementC CL_LONG_ALIGNMENT;\r
cl_char elementD;\r
- cl_long elementE;\r
+ cl_long elementE CL_LONG_ALIGNMENT;\r
cl_float elementF;\r
cl_short elementG;\r
- cl_long elementH;\r
+ cl_long elementH CL_LONG_ALIGNMENT;\r
};\r
\r
+#undef CL_LONG_ALIGNMENT\r
+\r
static char\r
kernelSourceCode[] = \r
"typedef struct int_single {\n"\r