From 78ce37e169b3e2da53b96bb3608c6f041dc4dd56 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Sat, 4 Mar 2017 01:22:00 +0100 Subject: [PATCH 1/1] Add OpenCL mime-type https://bugs.freedesktop.org/show_bug.cgi?id=26913 --- freedesktop.org.xml.in | 7 +++++++ tests/list | 3 +++ tests/test.cl | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tests/test.cl diff --git a/freedesktop.org.xml.in b/freedesktop.org.xml.in index f03af62..05d3bc3 100644 --- a/freedesktop.org.xml.in +++ b/freedesktop.org.xml.in @@ -5937,6 +5937,13 @@ command to generate the output files. + + <_comment>OpenCL source code + OpenCL + Open Computing Language + + + <_comment>MATLAB script/function diff --git a/tests/list b/tests/list index e41f533..ef94470 100644 --- a/tests/list +++ b/tests/list @@ -285,6 +285,9 @@ test.mo text/x-modelica xoo bibtex.bib text/x-bibtex # hand-made simple-obj-c.m text/x-objcsrc +# Copied from LLVM project test suite +test.cl text/x-openclsrc ox + # http://www.apps.ietf.org/rfc/rfc4716.html#sec-3.6 ssh-public-key.txt text/plain # http://tools.ietf.org/html/draft-ietf-vcarddav-vcardrev-22 diff --git a/tests/test.cl b/tests/test.cl new file mode 100644 index 0000000..f15bc74 --- /dev/null +++ b/tests/test.cl @@ -0,0 +1,24 @@ +// RUN: c-index-test -test-print-type %s | FileCheck %s + +#pragma OPENCL EXTENSION cl_khr_fp16 : enable +#pragma OPENCL EXTENSION cl_khr_fp64 : enable + +typedef half half4 __attribute__((ext_vector_type(4))); +typedef float float4 __attribute__((ext_vector_type(4))); +typedef double double4 __attribute__((ext_vector_type(4))); + +void kernel testFloatTypes() { + half scalarHalf; + half4 vectorHalf; + float scalarFloat; + float4 vectorFloat; + double scalarDouble; + double4 vectorDouble; +} + +// CHECK: VarDecl=scalarHalf:11:8 (Definition) [type=half] [typekind=Half] [isPOD=1] +// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=half4] [typekind=Typedef] [canonicaltype=half __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1] +// CHECK: VarDecl=scalarFloat:13:9 (Definition) [type=float] [typekind=Float] [isPOD=1] +// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=float4] [typekind=Typedef] [canonicaltype=float __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1] +// CHECK: VarDecl=scalarDouble:15:10 (Definition) [type=double] [typekind=Double] [isPOD=1] +// CHECK: VarDecl=vectorDouble:16:11 (Definition) [type=double4] [typekind=Typedef] [canonicaltype=double __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1] -- 2.9.3