diff options
author | Joey Gouly <joey.gouly@gmail.com> | 2014-01-06 11:26:18 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@gmail.com> | 2014-01-06 11:26:18 +0000 |
commit | 16cb99dd15834bcc0c857e0bbfb1c9b48a26d694 (patch) | |
tree | 9c8c16901d364fef2ec86e195d49982cb729b47b /clang/test/SemaOpenCL/invalid-kernel.cl | |
parent | 20b9966e5f6a7cc0e0d374492c2de1062888b156 (diff) | |
download | bcm5719-llvm-16cb99dd15834bcc0c857e0bbfb1c9b48a26d694.tar.gz bcm5719-llvm-16cb99dd15834bcc0c857e0bbfb1c9b48a26d694.zip |
[OpenCL] Produce an error if an address space is used on the return
type of a function.
llvm-svn: 198597
Diffstat (limited to 'clang/test/SemaOpenCL/invalid-kernel.cl')
-rw-r--r-- | clang/test/SemaOpenCL/invalid-kernel.cl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/invalid-kernel.cl b/clang/test/SemaOpenCL/invalid-kernel.cl index c12bd8414e2..62991d46420 100644 --- a/clang/test/SemaOpenCL/invalid-kernel.cl +++ b/clang/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; +} |