diff options
| author | Anastasia Stulova <anastasia.stulova@arm.com> | 2016-03-31 11:07:22 +0000 |
|---|---|---|
| committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2016-03-31 11:07:22 +0000 |
| commit | c4bb5df4ab2806f0cab8f9e07138fa627c6ab471 (patch) | |
| tree | 55e68a24ee3561ee96c788fd4497c1339fa8939f /clang/test/SemaOpenCL/nosvm.cl | |
| parent | cad9a8a6bb3f26f2d7dad6aeca83f2ce5ada0eef (diff) | |
| download | bcm5719-llvm-c4bb5df4ab2806f0cab8f9e07138fa627c6ab471.tar.gz bcm5719-llvm-c4bb5df4ab2806f0cab8f9e07138fa627c6ab471.zip | |
[OpenCL] Added nosvm attribute for OpenCL v2.0.
It is not widely used and removed from OpenCL v2.1.
This change modifies Clang to parse the attribute for OpenCL
but ignores it afterwards.
Patch by Liu Yaxun (Sam)!
Differential Revision: http://reviews.llvm.org/D17861
llvm-svn: 265006
Diffstat (limited to 'clang/test/SemaOpenCL/nosvm.cl')
| -rw-r--r-- | clang/test/SemaOpenCL/nosvm.cl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/nosvm.cl b/clang/test/SemaOpenCL/nosvm.cl new file mode 100644 index 00000000000..658cb3aaf4d --- /dev/null +++ b/clang/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 |

