diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-05-28 19:09:01 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-05-28 19:09:01 +0000 |
commit | df03e52a20e3e9f34d23cdb6ec7974e71fcb2ecc (patch) | |
tree | 7905b301caf582293063f2c830122257eda0c38e /test/Headers | |
parent | 41bc58970d3932766ac6bb239a0c74f8773930ad (diff) |
[OpenCL] Add the default header file opencl-c.h for OpenCL C language
OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed.
This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring.
Differential Revision: http://reviews.llvm.org/D18369
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Headers')
-rw-r--r-- | test/Headers/opencl-c-header.cl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Headers/opencl-c-header.cl b/test/Headers/opencl-c-header.cl new file mode 100644 index 0000000000..4697505e46 --- /dev/null +++ b/test/Headers/opencl-c-header.cl @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -cl-std=CL1.1| FileCheck %s +// RUN: %clang_cc1 -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -cl-std=CL1.2| FileCheck %s +// RUN: %clang_cc1 -internal-isystem ../../lib/Headers -include opencl-c.h -fblocks -emit-llvm -o - %s -cl-std=CL2.0| FileCheck %s + +// CHECK: _Z16convert_char_rtec +char f(char x) { + return convert_char_rte(x); +} |