summaryrefslogtreecommitdiff
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:46 +0000
commitb5aee35cc5d62f11d98539f62e4fe63f0ac9edc6 (patch)
tree3e6ab962dbc73cfe1445a60d2eb4dfba7c939a22 /test/SemaOpenCL
parentaa803409c3bd3930126db630c29f63d42f255153 (diff)
Notes
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/invalid-pipes-cl2.0.cl5
-rw-r--r--test/SemaOpenCL/vector_literals_invalid.cl3
2 files changed, 7 insertions, 1 deletions
diff --git a/test/SemaOpenCL/invalid-pipes-cl2.0.cl b/test/SemaOpenCL/invalid-pipes-cl2.0.cl
index 5db953108bef6..a50811650d2c7 100644
--- a/test/SemaOpenCL/invalid-pipes-cl2.0.cl
+++ b/test/SemaOpenCL/invalid-pipes-cl2.0.cl
@@ -3,6 +3,11 @@
global pipe int gp; // expected-error {{type '__global read_only pipe int' can only be used as a function parameter in OpenCL}}
global reserve_id_t rid; // expected-error {{the '__global reserve_id_t' type cannot be used to declare a program scope variable}}
+extern pipe write_only int get_pipe(); // expected-error {{type '__global write_only pipe int ()' can only be used as a function parameter in OpenCL}}
+
+kernel void test_invalid_reserved_id(reserve_id_t ID) { // expected-error {{'reserve_id_t' cannot be used as the type of a kernel parameter}}
+}
+
void test1(pipe int *p) {// expected-error {{pipes packet types cannot be of reference type}}
}
void test2(pipe p) {// expected-error {{missing actual type specifier for pipe}}
diff --git a/test/SemaOpenCL/vector_literals_invalid.cl b/test/SemaOpenCL/vector_literals_invalid.cl
index e4e23cd85f009..4e502aad3bada 100644
--- a/test/SemaOpenCL/vector_literals_invalid.cl
+++ b/test/SemaOpenCL/vector_literals_invalid.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify %s
typedef __attribute__(( ext_vector_type(4) )) float float4;
typedef __attribute__(( ext_vector_type(4) )) int int4;
@@ -10,4 +10,5 @@ void vector_literals_invalid()
int4 b = (int4)(1,2,3,4,5); // expected-error{{excess elements in vector}}
((float4)(1.0f))++; // expected-error{{cannot increment value of type 'float4'}}
int8 d = (int8)(a,(float4)(1)); // expected-error{{initializing 'int' with an expression of incompatible type 'float4'}}
+ ((int4)(0)).x = 8; // expected-error{{expression is not assignable}}
}