clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
instead of CL_INVALID_BUILD_OPTIONS
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
prog.build(devs, opts);
return CL_SUCCESS;
} catch (error &e) {
+ if (e.get() == CL_INVALID_COMPILER_OPTIONS)
+ return CL_INVALID_BUILD_OPTIONS;
if (e.get() == CL_COMPILE_PROGRAM_FAILURE)
return CL_BUILD_PROGRAM_FAILURE;
return e.get();
opts_carray.data() + opts_carray.size(),
Diags);
if (!Success) {
- throw error(CL_INVALID_BUILD_OPTIONS);
+ throw error(CL_INVALID_COMPILER_OPTIONS);
}
c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
c.getHeaderSearchOpts().UseBuiltinIncludes = true;