From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Parser/pointer_promotion.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 clang/test/Parser/pointer_promotion.c (limited to 'clang/test/Parser/pointer_promotion.c') diff --git a/clang/test/Parser/pointer_promotion.c b/clang/test/Parser/pointer_promotion.c new file mode 100644 index 0000000..30589d0 --- /dev/null +++ b/clang/test/Parser/pointer_promotion.c @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void test() { + void *vp; + int *ip; + char *cp; + struct foo *fp; + struct bar *bp; + short sint = 7; + + if (ip < cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} + if (cp < fp) {} // expected-warning {{comparison of distinct pointer types ('char *' and 'struct foo *')}} + if (fp < bp) {} // expected-warning {{comparison of distinct pointer types ('struct foo *' and 'struct bar *')}} + if (ip < 7) {} // expected-warning {{comparison between pointer and integer ('int *' and 'int')}} + if (sint < ip) {} // expected-warning {{comparison between pointer and integer ('int' and 'int *')}} + if (ip == cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} +} -- cgit v1.2.3