1 // RUN
: %clang_cc1 %s -verify -cl-std
=CL1.2 -triple x86_64-unknown-linux-gnu
3 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
4 typedef __attribute__
((ext_vector_type(4))) float float4
;
5 typedef __attribute__
((ext_vector_type(4))) double double4
;
6 typedef __attribute__
((ext_vector_type(4))) int int4
;
7 typedef __attribute__
((ext_vector_type(4))) long long4
;
9 kernel void float_ops
() {
10 int flaf
= 0.0f
&& 0.0f
;
11 int flof
= 0.0f ||
0.0f
;
12 float fbaf
= 0.0f
& 0.0f
; // expected-error {{invalid operands}}
13 float fbof
= 0.0f |
0.0f
; // expected-error {{invalid operands}}
14 float fbxf
= 0.0f ^
0.0f
; // expected-error {{invalid operands}}
17 float ibaf
= 0 & 0.0f
; // expected-error {{invalid operands}}
18 float ibof
= 0 |
0.0f
; // expected-error {{invalid operands}}
19 float bnf
= ~
0.0f
;// expected-error {{invalid argument type}}
23 kernel void vec_float_ops
() {
24 float4 f4
= (float4)(0, 0, 0, 0);
25 int4 f4laf
= f4
&& 0.0f
;
26 int4 f4lof
= f4 ||
0.0f
;
27 float4 f4baf
= f4
& 0.0f
; // expected-error {{invalid operands}}
28 float4 f4bof
= f4 |
0.0f
; // expected-error {{invalid operands}}
29 float4 f4bxf
= f4 ^
0.0f
; // expected-error {{invalid operands}}
30 float bnf4
= ~f4
; // expected-error {{invalid argument type}}
34 kernel void double_ops
() {
35 int flaf
= 0.0 && 0.0;
36 int flof
= 0.0 ||
0.0;
37 double fbaf
= 0.0 & 0.0; // expected-error {{invalid operands}}
38 double fbof
= 0.0 |
0.0; // expected-error {{invalid operands}}
39 double fbxf
= 0.0 ^
0.0; // expected-error {{invalid operands}}
42 double ibaf
= 0 & 0.0; // expected-error {{invalid operands}}
43 double ibof
= 0 |
0.0; // expected-error {{invalid operands}}
44 double bnf
= ~
0.0; // expected-error {{invalid argument type}}
48 kernel void vec_double_ops
() {
49 double4 f4
= (double4)(0, 0, 0, 0);
50 long4 f4laf
= f4
&& 0.0;
51 long4 f4lof
= f4 ||
0.0;
52 double4 f4baf
= f4
& 0.0; // expected-error {{invalid operands}}
53 double4 f4bof
= f4 |
0.0; // expected-error {{invalid operands}}
54 double4 f4bxf
= f4 ^
0.0; // expected-error {{invalid operands}}
55 double bnf4
= ~f4
; // expected-error {{invalid argument type}}