2013-01-20 20:31:11 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
|
|
|
|
|
|
|
|
event_t glb_evt; // expected-error {{the event_t type cannot be used to declare a program scope variable}}
|
|
|
|
|
2013-04-06 04:14:50 +08:00
|
|
|
constant struct evt_s {
|
2016-03-03 21:33:19 +08:00
|
|
|
event_t evt; // expected-error {{the 'event_t' type cannot be used to declare a structure or union field}}
|
2014-01-03 22:16:55 +08:00
|
|
|
} evt_str = {0};
|
2013-01-20 20:31:11 +08:00
|
|
|
|
|
|
|
void foo(event_t evt); // expected-note {{passing argument to parameter 'evt' here}}
|
|
|
|
|
2013-07-23 09:23:36 +08:00
|
|
|
void kernel ker(event_t argevt) { // expected-error {{'event_t' cannot be used as the type of a kernel parameter}}
|
2013-01-20 20:31:11 +08:00
|
|
|
event_t e;
|
|
|
|
constant event_t const_evt; // expected-error {{the event_t type can only be used with __private address space qualifier}}
|
|
|
|
foo(e);
|
|
|
|
foo(0);
|
|
|
|
foo(5); // expected-error {{passing 'int' to parameter of incompatible type 'event_t'}}
|
2016-05-21 01:18:16 +08:00
|
|
|
foo((event_t)1); // expected-error {{cannot cast non-zero value '1' to 'event_t'}}
|
2013-01-20 20:31:11 +08:00
|
|
|
}
|
2013-07-23 09:23:36 +08:00
|
|
|
|