summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@gmail.com>2014-01-06 11:26:18 +0000
committerJoey Gouly <joey.gouly@gmail.com>2014-01-06 11:26:18 +0000
commit052cd2e12e8209555048475b35ebeaed9d2250e7 (patch)
treee2bad9ff152daa5b911662c814ebd0218eacbcb8 /test/SemaOpenCL
parentb6b8aeba91194dd24baca76f9706f3808b64ba34 (diff)
[OpenCL] Produce an error if an address space is used on the return
type of a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/invalid-kernel.cl12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-kernel.cl b/test/SemaOpenCL/invalid-kernel.cl
index c12bd8414e..62991d4642 100644
--- a/test/SemaOpenCL/invalid-kernel.cl
+++ b/test/SemaOpenCL/invalid-kernel.cl
@@ -13,3 +13,15 @@ kernel void main() { // expected-error {{kernel cannot be called 'main'}}
int main() { // expected-error {{function cannot be called 'main'}}
return 0;
}
+
+int* global x(int* x) { // expected-error {{return value cannot be qualified with address space}}
+ return x + 1;
+}
+
+int* local x(int* x) { // expected-error {{return value cannot be qualified with address space}}
+ return x + 1;
+}
+
+int* constant x(int* x) { // expected-error {{return value cannot be qualified with address space}}
+ return x + 1;
+}