aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-03-11 12:38:45 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-03-11 12:38:45 +0000
commit44abff72d800d2895c04ccb7f9240a60c90dd7e4 (patch)
tree9a70966ad82704ce62f6b7e20f01f2aa824579ca
parent3521c49fc4867ff9ac78d4ad6a9e3e5566ba8b83 (diff)
Add a test case for the 'vec_type_hint' attribute that was introduced in
r176686. I missed this file in the previous commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176803 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaOpenCL/invalid-kernel-attrs.cl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-kernel-attrs.cl b/test/SemaOpenCL/invalid-kernel-attrs.cl
new file mode 100644
index 0000000000..d242eaf692
--- /dev/null
+++ b/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -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}}
+