diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
| commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
| tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/SemaOpenCL/nosvm.cl | |
| parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) | |
Notes
Diffstat (limited to 'test/SemaOpenCL/nosvm.cl')
| -rw-r--r-- | test/SemaOpenCL/nosvm.cl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaOpenCL/nosvm.cl b/test/SemaOpenCL/nosvm.cl new file mode 100644 index 000000000000..658cb3aaf4d1 --- /dev/null +++ b/test/SemaOpenCL/nosvm.cl @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -verify %s +// RUN: %clang_cc1 -verify -cl-std=CL2.0 -D CL20 %s +// RUN: %clang_cc1 -verify -x c -D NOCL %s + +#ifndef NOCL +kernel void f(__attribute__((nosvm)) global int* a); +#ifndef CL20 +// expected-error@-2 {{'nosvm' attribute requires OpenCL version 2.0}} +#else +// expected-warning@-4 {{'nosvm' attribute is deprecated and ignored in OpenCL version 2.0}} +#endif + +__attribute__((nosvm)) void g(); // expected-warning {{'nosvm' attribute only applies to variables}} + +#else +void f(__attribute__((nosvm)) int* a); // expected-warning {{'nosvm' attribute ignored}} +#endif |
