r176803 - Add a test case for the 'vec_type_hint' attribute that was introduced in
Joey Gouly
joey.gouly at arm.com
Mon Mar 11 05:38:45 PDT 2013
Author: joey
Date: Mon Mar 11 07:38:45 2013
New Revision: 176803
URL: http://llvm.org/viewvc/llvm-project?rev=176803&view=rev
Log:
Add a test case for the 'vec_type_hint' attribute that was introduced in
r176686. I missed this file in the previous commit.
Added:
cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl
Added: cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl?rev=176803&view=auto
==============================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl (added)
+++ cfe/trunk/test/SemaOpenCL/invalid-kernel-attrs.cl Mon Mar 11 07:38:45 2013
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -verify %s
+
+kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{attribute takes one argument}}
+
+kernel __attribute__((vec_type_hint(not_type))) void kernel2() {} //expected-error{{unknown type name 'not_type'}}
+
+kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{invalid attribute argument 'void' - expecting a vector or vectorizable scalar type}}
+
+kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{invalid attribute argument 'bool' - expecting a vector or vectorizable scalar type}}
+
+kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}}
+
+kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{attribute requires exactly 3 arguments}}
+
+kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different parameters}}
+
More information about the cfe-commits
mailing list