null_queue.cl 1012 B

123456789101112131415161718192021222324252627282930
  1. // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
  2. extern queue_t get_default_queue();
  3. void queue_arg(queue_t); // expected-note {{passing argument to parameter here}}
  4. void init() {
  5. queue_t q1 = 1; // expected-error{{initializing 'queue_t' with an expression of incompatible type 'int'}}
  6. queue_t q = 0;
  7. }
  8. void assign() {
  9. queue_t q2, q3;
  10. q2 = 5; // expected-error{{assigning to 'queue_t' from incompatible type 'int'}}
  11. q3 = 0;
  12. q2 = q3 = 0;
  13. }
  14. bool compare() {
  15. queue_t q4, q5;
  16. return 1 == get_default_queue() && // expected-error{{invalid operands to binary expression ('int' and 'queue_t')}}
  17. get_default_queue() == 1 && // expected-error{{invalid operands to binary expression ('queue_t' and 'int')}}
  18. q4 == q5 &&
  19. q4 != 0 &&
  20. q4 != 0.0f; // expected-error{{invalid operands to binary expression ('queue_t' and 'float')}}
  21. }
  22. void call() {
  23. queue_arg(5); // expected-error {{passing 'int' to parameter of incompatible type 'queue_t'}}
  24. queue_arg(0);
  25. }