15d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unreachable-code %s
25d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
35d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregortypedef __attribute__(( ext_vector_type(4) )) int int4;
45d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
55d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregorstatic int4 test1() {
65d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  int4 vec, rv;
75d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
85d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  // comparisons to self...
95d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec == vec; // expected-warning{{self-comparison always evaluates to a constant}}
105d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec != vec; // expected-warning{{self-comparison always evaluates to a constant}}
115d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec < vec; // expected-warning{{self-comparison always evaluates to a constant}}
125d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec <= vec; // expected-warning{{self-comparison always evaluates to a constant}}
135d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec > vec; // expected-warning{{self-comparison always evaluates to a constant}}
145d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec >= vec; // expected-warning{{self-comparison always evaluates to a constant}}
155d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor}
165d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
175d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
185d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregortypedef __attribute__(( ext_vector_type(4) )) float float4;
195d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
205d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregorstatic int4 test2() {
215d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  float4 vec, rv;
225d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor
235d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  // comparisons to self.  no warning, they're floats
245d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec == vec; // no-warning
255d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec != vec; // no-warning
265d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec < vec;  // no-warning
275d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec <= vec; // no-warning
285d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec > vec;  // no-warning
295d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor  return vec >= vec; // no-warning
305d8e67ed117c2e0a19acaa8d8f7c7dd900011b60Douglas Gregor}
31