[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / pointer_promotion.c
blobd18d0ca4d1a62e34bf2821a2e5b896b3e4404fd3
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 void test(void) {
4 void *vp;
5 int *ip;
6 char *cp;
7 struct foo *fp;
8 struct bar *bp;
9 short sint = 7;
11 if (ip < cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}}
12 if (cp < fp) {} // expected-warning {{comparison of distinct pointer types ('char *' and 'struct foo *')}}
13 if (fp < bp) {} // expected-warning {{comparison of distinct pointer types ('struct foo *' and 'struct bar *')}}
14 if (ip < 7) {} // expected-warning {{comparison between pointer and integer ('int *' and 'int')}}
15 if (sint < ip) {} // expected-warning {{comparison between pointer and integer ('short' and 'int *')}}
16 if (ip == cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}}