2013-02-07 18:55:47 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
|
|
|
|
|
|
|
|
constant sampler_t glb_smp = 5;
|
|
|
|
|
2016-03-03 21:33:19 +08:00
|
|
|
void foo(sampler_t);
|
|
|
|
|
|
|
|
constant struct sampler_s {
|
|
|
|
sampler_t smp; // expected-error {{the 'sampler_t' type cannot be used to declare a structure or union field}}
|
|
|
|
} sampler_str = {0};
|
2013-02-07 18:55:47 +08:00
|
|
|
|
|
|
|
void kernel ker(sampler_t argsmp) {
|
|
|
|
local sampler_t smp; // expected-error {{sampler type cannot be used with the __local and __global address space qualifiers}}
|
|
|
|
const sampler_t const_smp = 7;
|
|
|
|
foo(glb_smp);
|
|
|
|
foo(const_smp);
|
|
|
|
foo(5); // expected-error {{sampler_t variable required - got 'int'}}
|
2016-02-25 11:34:20 +08:00
|
|
|
sampler_t sa[] = {argsmp, const_smp}; // expected-error {{array of 'sampler_t' type is invalid in OpenCL}}
|
2013-02-07 18:55:47 +08:00
|
|
|
}
|
2016-02-25 11:34:20 +08:00
|
|
|
|
|
|
|
void bad(sampler_t*); // expected-error {{pointer to type 'sampler_t' is invalid in OpenCL}}
|