diff options
author | Egor Churaev <egor.churaev@gmail.com> | 2017-04-05 09:02:56 +0000 |
---|---|---|
committer | Egor Churaev <egor.churaev@gmail.com> | 2017-04-05 09:02:56 +0000 |
commit | 77f5ac21530fce04bda39c16db775f586a102e18 (patch) | |
tree | 166e308102d7917d9b0c39aa3f901acccd828a6b /test/SemaOpenCL | |
parent | b49003d6f8e81c3622eb792f29375900f4978a9c (diff) |
[OpenCL] Enables passing sampler initializer to function argument
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: yaxunl, bader
Differential Revision: https://reviews.llvm.org/D31594
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/sampler_t.cl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/SemaOpenCL/sampler_t.cl b/test/SemaOpenCL/sampler_t.cl index c87b6da7c7..0dddeeb390 100644 --- a/test/SemaOpenCL/sampler_t.cl +++ b/test/SemaOpenCL/sampler_t.cl @@ -30,7 +30,7 @@ constant sampler_t glb_smp8 = 1.0f; // expected-error{{initializing '__constant constant sampler_t glb_smp9 = 0x100000000LL; // expected-error{{sampler_t initialization requires 32-bit integer, not 'long long'}} -void foo(sampler_t); +void foo(sampler_t); // expected-note{{passing argument to parameter here}} constant struct sampler_s { sampler_t smp; // expected-error{{the 'sampler_t' type cannot be used to declare a structure or union field}} @@ -65,7 +65,8 @@ void kernel ker(sampler_t argsmp) { foo(const_smp5); foo(const_smp6); foo(argsmp); - foo(5); // expected-error{{sampler_t variable required - got 'int'}} + foo(5); + foo(5.0f); // expected-error {{passing 'float' to parameter of incompatible type 'sampler_t'}} sampler_t sa[] = {argsmp, const_smp}; // expected-error {{array of 'sampler_t' type is invalid in OpenCL}} foo(sa[0]); foo(bad()); |