1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s 2*f4a2713aSLionel Sambuc test()3*f4a2713aSLionel Sambucvoid test() { 4*f4a2713aSLionel Sambuc void *vp; 5*f4a2713aSLionel Sambuc int *ip; 6*f4a2713aSLionel Sambuc char *cp; 7*f4a2713aSLionel Sambuc struct foo *fp; 8*f4a2713aSLionel Sambuc struct bar *bp; 9*f4a2713aSLionel Sambuc short sint = 7; 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc if (ip < cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} 12*f4a2713aSLionel Sambuc if (cp < fp) {} // expected-warning {{comparison of distinct pointer types ('char *' and 'struct foo *')}} 13*f4a2713aSLionel Sambuc if (fp < bp) {} // expected-warning {{comparison of distinct pointer types ('struct foo *' and 'struct bar *')}} 14*f4a2713aSLionel Sambuc if (ip < 7) {} // expected-warning {{comparison between pointer and integer ('int *' and 'int')}} 15*f4a2713aSLionel Sambuc if (sint < ip) {} // expected-warning {{comparison between pointer and integer ('int' and 'int *')}} 16*f4a2713aSLionel Sambuc if (ip == cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} 17*f4a2713aSLionel Sambuc } 18