diff options
| author | Anastasia Stulova <anastasia.stulova@arm.com> | 2016-05-12 16:28:25 +0000 |
|---|---|---|
| committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2016-05-12 16:28:25 +0000 |
| commit | 43ab9a00eb165625e07c1bc92afcfb521e926b1d (patch) | |
| tree | 10be147ffb481fa49fbd93e8015e6284805b5117 /clang/test | |
| parent | c28531295daa574b681d485096b0ddfd48eb188e (diff) | |
| download | bcm5719-llvm-43ab9a00eb165625e07c1bc92afcfb521e926b1d.tar.gz bcm5719-llvm-43ab9a00eb165625e07c1bc92afcfb521e926b1d.zip | |
[OpenCL] Output OpenCL version in diagnostics.
Diagnostics should note version dependent issues by giving
a hint about current version being compiled for.
This patch changes diagnostics of static storage class specifier
and generic type qualifier to specify OpenCL version as well as
converts other diagnostics to match the style.
Patch by Vedran Miletic!
Review: http://reviews.llvm.org/D19780
llvm-svn: 269305
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/opencl-cl20.cl | 12 | ||||
| -rw-r--r-- | clang/test/Parser/opencl-storage-class.cl | 8 | ||||
| -rw-r--r-- | clang/test/SemaOpenCL/invalid-access-qualifier.cl | 2 | ||||
| -rw-r--r-- | clang/test/SemaOpenCL/storageclass.cl | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/clang/test/Parser/opencl-cl20.cl b/clang/test/Parser/opencl-cl20.cl index b71869919ba..b14ad10153d 100644 --- a/clang/test/Parser/opencl-cl20.cl +++ b/clang/test/Parser/opencl-cl20.cl @@ -10,9 +10,9 @@ __generic int * __generic_test(__generic int *arg) { return var; } #ifndef CL20 -// expected-error@-5 {{OpenCL does not support the '__generic' type qualifier}} -// expected-error@-6 {{OpenCL does not support the '__generic' type qualifier}} -// expected-error@-6 {{OpenCL does not support the '__generic' type qualifier}} +// expected-error@-5 {{OpenCL version 1.0 does not support the '__generic' type qualifier}} +// expected-error@-6 {{OpenCL version 1.0 does not support the '__generic' type qualifier}} +// expected-error@-6 {{OpenCL version 1.0 does not support the '__generic' type qualifier}} #endif generic int * generic_test(generic int *arg) { @@ -20,7 +20,7 @@ generic int * generic_test(generic int *arg) { return var; } #ifndef CL20 -// expected-error@-5 {{OpenCL does not support the 'generic' type qualifier}} -// expected-error@-6 {{OpenCL does not support the 'generic' type qualifier}} -// expected-error@-6 {{OpenCL does not support the 'generic' type qualifier}} +// expected-error@-5 {{OpenCL version 1.0 does not support the 'generic' type qualifier}} +// expected-error@-6 {{OpenCL version 1.0 does not support the 'generic' type qualifier}} +// expected-error@-6 {{OpenCL version 1.0 does not support the 'generic' type qualifier}} #endif diff --git a/clang/test/Parser/opencl-storage-class.cl b/clang/test/Parser/opencl-storage-class.cl index 34cba693f04..6316ba7701d 100644 --- a/clang/test/Parser/opencl-storage-class.cl +++ b/clang/test/Parser/opencl-storage-class.cl @@ -2,10 +2,10 @@ void test_storage_class_specs() { - static int a; // expected-error {{OpenCL does not support the 'static' storage class specifier}} - register int b; // expected-error {{OpenCL does not support the 'register' storage class specifier}} - extern int c; // expected-error {{OpenCL does not support the 'extern' storage class specifier}} - auto int d; // expected-error {{OpenCL does not support the 'auto' storage class specifier}} + static int a; // expected-error {{OpenCL version 1.0 does not support the 'static' storage class specifier}} + register int b; // expected-error {{OpenCL version 1.0 does not support the 'register' storage class specifier}} + extern int c; // expected-error {{OpenCL version 1.0 does not support the 'extern' storage class specifier}} + auto int d; // expected-error {{OpenCL version 1.0 does not support the 'auto' storage class specifier}} #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable static int e; // expected-error {{static local variable must reside in constant address space}} diff --git a/clang/test/SemaOpenCL/invalid-access-qualifier.cl b/clang/test/SemaOpenCL/invalid-access-qualifier.cl index 8dc7002e1b4..1aeb996dde7 100644 --- a/clang/test/SemaOpenCL/invalid-access-qualifier.cl +++ b/clang/test/SemaOpenCL/invalid-access-qualifier.cl @@ -10,5 +10,5 @@ void test3(read_only read_only image1d_t i){} // expected-error{{multiple access #ifdef CL20 void test4(read_write pipe int i){} // expected-error{{access qualifier 'read_write' can not be used for 'pipe int'}} #else -void test4(__read_write image1d_t i) {} // expected-error{{access qualifier '__read_write' can not be used for '__read_write image1d_t' earlier than OpenCL2.0 version}} +void test4(__read_write image1d_t i) {} // expected-error{{access qualifier '__read_write' can not be used for '__read_write image1d_t' earlier than OpenCL version 2.0}} #endif diff --git a/clang/test/SemaOpenCL/storageclass.cl b/clang/test/SemaOpenCL/storageclass.cl index 1d940de2324..a93f8244dcb 100644 --- a/clang/test/SemaOpenCL/storageclass.cl +++ b/clang/test/SemaOpenCL/storageclass.cl @@ -13,7 +13,7 @@ void kernel foo() { constant int L1 = 0; local int L2; - auto int L3 = 7; // expected-error{{OpenCL does not support the 'auto' storage class specifier}} + auto int L3 = 7; // expected-error{{OpenCL version 1.2 does not support the 'auto' storage class specifier}} global int L4; // expected-error{{function scope variable cannot be declared in global address space}} } |

