1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-unreachable-code %s
3 typedef __attribute__(( ext_vector_type(4) )) int int4
;
5 static int4
test1(void) {
8 // comparisons to self...
9 return vec
== vec
; // expected-warning{{self-comparison always evaluates to true}}
10 return vec
!= vec
; // expected-warning{{self-comparison always evaluates to false}}
11 return vec
< vec
; // expected-warning{{self-comparison always evaluates to false}}
12 return vec
<= vec
; // expected-warning{{self-comparison always evaluates to true}}
13 return vec
> vec
; // expected-warning{{self-comparison always evaluates to false}}
14 return vec
>= vec
; // expected-warning{{self-comparison always evaluates to true}}
18 typedef __attribute__(( ext_vector_type(4) )) float float4
;
20 static int4
test2(void) {
23 // comparisons to self. no warning, they're floats
24 return vec
== vec
; // no-warning
25 return vec
!= vec
; // no-warning
26 return vec
< vec
; // no-warning
27 return vec
<= vec
; // no-warning
28 return vec
> vec
; // no-warning
29 return vec
>= vec
; // no-warning
32 static int4
test3(void) {
35 return i0
> i1
? i0
: i1
; // no-error
36 return i0
? i0
: i1
; // no-error
39 static float4
test4(void) {
42 // This would actually generate implicit casting warning
43 // under Weverything flag but we don't really care here
44 return f0
> f1
? f0
: f1
; // no-error
45 return f0
? f0
: f1
; // expected-error {{used type 'float4' (vector of 4 'float' values) where floating point type is not allowed}}