[Piglit] [PATCH 2/2] cl/api/build-program: Add a test with an empty program

Tom Stellard tom at stellard.net
Fri Jun 14 15:51:02 PDT 2013


From: Tom Stellard <thomas.stellard at amd.com>

---
 tests/cl/api/build-program.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/cl/api/build-program.c b/tests/cl/api/build-program.c
index 89bca06..4e23cc4 100644
--- a/tests/cl/api/build-program.c
+++ b/tests/cl/api/build-program.c
@@ -57,6 +57,10 @@ const char* invalid_strings[] = {
 	"kernel void dummy_kernel {}", // missing brackets intentionaly
 };
 
+const char* empty_strings[] = {
+	""
+};
+
 static bool
 test(cl_program program,
      cl_uint num_devices,
@@ -245,6 +249,22 @@ piglit_cl_test(const int argc,
 	}
 
 	/*
+	 * CL_SUCCESS when compiling an empty string
+	 */
+	temp_program = clCreateProgramWithSource(env->context->cl_ctx,
+	                                         1,
+	                                         empty_strings,
+	                                         NULL,
+	                                         &errNo);
+	if(piglit_cl_check_error(errNo, CL_SUCCESS)) {
+		test(temp_program, env->context->num_devices, env->context->device_ids,
+		     "", NULL, NULL,
+		     CL_SUCCESS, &result,
+		     "CL_SUCCESS when compiling an empty string.");
+		clReleaseProgram(temp_program);
+	}
+
+	/*
 	 * CL_INVALID_OPERATION if program was not created with
 	 * clCreateProgramWithSource or clCreateProgramWithBinary.
 	 *
-- 
1.7.11.4



More information about the Piglit mailing list