Clang and OpenCL - Possible bug?!?


I downloaded LLVM 3.3 with clang support from, and installed it on my machine. I also installed the opencl header files.

I’m attempting to compile a simple program as follows:
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#include <CL/cl.h>
/* Test kernel */
__kernel void test(__global float *in, __global float *out) {
int index = get_global_id(0);
out[index] = 3.14159f * in[index] + in[index];

I’m compiling it with: clang -I/usr/include/CL -std=CL1.2 -x cl -o test.ll

but I get the following error:

OpenCL/build/Release+Asserts/bin/…/lib/clang/3.3/include/emmintrin.h:1355:48: error:
too few elements in vector initialization (expected 2
elements, have 1)
return __builtin_shufflevector(__a, (__m128i){ 0 }, 0, 2);

I’m uncertain how to fix it. The error is coming from clang header files. The file is parsed correctly in C.

My goal is to compile a opencl program with clang with LLVM to get the SPIR. The target processor is a microblaze (mblaze).

Any help would be appreciated to solve this issue. Thanks,